]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
x509: Add getter for status of OCSP responses
authorTobias Brunner <tobias@strongswan.org>
Thu, 23 Nov 2023 16:50:02 +0000 (17:50 +0100)
committerTobias Brunner <tobias@strongswan.org>
Fri, 24 Nov 2023 16:41:18 +0000 (17:41 +0100)
src/libstrongswan/credentials/certificates/ocsp_response.h
src/libstrongswan/plugins/x509/x509_ocsp_response.c

index 6f97a3e7a9937d7f4670f79ef1fe478e5796cad3..66dd74ad60b2d407339f01f98c5ff45a9401ba89 100644 (file)
@@ -56,6 +56,13 @@ struct ocsp_response_t {
         */
        certificate_t certificate;
 
+       /**
+        * Get general status of this OCSP response.
+        *
+        * @return                                      OCSP status
+        */
+       ocsp_status_t (*get_ocsp_status)(ocsp_response_t *this);
+
        /**
         * Get the nonce received with this OCSP response.
         *
index a47bcc367cd3ff174bd7fde96eb017723a2380eb..245b3fac3c9a0dab400365548627f0dac8f905f1 100644 (file)
@@ -263,6 +263,12 @@ METHOD(ocsp_response_t, create_response_enumerator, enumerator_t*,
                                filter, NULL, NULL);
 }
 
+METHOD(ocsp_response_t, get_ocsp_status, ocsp_status_t,
+       private_x509_ocsp_response_t *this)
+{
+       return this->ocsp_status;
+}
+
 METHOD(ocsp_response_t, get_nonce, chunk_t,
        private_x509_ocsp_response_t *this)
 {
@@ -1049,6 +1055,7 @@ static private_x509_ocsp_response_t *create_empty()
                                        .get_ref = _get_ref,
                                        .destroy = _destroy,
                                },
+                               .get_ocsp_status = _get_ocsp_status,
                                .get_nonce = _get_nonce,
                                .get_status = _get_status,
                                .create_cert_enumerator = _create_cert_enumerator,