summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/ocsp/ocsp.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/lib/libcrypto/ocsp/ocsp.h484
1 files changed, 0 insertions, 484 deletions
diff --git a/src/lib/libcrypto/ocsp/ocsp.h b/src/lib/libcrypto/ocsp/ocsp.h
deleted file mode 100644
index 691ee4a3dc..0000000000
--- a/src/lib/libcrypto/ocsp/ocsp.h
+++ /dev/null
@@ -1,484 +0,0 @@
1/* $OpenBSD: ocsp.h,v 1.20 2022/07/12 14:42:49 kn Exp $ */
2/* Written by Tom Titchener <Tom_Titchener@groove.net> for the OpenSSL
3 * project. */
4
5/* History:
6 This file was transfered to Richard Levitte from CertCo by Kathy
7 Weinhold in mid-spring 2000 to be included in OpenSSL or released
8 as a patch kit. */
9
10/* ====================================================================
11 * Copyright (c) 1998-2000 The OpenSSL Project. All rights reserved.
12 *
13 * Redistribution and use in source and binary forms, with or without
14 * modification, are permitted provided that the following conditions
15 * are met:
16 *
17 * 1. Redistributions of source code must retain the above copyright
18 * notice, this list of conditions and the following disclaimer.
19 *
20 * 2. Redistributions in binary form must reproduce the above copyright
21 * notice, this list of conditions and the following disclaimer in
22 * the documentation and/or other materials provided with the
23 * distribution.
24 *
25 * 3. All advertising materials mentioning features or use of this
26 * software must display the following acknowledgment:
27 * "This product includes software developed by the OpenSSL Project
28 * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
29 *
30 * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
31 * endorse or promote products derived from this software without
32 * prior written permission. For written permission, please contact
33 * openssl-core@openssl.org.
34 *
35 * 5. Products derived from this software may not be called "OpenSSL"
36 * nor may "OpenSSL" appear in their names without prior written
37 * permission of the OpenSSL Project.
38 *
39 * 6. Redistributions of any form whatsoever must retain the following
40 * acknowledgment:
41 * "This product includes software developed by the OpenSSL Project
42 * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
43 *
44 * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
45 * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
46 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
47 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
48 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
49 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
50 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
51 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
52 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
53 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
54 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
55 * OF THE POSSIBILITY OF SUCH DAMAGE.
56 * ====================================================================
57 *
58 * This product includes cryptographic software written by Eric Young
59 * (eay@cryptsoft.com). This product includes software written by Tim
60 * Hudson (tjh@cryptsoft.com).
61 *
62 */
63
64#ifndef HEADER_OCSP_H
65#define HEADER_OCSP_H
66
67#include <openssl/ossl_typ.h>
68#include <openssl/x509.h>
69#include <openssl/x509v3.h>
70#include <openssl/safestack.h>
71
72#ifdef __cplusplus
73extern "C" {
74#endif
75
76/*
77 * CRLReason ::= ENUMERATED {
78 * unspecified (0),
79 * keyCompromise (1),
80 * cACompromise (2),
81 * affiliationChanged (3),
82 * superseded (4),
83 * cessationOfOperation (5),
84 * certificateHold (6),
85 * removeFromCRL (8) }
86 */
87#define OCSP_REVOKED_STATUS_NOSTATUS -1
88#define OCSP_REVOKED_STATUS_UNSPECIFIED 0
89#define OCSP_REVOKED_STATUS_KEYCOMPROMISE 1
90#define OCSP_REVOKED_STATUS_CACOMPROMISE 2
91#define OCSP_REVOKED_STATUS_AFFILIATIONCHANGED 3
92#define OCSP_REVOKED_STATUS_SUPERSEDED 4
93#define OCSP_REVOKED_STATUS_CESSATIONOFOPERATION 5
94#define OCSP_REVOKED_STATUS_CERTIFICATEHOLD 6
95#define OCSP_REVOKED_STATUS_REMOVEFROMCRL 8
96
97
98/* Various flags and values */
99
100#define OCSP_DEFAULT_NONCE_LENGTH 16
101
102#define OCSP_NOCERTS 0x1
103#define OCSP_NOINTERN 0x2
104#define OCSP_NOSIGS 0x4
105#define OCSP_NOCHAIN 0x8
106#define OCSP_NOVERIFY 0x10
107#define OCSP_NOEXPLICIT 0x20
108#define OCSP_NOCASIGN 0x40
109#define OCSP_NODELEGATED 0x80
110#define OCSP_NOCHECKS 0x100
111#define OCSP_TRUSTOTHER 0x200
112#define OCSP_RESPID_KEY 0x400
113#define OCSP_NOTIME 0x800
114
115typedef struct ocsp_cert_id_st OCSP_CERTID;
116
117DECLARE_STACK_OF(OCSP_CERTID)
118
119typedef struct ocsp_one_request_st OCSP_ONEREQ;
120
121DECLARE_STACK_OF(OCSP_ONEREQ)
122
123typedef struct ocsp_req_info_st OCSP_REQINFO;
124typedef struct ocsp_signature_st OCSP_SIGNATURE;
125typedef struct ocsp_request_st OCSP_REQUEST;
126
127#define OCSP_RESPONSE_STATUS_SUCCESSFUL 0
128#define OCSP_RESPONSE_STATUS_MALFORMEDREQUEST 1
129#define OCSP_RESPONSE_STATUS_INTERNALERROR 2
130#define OCSP_RESPONSE_STATUS_TRYLATER 3
131#define OCSP_RESPONSE_STATUS_SIGREQUIRED 5
132#define OCSP_RESPONSE_STATUS_UNAUTHORIZED 6
133
134typedef struct ocsp_resp_bytes_st OCSP_RESPBYTES;
135
136#define V_OCSP_RESPID_NAME 0
137#define V_OCSP_RESPID_KEY 1
138
139DECLARE_STACK_OF(OCSP_RESPID)
140
141OCSP_RESPID *OCSP_RESPID_new(void);
142void OCSP_RESPID_free(OCSP_RESPID *a);
143OCSP_RESPID *d2i_OCSP_RESPID(OCSP_RESPID **a, const unsigned char **in, long len);
144int i2d_OCSP_RESPID(OCSP_RESPID *a, unsigned char **out);
145extern const ASN1_ITEM OCSP_RESPID_it;
146
147typedef struct ocsp_revoked_info_st OCSP_REVOKEDINFO;
148
149#define V_OCSP_CERTSTATUS_GOOD 0
150#define V_OCSP_CERTSTATUS_REVOKED 1
151#define V_OCSP_CERTSTATUS_UNKNOWN 2
152
153typedef struct ocsp_cert_status_st OCSP_CERTSTATUS;
154typedef struct ocsp_single_response_st OCSP_SINGLERESP;
155
156DECLARE_STACK_OF(OCSP_SINGLERESP)
157
158typedef struct ocsp_response_data_st OCSP_RESPDATA;
159
160typedef struct ocsp_basic_response_st OCSP_BASICRESP;
161
162typedef struct ocsp_crl_id_st OCSP_CRLID;
163typedef struct ocsp_service_locator_st OCSP_SERVICELOC;
164
165#define PEM_STRING_OCSP_REQUEST "OCSP REQUEST"
166#define PEM_STRING_OCSP_RESPONSE "OCSP RESPONSE"
167
168#define PEM_read_bio_OCSP_REQUEST(bp,x,cb) \
169 (OCSP_REQUEST *)PEM_ASN1_read_bio((char *(*)())d2i_OCSP_REQUEST, \
170 PEM_STRING_OCSP_REQUEST,bp,(char **)x,cb,NULL)
171
172#define PEM_read_bio_OCSP_RESPONSE(bp,x,cb) \
173 (OCSP_RESPONSE *)PEM_ASN1_read_bio((char *(*)())d2i_OCSP_RESPONSE, \
174 PEM_STRING_OCSP_RESPONSE,bp,(char **)x,cb,NULL)
175
176#define PEM_write_bio_OCSP_REQUEST(bp,o) \
177 PEM_ASN1_write_bio((int (*)())i2d_OCSP_REQUEST,PEM_STRING_OCSP_REQUEST,\
178 bp,(char *)o, NULL,NULL,0,NULL,NULL)
179
180#define PEM_write_bio_OCSP_RESPONSE(bp,o) \
181 PEM_ASN1_write_bio((int (*)())i2d_OCSP_RESPONSE,PEM_STRING_OCSP_RESPONSE,\
182 bp,(char *)o, NULL,NULL,0,NULL,NULL)
183
184#define ASN1_BIT_STRING_digest(data,type,md,len) \
185 ASN1_item_digest(&ASN1_BIT_STRING_it,type,data,md,len)
186
187#define OCSP_CERTSTATUS_dup(cs) \
188 ASN1_item_dup(&OCSP_CERTSTATUS_it, cs)
189
190OCSP_CERTID *OCSP_CERTID_dup(OCSP_CERTID *id);
191
192OCSP_RESPONSE *OCSP_sendreq_bio(BIO *b, const char *path, OCSP_REQUEST *req);
193OCSP_REQ_CTX *OCSP_sendreq_new(BIO *io, const char *path, OCSP_REQUEST *req,
194 int maxline);
195int OCSP_sendreq_nbio(OCSP_RESPONSE **presp, OCSP_REQ_CTX *rctx);
196void OCSP_REQ_CTX_free(OCSP_REQ_CTX *rctx);
197int OCSP_REQ_CTX_set1_req(OCSP_REQ_CTX *rctx, OCSP_REQUEST *req);
198int OCSP_REQ_CTX_add1_header(OCSP_REQ_CTX *rctx, const char *name,
199 const char *value);
200
201OCSP_CERTID *OCSP_cert_to_id(const EVP_MD *dgst, const X509 *subject,
202 const X509 *issuer);
203
204OCSP_CERTID *OCSP_cert_id_new(const EVP_MD *dgst, const X509_NAME *issuerName,
205 const ASN1_BIT_STRING *issuerKey, const ASN1_INTEGER *serialNumber);
206
207OCSP_ONEREQ *OCSP_request_add0_id(OCSP_REQUEST *req, OCSP_CERTID *cid);
208
209int OCSP_request_add1_nonce(OCSP_REQUEST *req, unsigned char *val, int len);
210int OCSP_basic_add1_nonce(OCSP_BASICRESP *resp, unsigned char *val, int len);
211int OCSP_check_nonce(OCSP_REQUEST *req, OCSP_BASICRESP *bs);
212int OCSP_copy_nonce(OCSP_BASICRESP *resp, OCSP_REQUEST *req);
213
214int OCSP_request_set1_name(OCSP_REQUEST *req, X509_NAME *nm);
215int OCSP_request_add1_cert(OCSP_REQUEST *req, X509 *cert);
216
217int OCSP_request_sign(OCSP_REQUEST *req, X509 *signer, EVP_PKEY *key,
218 const EVP_MD *dgst, STACK_OF(X509) *certs, unsigned long flags);
219
220int OCSP_response_status(OCSP_RESPONSE *resp);
221OCSP_BASICRESP *OCSP_response_get1_basic(OCSP_RESPONSE *resp);
222
223const ASN1_OCTET_STRING *OCSP_resp_get0_signature(const OCSP_BASICRESP *bs);
224const X509_ALGOR *OCSP_resp_get0_tbs_sigalg(const OCSP_BASICRESP *bs);
225const OCSP_RESPDATA *OCSP_resp_get0_respdata(const OCSP_BASICRESP *bs);
226int OCSP_resp_get0_signer(OCSP_BASICRESP *bs, X509 **signer,
227 STACK_OF(X509) *extra_certs);
228
229int OCSP_resp_count(OCSP_BASICRESP *bs);
230OCSP_SINGLERESP *OCSP_resp_get0(OCSP_BASICRESP *bs, int idx);
231const ASN1_GENERALIZEDTIME *OCSP_resp_get0_produced_at(const OCSP_BASICRESP *bs);
232const STACK_OF(X509) *OCSP_resp_get0_certs(const OCSP_BASICRESP *bs);
233int OCSP_resp_get0_id(const OCSP_BASICRESP *bs,
234 const ASN1_OCTET_STRING **pid, const X509_NAME **pname);
235
236int OCSP_resp_find(OCSP_BASICRESP *bs, OCSP_CERTID *id, int last);
237int OCSP_single_get0_status(OCSP_SINGLERESP *single, int *reason,
238 ASN1_GENERALIZEDTIME **revtime, ASN1_GENERALIZEDTIME **thisupd,
239 ASN1_GENERALIZEDTIME **nextupd);
240int OCSP_resp_find_status(OCSP_BASICRESP *bs, OCSP_CERTID *id, int *status,
241 int *reason, ASN1_GENERALIZEDTIME **revtime,
242 ASN1_GENERALIZEDTIME **thisupd, ASN1_GENERALIZEDTIME **nextupd);
243int OCSP_check_validity(ASN1_GENERALIZEDTIME *thisupd,
244 ASN1_GENERALIZEDTIME *nextupd, long sec, long maxsec);
245
246int OCSP_request_verify(OCSP_REQUEST *req, STACK_OF(X509) *certs,
247 X509_STORE *store, unsigned long flags);
248
249int OCSP_parse_url(const char *url, char **phost, char **pport,
250 char **ppath, int *pssl);
251
252int OCSP_id_issuer_cmp(OCSP_CERTID *a, OCSP_CERTID *b);
253int OCSP_id_cmp(OCSP_CERTID *a, OCSP_CERTID *b);
254
255int OCSP_request_onereq_count(OCSP_REQUEST *req);
256OCSP_ONEREQ *OCSP_request_onereq_get0(OCSP_REQUEST *req, int i);
257OCSP_CERTID *OCSP_onereq_get0_id(OCSP_ONEREQ *one);
258int OCSP_id_get0_info(ASN1_OCTET_STRING **piNameHash, ASN1_OBJECT **pmd,
259 ASN1_OCTET_STRING **pikeyHash, ASN1_INTEGER **pserial,
260 OCSP_CERTID *cid);
261int OCSP_request_is_signed(OCSP_REQUEST *req);
262OCSP_RESPONSE *OCSP_response_create(int status, OCSP_BASICRESP *bs);
263OCSP_SINGLERESP *OCSP_basic_add1_status(OCSP_BASICRESP *rsp, OCSP_CERTID *cid,
264 int status, int reason, ASN1_TIME *revtime, ASN1_TIME *thisupd,
265 ASN1_TIME *nextupd);
266int OCSP_basic_add1_cert(OCSP_BASICRESP *resp, X509 *cert);
267int OCSP_basic_sign(OCSP_BASICRESP *brsp, X509 *signer, EVP_PKEY *key,
268 const EVP_MD *dgst, STACK_OF(X509) *certs, unsigned long flags);
269
270X509_EXTENSION *OCSP_crlID_new(const char *url, long *n, char *tim);
271
272X509_EXTENSION *OCSP_accept_responses_new(char **oids);
273
274X509_EXTENSION *OCSP_archive_cutoff_new(char* tim);
275
276X509_EXTENSION *OCSP_url_svcloc_new(X509_NAME* issuer, const char **urls);
277
278int OCSP_REQUEST_get_ext_count(OCSP_REQUEST *x);
279int OCSP_REQUEST_get_ext_by_NID(OCSP_REQUEST *x, int nid, int lastpos);
280int OCSP_REQUEST_get_ext_by_OBJ(OCSP_REQUEST *x, const ASN1_OBJECT *obj,
281 int lastpos);
282int OCSP_REQUEST_get_ext_by_critical(OCSP_REQUEST *x, int crit,
283 int lastpos);
284X509_EXTENSION *OCSP_REQUEST_get_ext(OCSP_REQUEST *x, int loc);
285X509_EXTENSION *OCSP_REQUEST_delete_ext(OCSP_REQUEST *x, int loc);
286void *OCSP_REQUEST_get1_ext_d2i(OCSP_REQUEST *x, int nid, int *crit, int *idx);
287int OCSP_REQUEST_add1_ext_i2d(OCSP_REQUEST *x, int nid, void *value,
288 int crit, unsigned long flags);
289int OCSP_REQUEST_add_ext(OCSP_REQUEST *x, X509_EXTENSION *ex, int loc);
290
291int OCSP_ONEREQ_get_ext_count(OCSP_ONEREQ *x);
292int OCSP_ONEREQ_get_ext_by_NID(OCSP_ONEREQ *x, int nid, int lastpos);
293int OCSP_ONEREQ_get_ext_by_OBJ(OCSP_ONEREQ *x, const ASN1_OBJECT *obj,
294 int lastpos);
295int OCSP_ONEREQ_get_ext_by_critical(OCSP_ONEREQ *x, int crit, int lastpos);
296X509_EXTENSION *OCSP_ONEREQ_get_ext(OCSP_ONEREQ *x, int loc);
297X509_EXTENSION *OCSP_ONEREQ_delete_ext(OCSP_ONEREQ *x, int loc);
298void *OCSP_ONEREQ_get1_ext_d2i(OCSP_ONEREQ *x, int nid, int *crit, int *idx);
299int OCSP_ONEREQ_add1_ext_i2d(OCSP_ONEREQ *x, int nid, void *value, int crit,
300 unsigned long flags);
301int OCSP_ONEREQ_add_ext(OCSP_ONEREQ *x, X509_EXTENSION *ex, int loc);
302
303int OCSP_BASICRESP_get_ext_count(OCSP_BASICRESP *x);
304int OCSP_BASICRESP_get_ext_by_NID(OCSP_BASICRESP *x, int nid, int lastpos);
305int OCSP_BASICRESP_get_ext_by_OBJ(OCSP_BASICRESP *x, const ASN1_OBJECT *obj,
306 int lastpos);
307int OCSP_BASICRESP_get_ext_by_critical(OCSP_BASICRESP *x, int crit,
308 int lastpos);
309X509_EXTENSION *OCSP_BASICRESP_get_ext(OCSP_BASICRESP *x, int loc);
310X509_EXTENSION *OCSP_BASICRESP_delete_ext(OCSP_BASICRESP *x, int loc);
311void *OCSP_BASICRESP_get1_ext_d2i(OCSP_BASICRESP *x, int nid, int *crit,
312 int *idx);
313int OCSP_BASICRESP_add1_ext_i2d(OCSP_BASICRESP *x, int nid, void *value,
314 int crit, unsigned long flags);
315int OCSP_BASICRESP_add_ext(OCSP_BASICRESP *x, X509_EXTENSION *ex, int loc);
316
317int OCSP_SINGLERESP_get_ext_count(OCSP_SINGLERESP *x);
318int OCSP_SINGLERESP_get_ext_by_NID(OCSP_SINGLERESP *x, int nid,
319 int lastpos);
320int OCSP_SINGLERESP_get_ext_by_OBJ(OCSP_SINGLERESP *x,
321 const ASN1_OBJECT *obj, int lastpos);
322int OCSP_SINGLERESP_get_ext_by_critical(OCSP_SINGLERESP *x, int crit,
323 int lastpos);
324X509_EXTENSION *OCSP_SINGLERESP_get_ext(OCSP_SINGLERESP *x, int loc);
325X509_EXTENSION *OCSP_SINGLERESP_delete_ext(OCSP_SINGLERESP *x, int loc);
326void *OCSP_SINGLERESP_get1_ext_d2i(OCSP_SINGLERESP *x, int nid, int *crit,
327 int *idx);
328int OCSP_SINGLERESP_add1_ext_i2d(OCSP_SINGLERESP *x, int nid, void *value,
329 int crit, unsigned long flags);
330int OCSP_SINGLERESP_add_ext(OCSP_SINGLERESP *x, X509_EXTENSION *ex,
331 int loc);
332const OCSP_CERTID *OCSP_SINGLERESP_get0_id(const OCSP_SINGLERESP *x);
333
334OCSP_SINGLERESP *OCSP_SINGLERESP_new(void);
335void OCSP_SINGLERESP_free(OCSP_SINGLERESP *a);
336OCSP_SINGLERESP *d2i_OCSP_SINGLERESP(OCSP_SINGLERESP **a, const unsigned char **in, long len);
337int i2d_OCSP_SINGLERESP(OCSP_SINGLERESP *a, unsigned char **out);
338extern const ASN1_ITEM OCSP_SINGLERESP_it;
339OCSP_CERTSTATUS *OCSP_CERTSTATUS_new(void);
340void OCSP_CERTSTATUS_free(OCSP_CERTSTATUS *a);
341OCSP_CERTSTATUS *d2i_OCSP_CERTSTATUS(OCSP_CERTSTATUS **a, const unsigned char **in, long len);
342int i2d_OCSP_CERTSTATUS(OCSP_CERTSTATUS *a, unsigned char **out);
343extern const ASN1_ITEM OCSP_CERTSTATUS_it;
344OCSP_REVOKEDINFO *OCSP_REVOKEDINFO_new(void);
345void OCSP_REVOKEDINFO_free(OCSP_REVOKEDINFO *a);
346OCSP_REVOKEDINFO *d2i_OCSP_REVOKEDINFO(OCSP_REVOKEDINFO **a, const unsigned char **in, long len);
347int i2d_OCSP_REVOKEDINFO(OCSP_REVOKEDINFO *a, unsigned char **out);
348extern const ASN1_ITEM OCSP_REVOKEDINFO_it;
349OCSP_BASICRESP *OCSP_BASICRESP_new(void);
350void OCSP_BASICRESP_free(OCSP_BASICRESP *a);
351OCSP_BASICRESP *d2i_OCSP_BASICRESP(OCSP_BASICRESP **a, const unsigned char **in, long len);
352int i2d_OCSP_BASICRESP(OCSP_BASICRESP *a, unsigned char **out);
353extern const ASN1_ITEM OCSP_BASICRESP_it;
354OCSP_RESPDATA *OCSP_RESPDATA_new(void);
355void OCSP_RESPDATA_free(OCSP_RESPDATA *a);
356OCSP_RESPDATA *d2i_OCSP_RESPDATA(OCSP_RESPDATA **a, const unsigned char **in, long len);
357int i2d_OCSP_RESPDATA(OCSP_RESPDATA *a, unsigned char **out);
358extern const ASN1_ITEM OCSP_RESPDATA_it;
359OCSP_RESPID *OCSP_RESPID_new(void);
360void OCSP_RESPID_free(OCSP_RESPID *a);
361OCSP_RESPID *d2i_OCSP_RESPID(OCSP_RESPID **a, const unsigned char **in, long len);
362int i2d_OCSP_RESPID(OCSP_RESPID *a, unsigned char **out);
363extern const ASN1_ITEM OCSP_RESPID_it;
364OCSP_RESPONSE *OCSP_RESPONSE_new(void);
365void OCSP_RESPONSE_free(OCSP_RESPONSE *a);
366OCSP_RESPONSE *d2i_OCSP_RESPONSE(OCSP_RESPONSE **a, const unsigned char **in, long len);
367int i2d_OCSP_RESPONSE(OCSP_RESPONSE *a, unsigned char **out);
368OCSP_RESPONSE *d2i_OCSP_RESPONSE_bio(BIO *bp, OCSP_RESPONSE **a);
369int i2d_OCSP_RESPONSE_bio(BIO *bp, OCSP_RESPONSE *a);
370extern const ASN1_ITEM OCSP_RESPONSE_it;
371OCSP_RESPBYTES *OCSP_RESPBYTES_new(void);
372void OCSP_RESPBYTES_free(OCSP_RESPBYTES *a);
373OCSP_RESPBYTES *d2i_OCSP_RESPBYTES(OCSP_RESPBYTES **a, const unsigned char **in, long len);
374int i2d_OCSP_RESPBYTES(OCSP_RESPBYTES *a, unsigned char **out);
375extern const ASN1_ITEM OCSP_RESPBYTES_it;
376OCSP_ONEREQ *OCSP_ONEREQ_new(void);
377void OCSP_ONEREQ_free(OCSP_ONEREQ *a);
378OCSP_ONEREQ *d2i_OCSP_ONEREQ(OCSP_ONEREQ **a, const unsigned char **in, long len);
379int i2d_OCSP_ONEREQ(OCSP_ONEREQ *a, unsigned char **out);
380extern const ASN1_ITEM OCSP_ONEREQ_it;
381OCSP_CERTID *OCSP_CERTID_new(void);
382void OCSP_CERTID_free(OCSP_CERTID *a);
383OCSP_CERTID *d2i_OCSP_CERTID(OCSP_CERTID **a, const unsigned char **in, long len);
384int i2d_OCSP_CERTID(OCSP_CERTID *a, unsigned char **out);
385extern const ASN1_ITEM OCSP_CERTID_it;
386OCSP_REQUEST *OCSP_REQUEST_new(void);
387void OCSP_REQUEST_free(OCSP_REQUEST *a);
388OCSP_REQUEST *d2i_OCSP_REQUEST(OCSP_REQUEST **a, const unsigned char **in, long len);
389int i2d_OCSP_REQUEST(OCSP_REQUEST *a, unsigned char **out);
390OCSP_REQUEST *d2i_OCSP_REQUEST_bio(BIO *bp, OCSP_REQUEST **a);
391int i2d_OCSP_REQUEST_bio(BIO *bp, OCSP_REQUEST *a);
392extern const ASN1_ITEM OCSP_REQUEST_it;
393OCSP_SIGNATURE *OCSP_SIGNATURE_new(void);
394void OCSP_SIGNATURE_free(OCSP_SIGNATURE *a);
395OCSP_SIGNATURE *d2i_OCSP_SIGNATURE(OCSP_SIGNATURE **a, const unsigned char **in, long len);
396int i2d_OCSP_SIGNATURE(OCSP_SIGNATURE *a, unsigned char **out);
397extern const ASN1_ITEM OCSP_SIGNATURE_it;
398OCSP_REQINFO *OCSP_REQINFO_new(void);
399void OCSP_REQINFO_free(OCSP_REQINFO *a);
400OCSP_REQINFO *d2i_OCSP_REQINFO(OCSP_REQINFO **a, const unsigned char **in, long len);
401int i2d_OCSP_REQINFO(OCSP_REQINFO *a, unsigned char **out);
402extern const ASN1_ITEM OCSP_REQINFO_it;
403OCSP_CRLID *OCSP_CRLID_new(void);
404void OCSP_CRLID_free(OCSP_CRLID *a);
405OCSP_CRLID *d2i_OCSP_CRLID(OCSP_CRLID **a, const unsigned char **in, long len);
406int i2d_OCSP_CRLID(OCSP_CRLID *a, unsigned char **out);
407extern const ASN1_ITEM OCSP_CRLID_it;
408OCSP_SERVICELOC *OCSP_SERVICELOC_new(void);
409void OCSP_SERVICELOC_free(OCSP_SERVICELOC *a);
410OCSP_SERVICELOC *d2i_OCSP_SERVICELOC(OCSP_SERVICELOC **a, const unsigned char **in, long len);
411int i2d_OCSP_SERVICELOC(OCSP_SERVICELOC *a, unsigned char **out);
412extern const ASN1_ITEM OCSP_SERVICELOC_it;
413
414const char *OCSP_response_status_str(long s);
415const char *OCSP_cert_status_str(long s);
416const char *OCSP_crl_reason_str(long s);
417
418int OCSP_REQUEST_print(BIO *bp, OCSP_REQUEST* a, unsigned long flags);
419int OCSP_RESPONSE_print(BIO *bp, OCSP_RESPONSE* o, unsigned long flags);
420
421int OCSP_basic_verify(OCSP_BASICRESP *bs, STACK_OF(X509) *certs,
422 X509_STORE *st, unsigned long flags);
423
424void ERR_load_OCSP_strings(void);
425
426/* Error codes for the OCSP functions. */
427
428/* Function codes. */
429#define OCSP_F_ASN1_STRING_ENCODE 100
430#define OCSP_F_D2I_OCSP_NONCE 102
431#define OCSP_F_OCSP_BASIC_ADD1_STATUS 103
432#define OCSP_F_OCSP_BASIC_SIGN 104
433#define OCSP_F_OCSP_BASIC_VERIFY 105
434#define OCSP_F_OCSP_CERT_ID_NEW 101
435#define OCSP_F_OCSP_CHECK_DELEGATED 106
436#define OCSP_F_OCSP_CHECK_IDS 107
437#define OCSP_F_OCSP_CHECK_ISSUER 108
438#define OCSP_F_OCSP_CHECK_VALIDITY 115
439#define OCSP_F_OCSP_MATCH_ISSUERID 109
440#define OCSP_F_OCSP_PARSE_URL 114
441#define OCSP_F_OCSP_REQUEST_SIGN 110
442#define OCSP_F_OCSP_REQUEST_VERIFY 116
443#define OCSP_F_OCSP_RESPONSE_GET1_BASIC 111
444#define OCSP_F_OCSP_SENDREQ_BIO 112
445#define OCSP_F_OCSP_SENDREQ_NBIO 117
446#define OCSP_F_PARSE_HTTP_LINE1 118
447#define OCSP_F_REQUEST_VERIFY 113
448
449/* Reason codes. */
450#define OCSP_R_BAD_DATA 100
451#define OCSP_R_CERTIFICATE_VERIFY_ERROR 101
452#define OCSP_R_DIGEST_ERR 102
453#define OCSP_R_ERROR_IN_NEXTUPDATE_FIELD 122
454#define OCSP_R_ERROR_IN_THISUPDATE_FIELD 123
455#define OCSP_R_ERROR_PARSING_URL 121
456#define OCSP_R_MISSING_OCSPSIGNING_USAGE 103
457#define OCSP_R_NEXTUPDATE_BEFORE_THISUPDATE 124
458#define OCSP_R_NOT_BASIC_RESPONSE 104
459#define OCSP_R_NO_CERTIFICATES_IN_CHAIN 105
460#define OCSP_R_NO_CONTENT 106
461#define OCSP_R_NO_PUBLIC_KEY 107
462#define OCSP_R_NO_RESPONSE_DATA 108
463#define OCSP_R_NO_REVOKED_TIME 109
464#define OCSP_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE 110
465#define OCSP_R_REQUEST_NOT_SIGNED 128
466#define OCSP_R_RESPONSE_CONTAINS_NO_REVOCATION_DATA 111
467#define OCSP_R_ROOT_CA_NOT_TRUSTED 112
468#define OCSP_R_SERVER_READ_ERROR 113
469#define OCSP_R_SERVER_RESPONSE_ERROR 114
470#define OCSP_R_SERVER_RESPONSE_PARSE_ERROR 115
471#define OCSP_R_SERVER_WRITE_ERROR 116
472#define OCSP_R_SIGNATURE_FAILURE 117
473#define OCSP_R_SIGNER_CERTIFICATE_NOT_FOUND 118
474#define OCSP_R_STATUS_EXPIRED 125
475#define OCSP_R_STATUS_NOT_YET_VALID 126
476#define OCSP_R_STATUS_TOO_OLD 127
477#define OCSP_R_UNKNOWN_MESSAGE_DIGEST 119
478#define OCSP_R_UNKNOWN_NID 120
479#define OCSP_R_UNSUPPORTED_REQUESTORNAME_TYPE 129
480
481#ifdef __cplusplus
482}
483#endif
484#endif