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.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/lib/libcrypto/ocsp/ocsp_cl.c b/src/lib/libcrypto/ocsp/ocsp_cl.c
index 7747020221..89113f78b8 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.22 2022/12/26 07:18:52 jmc Exp $ */ 1/* $OpenBSD: ocsp_cl.c,v 1.23 2023/07/08 10:44:00 beck 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
@@ -99,6 +99,7 @@ OCSP_request_add0_id(OCSP_REQUEST *req, OCSP_CERTID *cid)
99 OCSP_ONEREQ_free(one); 99 OCSP_ONEREQ_free(one);
100 return NULL; 100 return NULL;
101} 101}
102LCRYPTO_ALIAS(OCSP_request_add0_id);
102 103
103/* Set requestorName from an X509_NAME structure */ 104/* Set requestorName from an X509_NAME structure */
104int 105int
@@ -119,6 +120,7 @@ OCSP_request_set1_name(OCSP_REQUEST *req, X509_NAME *nm)
119 req->tbsRequest->requestorName = gen; 120 req->tbsRequest->requestorName = gen;
120 return 1; 121 return 1;
121} 122}
123LCRYPTO_ALIAS(OCSP_request_set1_name);
122 124
123/* Add a certificate to an OCSP request */ 125/* Add a certificate to an OCSP request */
124int 126int
@@ -141,6 +143,7 @@ OCSP_request_add1_cert(OCSP_REQUEST *req, X509 *cert)
141 X509_up_ref(cert); 143 X509_up_ref(cert);
142 return 1; 144 return 1;
143} 145}
146LCRYPTO_ALIAS(OCSP_request_add1_cert);
144 147
145/* Sign an OCSP request set the requestorName to the subject 148/* Sign an OCSP request set the requestorName to the subject
146 * name of an optional signers certificate and include one 149 * name of an optional signers certificate and include one
@@ -186,6 +189,7 @@ err:
186 req->optionalSignature = NULL; 189 req->optionalSignature = NULL;
187 return 0; 190 return 0;
188} 191}
192LCRYPTO_ALIAS(OCSP_request_sign);
189 193
190/* Get response status */ 194/* Get response status */
191int 195int
@@ -193,6 +197,7 @@ OCSP_response_status(OCSP_RESPONSE *resp)
193{ 197{
194 return ASN1_ENUMERATED_get(resp->responseStatus); 198 return ASN1_ENUMERATED_get(resp->responseStatus);
195} 199}
200LCRYPTO_ALIAS(OCSP_response_status);
196 201
197/* Extract basic response from OCSP_RESPONSE or NULL if 202/* Extract basic response from OCSP_RESPONSE or NULL if
198 * no basic response present. 203 * no basic response present.
@@ -214,6 +219,7 @@ OCSP_response_get1_basic(OCSP_RESPONSE *resp)
214 219
215 return ASN1_item_unpack(rb->response, &OCSP_BASICRESP_it); 220 return ASN1_item_unpack(rb->response, &OCSP_BASICRESP_it);
216} 221}
222LCRYPTO_ALIAS(OCSP_response_get1_basic);
217 223
218/* Return number of OCSP_SINGLERESP responses present in 224/* Return number of OCSP_SINGLERESP responses present in
219 * a basic response. 225 * a basic response.
@@ -225,6 +231,7 @@ OCSP_resp_count(OCSP_BASICRESP *bs)
225 return -1; 231 return -1;
226 return sk_OCSP_SINGLERESP_num(bs->tbsResponseData->responses); 232 return sk_OCSP_SINGLERESP_num(bs->tbsResponseData->responses);
227} 233}
234LCRYPTO_ALIAS(OCSP_resp_count);
228 235
229/* Extract an OCSP_SINGLERESP response with a given index */ 236/* Extract an OCSP_SINGLERESP response with a given index */
230OCSP_SINGLERESP * 237OCSP_SINGLERESP *
@@ -234,18 +241,21 @@ OCSP_resp_get0(OCSP_BASICRESP *bs, int idx)
234 return NULL; 241 return NULL;
235 return sk_OCSP_SINGLERESP_value(bs->tbsResponseData->responses, idx); 242 return sk_OCSP_SINGLERESP_value(bs->tbsResponseData->responses, idx);
236} 243}
244LCRYPTO_ALIAS(OCSP_resp_get0);
237 245
238const ASN1_GENERALIZEDTIME * 246const ASN1_GENERALIZEDTIME *
239OCSP_resp_get0_produced_at(const OCSP_BASICRESP *bs) 247OCSP_resp_get0_produced_at(const OCSP_BASICRESP *bs)
240{ 248{
241 return bs->tbsResponseData->producedAt; 249 return bs->tbsResponseData->producedAt;
242} 250}
251LCRYPTO_ALIAS(OCSP_resp_get0_produced_at);
243 252
244const STACK_OF(X509) * 253const STACK_OF(X509) *
245OCSP_resp_get0_certs(const OCSP_BASICRESP *bs) 254OCSP_resp_get0_certs(const OCSP_BASICRESP *bs)
246{ 255{
247 return bs->certs; 256 return bs->certs;
248} 257}
258LCRYPTO_ALIAS(OCSP_resp_get0_certs);
249 259
250int 260int
251OCSP_resp_get0_id(const OCSP_BASICRESP *bs, const ASN1_OCTET_STRING **pid, 261OCSP_resp_get0_id(const OCSP_BASICRESP *bs, const ASN1_OCTET_STRING **pid,
@@ -265,24 +275,28 @@ OCSP_resp_get0_id(const OCSP_BASICRESP *bs, const ASN1_OCTET_STRING **pid,
265 275
266 return 1; 276 return 1;
267} 277}
278LCRYPTO_ALIAS(OCSP_resp_get0_id);
268 279
269const ASN1_OCTET_STRING * 280const ASN1_OCTET_STRING *
270OCSP_resp_get0_signature(const OCSP_BASICRESP *bs) 281OCSP_resp_get0_signature(const OCSP_BASICRESP *bs)
271{ 282{
272 return bs->signature; 283 return bs->signature;
273} 284}
285LCRYPTO_ALIAS(OCSP_resp_get0_signature);
274 286
275const X509_ALGOR * 287const X509_ALGOR *
276OCSP_resp_get0_tbs_sigalg(const OCSP_BASICRESP *bs) 288OCSP_resp_get0_tbs_sigalg(const OCSP_BASICRESP *bs)
277{ 289{
278 return bs->signatureAlgorithm; 290 return bs->signatureAlgorithm;
279} 291}
292LCRYPTO_ALIAS(OCSP_resp_get0_tbs_sigalg);
280 293
281const OCSP_RESPDATA * 294const OCSP_RESPDATA *
282OCSP_resp_get0_respdata(const OCSP_BASICRESP *bs) 295OCSP_resp_get0_respdata(const OCSP_BASICRESP *bs)
283{ 296{
284 return bs->tbsResponseData; 297 return bs->tbsResponseData;
285} 298}
299LCRYPTO_ALIAS(OCSP_resp_get0_respdata);
286 300
287/* Look single response matching a given certificate ID */ 301/* Look single response matching a given certificate ID */
288int 302int
@@ -306,6 +320,7 @@ OCSP_resp_find(OCSP_BASICRESP *bs, OCSP_CERTID *id, int last)
306 } 320 }
307 return -1; 321 return -1;
308} 322}
323LCRYPTO_ALIAS(OCSP_resp_find);
309 324
310/* Extract status information from an OCSP_SINGLERESP structure. 325/* Extract status information from an OCSP_SINGLERESP structure.
311 * Note: the revtime and reason values are only set if the 326 * Note: the revtime and reason values are only set if the
@@ -343,6 +358,7 @@ OCSP_single_get0_status(OCSP_SINGLERESP *single, int *reason,
343 *nextupd = single->nextUpdate; 358 *nextupd = single->nextUpdate;
344 return ret; 359 return ret;
345} 360}
361LCRYPTO_ALIAS(OCSP_single_get0_status);
346 362
347/* This function combines the previous ones: look up a certificate ID and 363/* This function combines the previous ones: look up a certificate ID and
348 * if found extract status information. Return 0 is successful. 364 * if found extract status information. Return 0 is successful.
@@ -365,6 +381,7 @@ OCSP_resp_find_status(OCSP_BASICRESP *bs, OCSP_CERTID *id, int *status,
365 *status = i; 381 *status = i;
366 return 1; 382 return 1;
367} 383}
384LCRYPTO_ALIAS(OCSP_resp_find_status);
368 385
369/* Check validity of thisUpdate and nextUpdate fields. It is possible that the request will 386/* Check validity of thisUpdate and nextUpdate fields. It is possible that the request will
370 * take a few seconds to process and/or the time wont be totally accurate. Therefore to avoid 387 * take a few seconds to process and/or the time wont be totally accurate. Therefore to avoid
@@ -442,9 +459,11 @@ OCSP_check_validity(ASN1_GENERALIZEDTIME *thisupd,
442 459
443 return 1; 460 return 1;
444} 461}
462LCRYPTO_ALIAS(OCSP_check_validity);
445 463
446const OCSP_CERTID * 464const OCSP_CERTID *
447OCSP_SINGLERESP_get0_id(const OCSP_SINGLERESP *single) 465OCSP_SINGLERESP_get0_id(const OCSP_SINGLERESP *single)
448{ 466{
449 return single->certId; 467 return single->certId;
450} 468}
469LCRYPTO_ALIAS(OCSP_SINGLERESP_get0_id);