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