x509: Add getter for nonce in OCSP request/response implementations
authorTobias Brunner <tobias@strongswan.org>
Fri, 22 Nov 2019 14:04:01 +0000 (15:04 +0100)
committerTobias Brunner <tobias@strongswan.org>
Fri, 6 Dec 2019 08:50:55 +0000 (09:50 +0100)
src/libstrongswan/plugins/x509/x509_ocsp_request.c
src/libstrongswan/plugins/x509/x509_ocsp_response.c

index 50e3c61..58270d3 100644 (file)
@@ -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(),
index aa4999c..75eb9d7 100644 (file)
@@ -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,