From: Tobias Brunner Date: Fri, 22 Nov 2019 14:04:01 +0000 (+0100) Subject: x509: Add getter for nonce in OCSP request/response implementations X-Git-Tag: 5.8.2rc1~9^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5333db58ac4cade55bb0a4c58a541e47c737a811;p=thirdparty%2Fstrongswan.git x509: Add getter for nonce in OCSP request/response implementations --- diff --git a/src/libstrongswan/plugins/x509/x509_ocsp_request.c b/src/libstrongswan/plugins/x509/x509_ocsp_request.c index 50e3c6160b..58270d3b47 100644 --- a/src/libstrongswan/plugins/x509/x509_ocsp_request.c +++ b/src/libstrongswan/plugins/x509/x509_ocsp_request.c @@ -1,4 +1,5 @@ /* + * Copyright (C) 2017-2019 Tobias Brunner * Copyright (C) 2008-2009 Martin Willi * Copyright (C) 2007-2014 Andreas Steffen * HSR Hochschule fuer Technik Rapperswil @@ -464,6 +465,12 @@ METHOD(certificate_t, destroy, void, } } +METHOD(ocsp_request_t, get_nonce, chunk_t, + private_x509_ocsp_request_t *this) +{ + return this->nonce; +} + /** * create an empty but initialized OCSP request */ @@ -488,6 +495,7 @@ static private_x509_ocsp_request_t *create_empty() .get_ref = _get_ref, .destroy = _destroy, }, + .get_nonce = _get_nonce, }, }, .candidates = linked_list_create(), diff --git a/src/libstrongswan/plugins/x509/x509_ocsp_response.c b/src/libstrongswan/plugins/x509/x509_ocsp_response.c index aa4999cbdb..75eb9d7794 100644 --- a/src/libstrongswan/plugins/x509/x509_ocsp_response.c +++ b/src/libstrongswan/plugins/x509/x509_ocsp_response.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2017 Tobias Brunner + * Copyright (C) 2017-2019 Tobias Brunner * Copyright (C) 2008-2009 Martin Willi * Copyright (C) 2007-2015 Andreas Steffen * HSR Hochschule fuer Technik Rapperswil @@ -271,6 +271,12 @@ METHOD(ocsp_response_t, create_response_enumerator, enumerator_t*, filter, NULL, NULL); } +METHOD(ocsp_response_t, get_nonce, chunk_t, + private_x509_ocsp_response_t *this) +{ + return this->nonce; +} + /** * ASN.1 definition of singleResponse */ @@ -871,6 +877,7 @@ static x509_ocsp_response_t *load(chunk_t blob) .get_ref = _get_ref, .destroy = _destroy, }, + .get_nonce = _get_nonce, .get_status = _get_status, .create_cert_enumerator = _create_cert_enumerator, .create_response_enumerator = _create_response_enumerator,