diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2015-10-11 11:36:05 -0500 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2015-10-11 11:36:05 -0500 |
commit | 1ec38f6c1ca84014646d760754482ad7467f5b17 (patch) | |
tree | 5997643f12385f8fdc79db64597500b20978e5dc /tests/test_x509.py | |
parent | 450d9797a2320f85aff317e5cab39cc2339eabec (diff) | |
parent | 79bee4ac1bed42e8df47dcaa11c83e1a55bd0b6f (diff) | |
download | cryptography-1ec38f6c1ca84014646d760754482ad7467f5b17.tar.gz cryptography-1ec38f6c1ca84014646d760754482ad7467f5b17.tar.bz2 cryptography-1ec38f6c1ca84014646d760754482ad7467f5b17.zip |
Merge pull request #2405 from alex/unkonwn-public-key
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): |