aboutsummaryrefslogtreecommitdiffstats
path: root/tests/hazmat/primitives/test_asym_utils.py
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2015-04-13 21:46:26 -0400
committerAlex Gaynor <alex.gaynor@gmail.com>2015-04-13 21:46:26 -0400
commit5054e6591db055b520eacc39db7e5dcd6e6e3a1a (patch)
tree236547e393eb8ef2b24db464213411712f8714c2 /tests/hazmat/primitives/test_asym_utils.py
parentb6c8faa1a473447b9e91ab700a6f9b0af0468432 (diff)
parentc2d903bb0a14898e94446dc49517ef9f354463a5 (diff)
downloadcryptography-5054e6591db055b520eacc39db7e5dcd6e6e3a1a.tar.gz
cryptography-5054e6591db055b520eacc39db7e5dcd6e6e3a1a.tar.bz2
cryptography-5054e6591db055b520eacc39db7e5dcd6e6e3a1a.zip
Merge pull request #1843 from geofft/pyasn1-eoc
Work around pyasn1's willingness to return endOfOctets in DER parsing
Diffstat (limited to 'tests/hazmat/primitives/test_asym_utils.py')
-rw-r--r--tests/hazmat/primitives/test_asym_utils.py5
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")