From 77c94270bc9c8dfb605a8a8e0b7a4e979dcb153f Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Sat, 9 Dec 2017 22:46:07 -0500 Subject: update the ec tests to not emit 3000 warnings (#4048) --- tests/hazmat/primitives/test_ec.py | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'tests/hazmat/primitives/test_ec.py') diff --git a/tests/hazmat/primitives/test_ec.py b/tests/hazmat/primitives/test_ec.py index 4f08f184..02b1cdc6 100644 --- a/tests/hazmat/primitives/test_ec.py +++ b/tests/hazmat/primitives/test_ec.py @@ -514,12 +514,11 @@ class TestECDSAVectors(object): signature = encode_dss_signature(vector['r'], vector['s']) - verifier = key.verifier( + key.verify( signature, + vector['message'], ec.ECDSA(hash_type()) ) - verifier.update(vector['message']) - verifier.verify() @pytest.mark.parametrize( "vector", @@ -543,17 +542,19 @@ class TestECDSAVectors(object): signature = encode_dss_signature(vector['r'], vector['s']) - verifier = key.verifier( - signature, - ec.ECDSA(hash_type()) - ) - verifier.update(vector['message']) - if vector["fail"] is True: with pytest.raises(exceptions.InvalidSignature): - verifier.verify() + key.verify( + signature, + vector['message'], + ec.ECDSA(hash_type()) + ) else: - verifier.verify() + key.verify( + signature, + vector['message'], + ec.ECDSA(hash_type()) + ) def test_sign(self, backend): _skip_curve_unsupported(backend, ec.SECP256R1()) -- cgit v1.2.3