aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_x509.py
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2015-10-10 09:03:07 -0400
committerAlex Gaynor <alex.gaynor@gmail.com>2015-10-10 09:03:07 -0400
commit96605fcd47ab4e20829a555ed5450cf99263d431 (patch)
tree5bdff61f07af872bdef02cc872728237b635d808 /tests/test_x509.py
parent8e69350d8ad92a6153de27ba2eb2739bc113716f (diff)
downloadcryptography-96605fcd47ab4e20829a555ed5450cf99263d431.tar.gz
cryptography-96605fcd47ab4e20829a555ed5450cf99263d431.tar.bz2
cryptography-96605fcd47ab4e20829a555ed5450cf99263d431.zip
Fixed #2404 -- handle a certificate with an unknown public key
Diffstat (limited to 'tests/test_x509.py')
-rw-r--r--tests/test_x509.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/test_x509.py b/tests/test_x509.py
index 0c022df1..8035886c 100644
--- a/tests/test_x509.py
+++ b/tests/test_x509.py
@@ -2395,6 +2395,21 @@ class TestECDSACertificate(object):
]
+@pytest.mark.requires_backend_interface(interface=X509Backend)
+class TestOtherCertificate(object):
+ def test_unsupported_subject_public_key_info(self, backend):
+ cert = _load_cert(
+ os.path.join(
+ "x509", "custom", "unsupported_subject_public_key_info.pem"
+ ),
+ x509.load_pem_x509_certificate,
+ backend,
+ )
+
+ with pytest.raises(ValueError):
+ cert.public_key()
+
+
class TestNameAttribute(object):
def test_init_bad_oid(self):
with pytest.raises(TypeError):