diff options
Diffstat (limited to 'src/lib/libcrypto/ocsp/ocsp_cl.c')
-rw-r--r-- | src/lib/libcrypto/ocsp/ocsp_cl.c | 51 |
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 | ||
236 | const ASN1_GENERALIZEDTIME * | ||
237 | OCSP_resp_get0_produced_at(const OCSP_BASICRESP *bs) | ||
238 | { | ||
239 | return bs->tbsResponseData->producedAt; | ||
240 | } | ||
241 | |||
242 | const STACK_OF(X509) * | ||
243 | OCSP_resp_get0_certs(const OCSP_BASICRESP *bs) | ||
244 | { | ||
245 | return bs->certs; | ||
246 | } | ||
247 | |||
248 | int | ||
249 | OCSP_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 | |||
267 | const ASN1_OCTET_STRING * | ||
268 | OCSP_resp_get0_signature(const OCSP_BASICRESP *bs) | ||
269 | { | ||
270 | return bs->signature; | ||
271 | } | ||
272 | |||
273 | const X509_ALGOR * | ||
274 | OCSP_resp_get0_tbs_sigalg(const OCSP_BASICRESP *bs) | ||
275 | { | ||
276 | return bs->signatureAlgorithm; | ||
277 | } | ||
278 | |||
279 | const OCSP_RESPDATA * | ||
280 | OCSP_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 */ |
237 | int | 286 | int |
238 | OCSP_resp_find(OCSP_BASICRESP *bs, OCSP_CERTID *id, int last) | 287 | OCSP_resp_find(OCSP_BASICRESP *bs, OCSP_CERTID *id, int last) |