diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2015-08-12 17:13:31 -0500 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2015-08-12 17:13:31 -0500 |
commit | 56b1a88b6565f2239c717bb3c8514f84f55ee855 (patch) | |
tree | df7c703853e8d1918d467156153edc27bccaef74 /tests/hazmat/primitives/test_dsa.py | |
parent | f15a0a096289688f13c193633811c4aef0974e2f (diff) | |
parent | 38df44151cdc6591385c4ec1691e782d05c8aec7 (diff) | |
download | cryptography-56b1a88b6565f2239c717bb3c8514f84f55ee855.tar.gz cryptography-56b1a88b6565f2239c717bb3c8514f84f55ee855.tar.bz2 cryptography-56b1a88b6565f2239c717bb3c8514f84f55ee855.zip |
Merge pull request #2262 from viraptor/non-bytes-signatures
Ensure early exeption on non-bytes signature
Diffstat (limited to 'tests/hazmat/primitives/test_dsa.py')
-rw-r--r-- | tests/hazmat/primitives/test_dsa.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/hazmat/primitives/test_dsa.py b/tests/hazmat/primitives/test_dsa.py index c263ef2b..d1f8f341 100644 --- a/tests/hazmat/primitives/test_dsa.py +++ b/tests/hazmat/primitives/test_dsa.py @@ -583,6 +583,11 @@ class TestDSAVerification(object): with pytest.raises(InvalidSignature): verifier.verify() + def test_signature_not_bytes(self, backend): + public_key = DSA_KEY_1024.public_numbers.public_key(backend) + with pytest.raises(TypeError): + public_key.verifier(1234, hashes.SHA1()) + def test_use_after_finalize(self, backend): public_key = DSA_KEY_1024.public_numbers.public_key(backend) verifier = public_key.verifier(b'fakesig', hashes.SHA1()) |