aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_x509.py
diff options
context:
space:
mode:
authorNick Bastin <nick.bastin@gmail.com>2015-12-17 05:28:49 -0800
committerNick Bastin <nick.bastin@gmail.com>2015-12-17 05:28:49 -0800
commitf9c30b39f28f25c7da462fe16d989c2050dee2a7 (patch)
treedf6a81c67c74cd4916a6279fc8dbad08d1bc63e0 /tests/test_x509.py
parent6721fb8dd70a2d392aa70b67b35e3c6efa34230b (diff)
downloadcryptography-f9c30b39f28f25c7da462fe16d989c2050dee2a7.tar.gz
cryptography-f9c30b39f28f25c7da462fe16d989c2050dee2a7.tar.bz2
cryptography-f9c30b39f28f25c7da462fe16d989c2050dee2a7.zip
Avoid IndexError on too-short OIDs, add test for regression
Diffstat (limited to 'tests/test_x509.py')
-rw-r--r--tests/test_x509.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/test_x509.py b/tests/test_x509.py
index 164aff37..ccdff7c4 100644
--- a/tests/test_x509.py
+++ b/tests/test_x509.py
@@ -3251,6 +3251,10 @@ class TestObjectIdentifier(object):
oid = x509.ObjectIdentifier("2.999.1")
assert oid._name == 'Unknown OID'
+ def test_too_short(self):
+ with pytest.raises(ValueError):
+ x509.ObjectIdentifier("1")
+
def test_invalid_input(self):
with pytest.raises(ValueError):
x509.ObjectIdentifier("notavalidform")