File tree Expand file tree Collapse file tree 2 files changed +4
-7
lines changed Expand file tree Collapse file tree 2 files changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,4 @@ pub enum Error {
38
38
aws_smithy_runtime_api:: client:: orchestrator:: HttpResponse ,
39
39
> ,
40
40
) ,
41
- #[ error( "failed verification while converting signature to string" ) ]
42
- SignatureConversionFailure ,
43
41
}
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ use crate::manifests::RevocationInfo;
5
5
use crate :: sha256:: hash_sha256;
6
6
use crate :: signatures:: { PublicKeysRepository , Signable , SignedPayload } ;
7
7
use crate :: Error ;
8
+ use base64:: Engine ;
8
9
use serde:: { Deserialize , Serialize } ;
9
10
use time:: OffsetDateTime ;
10
11
@@ -51,13 +52,11 @@ impl PublicKey {
51
52
return Err ( Error :: VerificationFailed ) ;
52
53
}
53
54
54
- let signature_as_string = match serde_json:: to_string ( signature) {
55
- Ok ( sig) => sig,
56
- Err ( _) => return Err ( Error :: SignatureConversionFailure ) ,
57
- } ;
55
+ let based_signature =
56
+ base64:: engine:: general_purpose:: STANDARD . encode ( signature. as_bytes ( ) ) ;
58
57
if verified_revoked_content
59
58
. revoked_content_sha256
60
- . contains ( & signature_as_string )
59
+ . contains ( & based_signature )
61
60
{
62
61
return Err ( Error :: VerificationFailed ) ;
63
62
}
You can’t perform that action at this time.
0 commit comments