From 73251faf2cb043dc9795b46c98c7084482d2aed2 Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Sat, 6 Dec 2014 23:17:23 -0600 Subject: catch PyAsn1Error when decoding rfc6979 signature --- tests/hazmat/primitives/test_asym_utils.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tests') diff --git a/tests/hazmat/primitives/test_asym_utils.py b/tests/hazmat/primitives/test_asym_utils.py index f8a67b68..640b5b3d 100644 --- a/tests/hazmat/primitives/test_asym_utils.py +++ b/tests/hazmat/primitives/test_asym_utils.py @@ -39,3 +39,8 @@ def test_rfc6979_signature(): def test_decode_rfc6979_trailing_bytes(): with pytest.raises(ValueError): decode_rfc6979_signature(b"0\x06\x02\x01\x01\x02\x01\x01\x00\x00\x00") + + +def test_decode_rfc6979_invalid_asn1(): + with pytest.raises(ValueError): + decode_rfc6979_signature(b"0\x07\x02\x01\x01\x02\x02\x01") -- cgit v1.2.3