diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2014-12-17 08:42:42 -0600 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2014-12-17 08:42:42 -0600 |
commit | 2cfa45fd168273eaf3b616730255fc063faf5257 (patch) | |
tree | 38f5fedbf4e5385bf4ed0147109fd79c794c27a7 /tests/hazmat/primitives/test_serialization.py | |
parent | 75257daa6d21a1e79565176f7ee90c3ebb4a4680 (diff) | |
download | cryptography-2cfa45fd168273eaf3b616730255fc063faf5257.tar.gz cryptography-2cfa45fd168273eaf3b616730255fc063faf5257.tar.bz2 cryptography-2cfa45fd168273eaf3b616730255fc063faf5257.zip |
update docs, hoist b64decode up and re-add test for it
Diffstat (limited to 'tests/hazmat/primitives/test_serialization.py')
-rw-r--r-- | tests/hazmat/primitives/test_serialization.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/hazmat/primitives/test_serialization.py b/tests/hazmat/primitives/test_serialization.py index de0ca702..91db318c 100644 --- a/tests/hazmat/primitives/test_serialization.py +++ b/tests/hazmat/primitives/test_serialization.py @@ -690,11 +690,17 @@ class TestPKCS8Serialization(object): @pytest.mark.requires_backend_interface(interface=RSABackend) class TestRSASSHSerialization(object): def test_load_ssh_public_key_unsupported(self, backend): - ssh_key = b'ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTY...' + ssh_key = b'ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTY=' with pytest.raises(UnsupportedAlgorithm): load_ssh_public_key(ssh_key, backend) + def test_load_ssh_public_key_bad_format(self, backend): + ssh_key = b'ssh-rsa not-a-real-key' + + with pytest.raises(ValueError): + load_ssh_public_key(ssh_key, backend) + def test_load_ssh_public_key_rsa_too_short(self, backend): ssh_key = b'ssh-rsa' |