aboutsummaryrefslogtreecommitdiffstats
path: root/tests/hazmat/primitives/test_ec.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_ec.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_ec.py')
-rw-r--r--tests/hazmat/primitives/test_ec.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/hazmat/primitives/test_ec.py b/tests/hazmat/primitives/test_ec.py
index 20465a2d..f2e340be 100644
--- a/tests/hazmat/primitives/test_ec.py
+++ b/tests/hazmat/primitives/test_ec.py
@@ -710,3 +710,12 @@ class TestEllipticCurvePEMPublicKeySerialization(object):
key.public_bytes(
serialization.Encoding.PEM, serialization.PublicFormat.PKCS1
)
+
+
+@pytest.mark.requires_backend_interface(interface=EllipticCurveBackend)
+class TestECDSAVerification(object):
+ def test_signature_not_bytes(self, backend):
+ key = ec.generate_private_key(ec.SECP192R1(), backend)
+ public_key = key.public_key()
+ with pytest.raises(TypeError):
+ public_key.verifier(1234, ec.ECDSA(hashes.SHA256()))