diff options
author | Zooko O'Whielacronx <zooko@zooko.com> | 2012-03-10 15:39:43 -0800 |
---|---|---|
committer | Zooko O'Whielacronx <zooko@zooko.com> | 2012-03-10 15:39:43 -0800 |
commit | cfb4972043934bbab2eb406bfd840ec6355bed1d (patch) | |
tree | d9fb82eead4ba3f5a18d5d506882b4e885ac11f2 | |
parent | b77b14a544a252b863a53e0eb2fccc4692635ee9 (diff) |
add test of deserializing invalid rsa verifying key
-rw-r--r-- | src/pycryptopp/test/test_rsa.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/pycryptopp/test/test_rsa.py b/src/pycryptopp/test/test_rsa.py index 5370f16..15294bc 100644 --- a/src/pycryptopp/test/test_rsa.py +++ b/src/pycryptopp/test/test_rsa.py @@ -60,6 +60,13 @@ class Signer(unittest.TestCase): else: self.fail("Should have raised error from invalid string") + try: + rsa.create_verifying_key_from_string("invalid string") + except rsa.Error, le: + self.failUnless("decode error" in str(le), le) + else: + self.fail("Should have raised error from invalid string") + class SignAndVerify(unittest.TestCase): def _help_test_sign_and_check(self, signer, verifier, msg): sig = signer.sign(msg) |