aboutsummaryrefslogtreecommitdiffstats
path: root/tests/hazmat/primitives/test_dsa.py
diff options
context:
space:
mode:
authorStanisław Pitucha <stanislaw.pitucha@hp.com>2015-08-12 15:30:25 +1000
committerStanisław Pitucha <stanislaw.pitucha@hp.com>2015-08-12 16:32:59 +1000
commit38df44151cdc6591385c4ec1691e782d05c8aec7 (patch)
treec3af40867c8f9e85731fd0df0dc861b0301b3f1c /tests/hazmat/primitives/test_dsa.py
parent305bee427aa5bf5908b74f384d90a29879ac7f6a (diff)
downloadcryptography-38df44151cdc6591385c4ec1691e782d05c8aec7.tar.gz
cryptography-38df44151cdc6591385c4ec1691e782d05c8aec7.tar.bz2
cryptography-38df44151cdc6591385c4ec1691e782d05c8aec7.zip
Enforce signature type in ECDSA and add tests
Ensure that ECDSA signatures are bytes to match RSA/DSA and add tests for all three.
Diffstat (limited to 'tests/hazmat/primitives/test_dsa.py')
-rw-r--r--tests/hazmat/primitives/test_dsa.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/hazmat/primitives/test_dsa.py b/tests/hazmat/primitives/test_dsa.py
index b6b0de94..53e41883 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())