diff options
author | Geoffrey Thomas <geofft@ldpreload.com> | 2015-04-13 17:37:13 -0400 |
---|---|---|
committer | Geoffrey Thomas <geofft@ldpreload.com> | 2015-04-13 20:28:25 -0400 |
commit | c2d903bb0a14898e94446dc49517ef9f354463a5 (patch) | |
tree | 32d2e37f8b3d75c56f8addac87955fe0b256df33 /tests/hazmat | |
parent | 249bbd0064d42d78ff51e9a0203db4492453418f (diff) | |
download | cryptography-c2d903bb0a14898e94446dc49517ef9f354463a5.tar.gz cryptography-c2d903bb0a14898e94446dc49517ef9f354463a5.tar.bz2 cryptography-c2d903bb0a14898e94446dc49517ef9f354463a5.zip |
Work around pyasn1's willingness to return endOfOctets in DER parsing
See #1838 for discussion.
Diffstat (limited to 'tests/hazmat')
-rw-r--r-- | tests/hazmat/primitives/test_asym_utils.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/hazmat/primitives/test_asym_utils.py b/tests/hazmat/primitives/test_asym_utils.py index bf55bad8..c3fbedf9 100644 --- a/tests/hazmat/primitives/test_asym_utils.py +++ b/tests/hazmat/primitives/test_asym_utils.py @@ -63,3 +63,8 @@ def test_decode_rfc6979_invalid_asn1(): # This byte sequence has an invalid ASN.1 sequence length as well as # an invalid integer length for the second integer. decode_rfc6979_signature(b"0\x07\x02\x01\x01\x02\x02\x01") + + with pytest.raises(ValueError): + # This is the BER "end-of-contents octets," which pyasn1 is + # wrongly willing to return from top-level DER decoding. + decode_rfc6979_signature(b"\x00\x00") |