Skip to content

Instantly share code, notes, and snippets.

@geofft
Created April 14, 2015 23:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save geofft/2e341338dbb28d110256 to your computer and use it in GitHub Desktop.
Save geofft/2e341338dbb28d110256 to your computer and use it in GitHub Desktop.
(e)geofft@cactuar:~/src/ssl/cryptography$ git diff
diff --git a/tests/hazmat/primitives/test_asym_utils.py b/tests/hazmat/primitives/test_asym_utils.py
index c3fbedf..e4fd4f2 100644
--- a/tests/hazmat/primitives/test_asym_utils.py
+++ b/tests/hazmat/primitives/test_asym_utils.py
@@ -68,3 +68,11 @@ def test_decode_rfc6979_invalid_asn1():
# 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")
+
+def test_decode_alex_gaynor_crashes():
+ import os
+ d = '/home/geofft/src/ssl/pyasn1/crashers/t'
+ for crasher in os.listdir(d):
+ with pytest.raises(ValueError):
+ print(crasher)
+ decode_rfc6979_signature(open(os.path.join(d, crasher)).read())
(e)geofft@cactuar:~/src/ssl/cryptography$ PYTHONPATH=../pyasn1 py.test tests/hazmat/primitives/test_asym_utils.py
============================================================================= test session starts =============================================================================
platform linux2 -- Python 2.7.6 -- py-1.4.26 -- pytest-2.7.0
rootdir: /home/geofft/src/ssl/cryptography, inifile: tox.ini
collected 5 items
tests/hazmat/primitives/test_asym_utils.py .....
========================================================================== 5 passed in 0.78 seconds ===========================================================================
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment