summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/ocsp/ocsp_cl.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/ocsp/ocsp_cl.c')
-rw-r--r--src/lib/libcrypto/ocsp/ocsp_cl.c51
1 files changed, 50 insertions, 1 deletions
diff --git a/src/lib/libcrypto/ocsp/ocsp_cl.c b/src/lib/libcrypto/ocsp/ocsp_cl.c
index cb5a2f3d18..677a1b35dd 100644
--- a/src/lib/libcrypto/ocsp/ocsp_cl.c
+++ b/src/lib/libcrypto/ocsp/ocsp_cl.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ocsp_cl.c,v 1.17 2020/10/09 17:19:35 tb Exp $ */ 1/* $OpenBSD: ocsp_cl.c,v 1.18 2021/10/24 13:50:14 tb Exp $ */
2/* Written by Tom Titchener <Tom_Titchener@groove.net> for the OpenSSL 2/* Written by Tom Titchener <Tom_Titchener@groove.net> for the OpenSSL
3 * project. */ 3 * project. */
4 4
@@ -233,6 +233,55 @@ OCSP_resp_get0(OCSP_BASICRESP *bs, int idx)
233 return sk_OCSP_SINGLERESP_value(bs->tbsResponseData->responses, idx); 233 return sk_OCSP_SINGLERESP_value(bs->tbsResponseData->responses, idx);
234} 234}
235 235
236const ASN1_GENERALIZEDTIME *
237OCSP_resp_get0_produced_at(const OCSP_BASICRESP *bs)
238{
239 return bs->tbsResponseData->producedAt;
240}
241
242const STACK_OF(X509) *
243OCSP_resp_get0_certs(const OCSP_BASICRESP *bs)
244{
245 return bs->certs;
246}
247
248int
249OCSP_resp_get0_id(const OCSP_BASICRESP *bs, const ASN1_OCTET_STRING **pid,
250 const X509_NAME **pname)
251{
252 const OCSP_RESPID *rid = bs->tbsResponseData->responderId;
253
254 if (rid->type == V_OCSP_RESPID_NAME) {
255 *pname = rid->value.byName;
256 *pid = NULL;
257 } else if (rid->type == V_OCSP_RESPID_KEY) {
258 *pid = rid->value.byKey;
259 *pname = NULL;
260 } else {
261 return 0;
262 }
263
264 return 1;
265}
266
267const ASN1_OCTET_STRING *
268OCSP_resp_get0_signature(const OCSP_BASICRESP *bs)
269{
270 return bs->signature;
271}
272
273const X509_ALGOR *
274OCSP_resp_get0_tbs_sigalg(const OCSP_BASICRESP *bs)
275{
276 return bs->signatureAlgorithm;
277}
278
279const OCSP_RESPDATA *
280OCSP_resp_get0_respdata(const OCSP_BASICRESP *bs)
281{
282 return bs->tbsResponseData;
283}
284
236/* Look single response matching a given certificate ID */ 285/* Look single response matching a given certificate ID */
237int 286int
238OCSP_resp_find(OCSP_BASICRESP *bs, OCSP_CERTID *id, int last) 287OCSP_resp_find(OCSP_BASICRESP *bs, OCSP_CERTID *id, int last)