From 70153dd363e0cc12ef201ca4c1b2cef04dea6b5d Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Sat, 2 Apr 2016 13:03:05 -0400 Subject: Handle two more error conditions correctly * Handle two more error conditions correctly * fixed test case --- tests/hazmat/primitives/test_serialization.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tests/hazmat/primitives') 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" -- cgit v1.2.3