From: Tobias Brunner Date: Thu, 23 Nov 2023 16:50:02 +0000 (+0100) Subject: x509: Add getter for status of OCSP responses X-Git-Tag: 5.9.13rc1~1^2~6 X-Git-Url: http://git.ipfire.org/?p=thirdparty%2Fstrongswan.git;a=commitdiff_plain;h=b3e66aca5c4af3721489ff7d934d90bc5108e12b x509: Add getter for status of OCSP responses --- diff --git a/src/libstrongswan/credentials/certificates/ocsp_response.h b/src/libstrongswan/credentials/certificates/ocsp_response.h index 6f97a3e7a9..66dd74ad60 100644 --- a/src/libstrongswan/credentials/certificates/ocsp_response.h +++ b/src/libstrongswan/credentials/certificates/ocsp_response.h @@ -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. * diff --git a/src/libstrongswan/plugins/x509/x509_ocsp_response.c b/src/libstrongswan/plugins/x509/x509_ocsp_response.c index a47bcc367c..245b3fac3c 100644 --- a/src/libstrongswan/plugins/x509/x509_ocsp_response.c +++ b/src/libstrongswan/plugins/x509/x509_ocsp_response.c @@ -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,