aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2019-11-11 13:40:11 +0800
committerAlex Gaynor <alex.gaynor@gmail.com>2019-11-11 00:40:11 -0500
commit2e86983a77d02a38ef0485ebe7ab05c1c98a7685 (patch)
treed871fb70f5313bbd3919fe2f594890dd183521f2 /tests
parentc7ba7be8fe67c099339fcbcd90012fc257308628 (diff)
downloadcryptography-2e86983a77d02a38ef0485ebe7ab05c1c98a7685.tar.gz
cryptography-2e86983a77d02a38ef0485ebe7ab05c1c98a7685.tar.bz2
cryptography-2e86983a77d02a38ef0485ebe7ab05c1c98a7685.zip
Parse single_extensions in OCSP responses (#5059)
* add single_extensions to OCSPResponse (#4753) * new vector, updateed docs, more stringent parser, changelog, etc * simplify PR (no SCT for now) * add a comment * finish pulling out the sct stuff so tests might actually run
Diffstat (limited to 'tests')
-rw-r--r--tests/x509/test_ocsp.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/x509/test_ocsp.py b/tests/x509/test_ocsp.py
index 3e2923e1..2b6ec569 100644
--- a/tests/x509/test_ocsp.py
+++ b/tests/x509/test_ocsp.py
@@ -756,6 +756,16 @@ class TestOCSPResponse(object):
with pytest.raises(ValueError):
resp.public_bytes(serialization.Encoding.PEM)
+ def test_single_extensions(self, backend):
+ resp = _load_data(
+ os.path.join("x509", "ocsp", "resp-single-extension-reason.der"),
+ ocsp.load_der_ocsp_response,
+ )
+ assert len(resp.single_extensions) == 1
+ ext = resp.single_extensions[0]
+ assert ext.oid == x509.CRLReason.oid
+ assert ext.value == x509.CRLReason(x509.ReasonFlags.unspecified)
+
class TestOCSPEdDSA(object):
@pytest.mark.supported(