From 2e86983a77d02a38ef0485ebe7ab05c1c98a7685 Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Mon, 11 Nov 2019 13:40:11 +0800 Subject: 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 --- tests/x509/test_ocsp.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests') 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( -- cgit v1.2.3