diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2015-10-10 09:03:07 -0400 |
---|---|---|
committer | Alex Gaynor <alex.gaynor@gmail.com> | 2015-10-10 09:03:07 -0400 |
commit | 96605fcd47ab4e20829a555ed5450cf99263d431 (patch) | |
tree | 5bdff61f07af872bdef02cc872728237b635d808 /tests/test_x509.py | |
parent | 8e69350d8ad92a6153de27ba2eb2739bc113716f (diff) | |
download | cryptography-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.py | 15 |
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): |