diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2017-05-20 09:01:54 -0700 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2017-05-20 09:01:54 -0700 |
commit | d08ddd5af21de62088c0236bfac1d647a6cb84a2 (patch) | |
tree | 39e09ecca23f734900cc55734c4fd9237e35ad6b /tests | |
parent | 0d92ff8a1680911019dab64deeb4f7ea67224492 (diff) | |
download | cryptography-d08ddd5af21de62088c0236bfac1d647a6cb84a2.tar.gz cryptography-d08ddd5af21de62088c0236bfac1d647a6cb84a2.tar.bz2 cryptography-d08ddd5af21de62088c0236bfac1d647a6cb84a2.zip |
Don't raise an UnsupportedExtension for critical extensions. (#3550)
* Don't raise an UnsupportedExtension for critical extensions.
Fixes #2903
Fixes #2901
Fixes #3325
* Don't link
* Revert "Don't link"
This reverts commit 4fe847f91d9dd45cdc28a4984c4e44aad62a5de6.
* fix
* Revert "Revert "Don't link""
This reverts commit 856031b5a1fbad04ac218fa94ebf37dcd402f3ed.
* fix
* Deprecate this
* Better changelog entry
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_x509.py | 14 | ||||
-rw-r--r-- | tests/test_x509_ext.py | 8 |
2 files changed, 12 insertions, 10 deletions
diff --git a/tests/test_x509.py b/tests/test_x509.py index de19d0d3..c15940e3 100644 --- a/tests/test_x509.py +++ b/tests/test_x509.py @@ -438,8 +438,10 @@ class TestRevokedCertificate(object): backend ) - with pytest.raises(x509.UnsupportedExtension): - crl[0].extensions + ext = crl[0].extensions.get_extension_for_oid( + x509.ObjectIdentifier("1.2.3.4") + ) + assert ext.value.value == b"\n\x01\x00" def test_unsupported_reason(self, backend): crl = _load_cert( @@ -1129,10 +1131,10 @@ class TestRSACertificateRequest(object): x509.load_pem_x509_csr, backend ) - with pytest.raises(x509.UnsupportedExtension) as exc: - request.extensions - - assert exc.value.oid == x509.ObjectIdentifier('1.2.3.4') + ext = request.extensions.get_extension_for_oid( + x509.ObjectIdentifier('1.2.3.4') + ) + assert ext.value.value == b"value" def test_unsupported_extension(self, backend): request = _load_cert( diff --git a/tests/test_x509_ext.py b/tests/test_x509_ext.py index 8210b058..eaf5a51a 100644 --- a/tests/test_x509_ext.py +++ b/tests/test_x509_ext.py @@ -1085,10 +1085,10 @@ class TestExtensions(object): x509.load_pem_x509_certificate, backend ) - with pytest.raises(x509.UnsupportedExtension) as exc: - cert.extensions - - assert exc.value.oid == x509.ObjectIdentifier("1.2.3.4") + ext = cert.extensions.get_extension_for_oid( + x509.ObjectIdentifier("1.2.3.4") + ) + assert ext.value.value == b"value" @pytest.mark.requires_backend_interface(interface=EllipticCurveBackend) def test_unsupported_extension(self, backend): |