33
44
55from test import NativeResourceTest
6- from awscrt .crypto import Hash , RSA , RSAEncryptionAlgorithm , RSASignatureAlgorithm , ED25519 , ED25519ExportFormat , EC , ECType
6+ from awscrt .crypto import Hash , RSA , RSAEncryptionAlgorithm , RSASignatureAlgorithm , ED25519 , ED25519ExportFormat , EC , ECType , ECRawSignature
77import base64
88import unittest
99
@@ -341,7 +341,7 @@ def test_ec_p256_signing_roundtrip(self):
341341 signature = ec .sign (digest )
342342
343343 (r , s ) = EC .decode_der_signature (signature )
344- self .assertEquals (signature , EC .encode_der_signature ( r , s ))
344+ self .assertEquals (signature , EC .encode_raw_signature ( ECRawSignature ( r = r , r = s ) ))
345345
346346 self .assertTrue (ec .verify (digest , signature ))
347347
@@ -354,7 +354,7 @@ def test_ec_p384_signing_roundtrip(self):
354354 signature = ec .sign (digest )
355355
356356 (r , s ) = EC .decode_der_signature (signature )
357- self .assertEquals (signature , EC .encode_raw_signature (r , s ))
357+ self .assertEquals (signature , EC .encode_raw_signature (ECRawSignature ( r = r , r = s ) ))
358358
359359 self .assertTrue (ec .verify (digest , signature ))
360360
@@ -367,7 +367,7 @@ def test_ec_asn1_signing_roundtrip(self):
367367 signature = ec .sign (digest )
368368
369369 (r , s ) = EC .decode_der_signature (signature )
370- self .assertEqual (signature , EC .encode_raw_signature (( r , s )))
370+ self .assertEqual (signature , EC .encode_raw_signature (ECRawSignature ( r = r , r = s )))
371371
372372 self .assertTrue (ec .verify (digest , signature ))
373373
0 commit comments