Skip to content

Commit 299d196

Browse files
committed
Add a failing test for OpenSSH-formatted ECDSA public keys
1 parent 0a4b8dd commit 299d196

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

tests/keys/testkey_ec_ssh.pub

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ecdsa-sha2-nistp521 AAAAE2VjZHNhLXNoYTItbmlzdHA1MjEAAAAIbmlzdHA1MjEAAACFBAFZwnA8QCdL+TiQWBSHE0XsnRJBCFkb6c2DL7+ZfCFDk9khSYh3VrVOOQ1eIrO/oOm20Gp24dvP9XQS0f5B9bLQHgGFnkydPIMaNzPUNCop17F5uHOhtuFIhmOlh3lpTjyj2ten86cCetqN12kawnRs1/iu0wsGoVgk3os6yUAHvFMFGA==

tests/test_algorithms.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,13 @@ def test_ec_should_accept_pem_private_key_bytes(self):
375375
with open(key_path('testkey_ec'), 'rb') as ec_key:
376376
algo.prepare_key(ec_key.read())
377377

378+
@pytest.mark.skipif(not has_crypto, reason='Not supported without cryptography library')
379+
def test_ec_should_accept_ssh_public_key_bytes(self):
380+
algo = ECAlgorithm(ECAlgorithm.SHA256)
381+
382+
with open(key_path('testkey_ec_ssh.pub'), 'r') as ec_key:
383+
algo.prepare_key(ec_key.read())
384+
378385
@pytest.mark.skipif(not has_crypto, reason='Not supported without cryptography library')
379386
def test_ec_verify_should_return_false_if_signature_invalid(self):
380387
algo = ECAlgorithm(ECAlgorithm.SHA256)

0 commit comments

Comments
 (0)