diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2016-04-02 13:03:05 -0400 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2016-04-02 13:03:05 -0400 |
commit | 70153dd363e0cc12ef201ca4c1b2cef04dea6b5d (patch) | |
tree | adcb5f341b1f52ea54b2fed3c2dd353106482278 /tests | |
parent | 15ab4fc371bc9f94868f430eec9d55bca05e147a (diff) | |
download | cryptography-70153dd363e0cc12ef201ca4c1b2cef04dea6b5d.tar.gz cryptography-70153dd363e0cc12ef201ca4c1b2cef04dea6b5d.tar.bz2 cryptography-70153dd363e0cc12ef201ca4c1b2cef04dea6b5d.zip |
Handle two more error conditions correctly
* Handle two more error conditions correctly
* fixed test case
Diffstat (limited to 'tests')
-rw-r--r-- | tests/hazmat/primitives/test_serialization.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/hazmat/primitives/test_serialization.py b/tests/hazmat/primitives/test_serialization.py index f82e7354..1ba8a3b6 100644 --- a/tests/hazmat/primitives/test_serialization.py +++ b/tests/hazmat/primitives/test_serialization.py @@ -854,6 +854,17 @@ class TestRSASSHSerialization(object): with pytest.raises(ValueError): load_ssh_public_key(ssh_key, backend) + def test_load_ssh_public_key_truncated_int(self, backend): + ssh_key = b'ssh-rsa AAAAB3NzaC1yc2EAAAA=' + + with pytest.raises(ValueError): + load_ssh_public_key(ssh_key, backend) + + ssh_key = b'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAACKr+IHXo' + + with pytest.raises(ValueError): + load_ssh_public_key(ssh_key, backend) + def test_load_ssh_public_key_rsa_comment_with_spaces(self, backend): ssh_key = ( b"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDu/XRP1kyK6Cgt36gts9XAk" |