Skip to content

Commit bf405f7

Browse files
fix test
1 parent cfd3558 commit bf405f7

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

awscrt/crypto.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ def new_generate(type: ECType) -> 'EC':
260260
"""
261261
Generates a new instance of EC key pair.
262262
"""
263-
return EC(binding=_awscrt.ec_new_generate())
263+
return EC(binding=_awscrt.ec_new_generate(type))
264264

265265
@staticmethod
266266
def new_key_from_der_data(der_data: Union[bytes, bytearray, memoryview]) -> 'EC':

test/test_crypto.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# SPDX-License-Identifier: Apache-2.0.
33

44

5+
from awscrt.io import LogLevel, init_logging
56
from test import NativeResourceTest
67
from awscrt.crypto import Hash, RSA, RSAEncryptionAlgorithm, RSASignatureAlgorithm, ED25519, ED25519ExportFormat, EC, ECType, ECRawSignature
78
import base64
@@ -115,9 +116,9 @@
115116
'nGXWA0Gp6UWgpg4Hvjdsu+0FQ3AhDMBKZZ8fBFb4EW+HRQIHPnbH')
116117

117118
EC_PRIVATE_KEY_SEC1_BASE64 = (
118-
'MHcCAQEEIJkWKltOY4ZMX4439yu9lx1caIAYw5EPw8P5Osl6S6P2oAoGCCqGSM49'
119-
'AwEHoUQDQgAE7GzXS9wzwlYyrVJWrPXw5iiZhIOvc2/+14M7QoFdLuDb9qykxhZ+'
120-
'PuD/e0PooTZQkoMGlLPUkwbeY4qhHD+yVw=='
119+
'MHcCAQEEIHjt7c+VnkIkN6RW7QgZPFNLb/9AZEhqSYYMtwrlLb3WoAoGCCqGSM49'
120+
'AwEHoUQDQgAEv2FjRpMtADMZ4zoZxshV9chEkembgzZnXSUNe+DA8dKqXN/7qTcZ'
121+
'jYJHKIi+Rn88zUGqCJo3DWF/X+ufVfdU2g=='
121122
)
122123

123124

@@ -368,6 +369,7 @@ def test_ec_asn1_signing_roundtrip(self):
368369

369370
(r, s) = EC.decode_der_signature(signature)
370371
self.assertEqual(signature, EC.encode_raw_signature(ECRawSignature(r=r, s=s)))
372+
print(base64.b64encode(signature))
371373

372374
self.assertTrue(ec.verify(digest, signature))
373375

0 commit comments

Comments
 (0)