]> git.ipfire.org Git - thirdparty/openssl.git/blame - include/openssl/ocsp.h
constify X509_REQ_get0_signature()
[thirdparty/openssl.git] / include / openssl / ocsp.h
CommitLineData
0f113f3e 1/*
21dcbebc 2 * Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved.
eb64730b 3 *
21dcbebc
RS
4 * Licensed under the OpenSSL license (the "License"). You may not use
5 * this file except in compliance with the License. You can obtain a copy
6 * in the file LICENSE in the source distribution or at
7 * https://www.openssl.org/source/license.html
eb64730b
RL
8 */
9
10#ifndef HEADER_OCSP_H
0f113f3e 11# define HEADER_OCSP_H
eb64730b 12
5951e840
MC
13#include <openssl/opensslconf.h>
14
15/*
16 * These definitions are outside the OPENSSL_NO_OCSP guard because although for
17 * historical reasons they have OCSP_* names, they can actually be used
18 * independently of OCSP. E.g. see RFC5280
19 */
20/*-
21 * CRLReason ::= ENUMERATED {
22 * unspecified (0),
23 * keyCompromise (1),
24 * cACompromise (2),
25 * affiliationChanged (3),
26 * superseded (4),
27 * cessationOfOperation (5),
28 * certificateHold (6),
29 * removeFromCRL (8) }
30 */
31# define OCSP_REVOKED_STATUS_NOSTATUS -1
32# define OCSP_REVOKED_STATUS_UNSPECIFIED 0
33# define OCSP_REVOKED_STATUS_KEYCOMPROMISE 1
34# define OCSP_REVOKED_STATUS_CACOMPROMISE 2
35# define OCSP_REVOKED_STATUS_AFFILIATIONCHANGED 3
36# define OCSP_REVOKED_STATUS_SUPERSEDED 4
37# define OCSP_REVOKED_STATUS_CESSATIONOFOPERATION 5
38# define OCSP_REVOKED_STATUS_CERTIFICATEHOLD 6
39# define OCSP_REVOKED_STATUS_REMOVEFROMCRL 8
40
41
42# ifndef OPENSSL_NO_OCSP
43
44# include <openssl/ossl_typ.h>
45# include <openssl/x509.h>
46# include <openssl/x509v3.h>
47# include <openssl/safestack.h>
eb64730b
RL
48
49#ifdef __cplusplus
50extern "C" {
51#endif
52
0b33bc65
DSH
53/* Various flags and values */
54
5951e840
MC
55# define OCSP_DEFAULT_NONCE_LENGTH 16
56
57# define OCSP_NOCERTS 0x1
58# define OCSP_NOINTERN 0x2
59# define OCSP_NOSIGS 0x4
60# define OCSP_NOCHAIN 0x8
61# define OCSP_NOVERIFY 0x10
62# define OCSP_NOEXPLICIT 0x20
63# define OCSP_NOCASIGN 0x40
64# define OCSP_NODELEGATED 0x80
65# define OCSP_NOCHECKS 0x100
66# define OCSP_TRUSTOTHER 0x200
67# define OCSP_RESPID_KEY 0x400
68# define OCSP_NOTIME 0x800
0b33bc65 69
6ef869d7 70typedef struct ocsp_cert_id_st OCSP_CERTID;
eb64730b 71
85885715 72DEFINE_STACK_OF(OCSP_CERTID)
73758d43 73
6ef869d7 74typedef struct ocsp_one_request_st OCSP_ONEREQ;
eb64730b 75
85885715 76DEFINE_STACK_OF(OCSP_ONEREQ)
eb64730b 77
6ef869d7
DSH
78typedef struct ocsp_req_info_st OCSP_REQINFO;
79typedef struct ocsp_signature_st OCSP_SIGNATURE;
80typedef struct ocsp_request_st OCSP_REQUEST;
81
5951e840
MC
82# define OCSP_RESPONSE_STATUS_SUCCESSFUL 0
83# define OCSP_RESPONSE_STATUS_MALFORMEDREQUEST 1
84# define OCSP_RESPONSE_STATUS_INTERNALERROR 2
85# define OCSP_RESPONSE_STATUS_TRYLATER 3
86# define OCSP_RESPONSE_STATUS_SIGREQUIRED 5
87# define OCSP_RESPONSE_STATUS_UNAUTHORIZED 6
eb64730b 88
6ef869d7
DSH
89typedef struct ocsp_resp_bytes_st OCSP_RESPBYTES;
90
5951e840
MC
91# define V_OCSP_RESPID_NAME 0
92# define V_OCSP_RESPID_KEY 1
67c8e7f4 93
85885715 94DEFINE_STACK_OF(OCSP_RESPID)
67c8e7f4
DSH
95DECLARE_ASN1_FUNCTIONS(OCSP_RESPID)
96
6ef869d7 97typedef struct ocsp_revoked_info_st OCSP_REVOKEDINFO;
eb64730b 98
5951e840
MC
99# define V_OCSP_CERTSTATUS_GOOD 0
100# define V_OCSP_CERTSTATUS_REVOKED 1
101# define V_OCSP_CERTSTATUS_UNKNOWN 2
6ef869d7
DSH
102
103typedef struct ocsp_cert_status_st OCSP_CERTSTATUS;
104typedef struct ocsp_single_response_st OCSP_SINGLERESP;
eb64730b 105
85885715 106DEFINE_STACK_OF(OCSP_SINGLERESP)
eb64730b 107
6ef869d7
DSH
108typedef struct ocsp_response_data_st OCSP_RESPDATA;
109
110typedef struct ocsp_basic_response_st OCSP_BASICRESP;
eb64730b 111
6ef869d7
DSH
112typedef struct ocsp_crl_id_st OCSP_CRLID;
113typedef struct ocsp_service_locator_st OCSP_SERVICELOC;
0f113f3e 114
5951e840
MC
115# define PEM_STRING_OCSP_REQUEST "OCSP REQUEST"
116# define PEM_STRING_OCSP_RESPONSE "OCSP RESPONSE"
eb64730b 117
5951e840 118# define d2i_OCSP_REQUEST_bio(bp,p) ASN1_d2i_bio_of(OCSP_REQUEST,OCSP_REQUEST_new,d2i_OCSP_REQUEST,bp,p)
eb64730b 119
5951e840 120# define d2i_OCSP_RESPONSE_bio(bp,p) ASN1_d2i_bio_of(OCSP_RESPONSE,OCSP_RESPONSE_new,d2i_OCSP_RESPONSE,bp,p)
eb64730b 121
5951e840 122# define PEM_read_bio_OCSP_REQUEST(bp,x,cb) (OCSP_REQUEST *)PEM_ASN1_read_bio( \
eb64730b
RL
123 (char *(*)())d2i_OCSP_REQUEST,PEM_STRING_OCSP_REQUEST,bp,(char **)x,cb,NULL)
124
5951e840 125# define PEM_read_bio_OCSP_RESPONSE(bp,x,cb)(OCSP_RESPONSE *)PEM_ASN1_read_bio(\
eb64730b
RL
126 (char *(*)())d2i_OCSP_RESPONSE,PEM_STRING_OCSP_RESPONSE,bp,(char **)x,cb,NULL)
127
5951e840 128# define PEM_write_bio_OCSP_REQUEST(bp,o) \
eb64730b 129 PEM_ASN1_write_bio((int (*)())i2d_OCSP_REQUEST,PEM_STRING_OCSP_REQUEST,\
0f113f3e 130 bp,(char *)o, NULL,NULL,0,NULL,NULL)
eb64730b 131
5951e840 132# define PEM_write_bio_OCSP_RESPONSE(bp,o) \
eb64730b 133 PEM_ASN1_write_bio((int (*)())i2d_OCSP_RESPONSE,PEM_STRING_OCSP_RESPONSE,\
0f113f3e 134 bp,(char *)o, NULL,NULL,0,NULL,NULL)
eb64730b 135
5951e840 136# define i2d_OCSP_RESPONSE_bio(bp,o) ASN1_i2d_bio_of(OCSP_RESPONSE,i2d_OCSP_RESPONSE,bp,o)
eb64730b 137
5951e840 138# define i2d_OCSP_REQUEST_bio(bp,o) ASN1_i2d_bio_of(OCSP_REQUEST,i2d_OCSP_REQUEST,bp,o)
eb64730b 139
5951e840 140# define OCSP_REQUEST_sign(o,pkey,md) \
0f113f3e 141 ASN1_item_sign(ASN1_ITEM_rptr(OCSP_REQINFO),\
a332635e
DSH
142 &o->optionalSignature->signatureAlgorithm,NULL,\
143 o->optionalSignature->signature,&o->tbsRequest,pkey,md)
eb64730b 144
5951e840 145# define OCSP_BASICRESP_sign(o,pkey,md,d) \
a332635e
DSH
146 ASN1_item_sign(ASN1_ITEM_rptr(OCSP_RESPDATA),&o->signatureAlgorithm,NULL,\
147 o->signature,&o->tbsResponseData,pkey,md)
eb64730b 148
5951e840 149# define OCSP_REQUEST_verify(a,r) ASN1_item_verify(ASN1_ITEM_rptr(OCSP_REQINFO),\
a332635e
DSH
150 &a->optionalSignature->signatureAlgorithm,\
151 a->optionalSignature->signature,&a->tbsRequest,r)
eb64730b 152
5951e840 153# define OCSP_BASICRESP_verify(a,r,d) ASN1_item_verify(ASN1_ITEM_rptr(OCSP_RESPDATA),\
a332635e 154 &a->signatureAlgorithm,a->signature,&a->tbsResponseData,r)
eb64730b 155
5951e840 156# define ASN1_BIT_STRING_digest(data,type,md,len) \
0f113f3e 157 ASN1_item_digest(ASN1_ITEM_rptr(ASN1_BIT_STRING),type,data,md,len)
eb64730b 158
5951e840 159# define OCSP_CERTSTATUS_dup(cs)\
eb64730b 160 (OCSP_CERTSTATUS*)ASN1_dup((int(*)())i2d_OCSP_CERTSTATUS,\
0f113f3e 161 (char *(*)())d2i_OCSP_CERTSTATUS,(char *)(cs))
eb64730b 162
fb596f3b
DSH
163OCSP_CERTID *OCSP_CERTID_dup(OCSP_CERTID *id);
164
c45a48c1
BL
165OCSP_RESPONSE *OCSP_sendreq_bio(BIO *b, const char *path, OCSP_REQUEST *req);
166OCSP_REQ_CTX *OCSP_sendreq_new(BIO *io, const char *path, OCSP_REQUEST *req,
0f113f3e 167 int maxline);
6f9076ff 168int OCSP_REQ_CTX_nbio(OCSP_REQ_CTX *rctx);
c1c6c0bf 169int OCSP_sendreq_nbio(OCSP_RESPONSE **presp, OCSP_REQ_CTX *rctx);
6f9076ff 170OCSP_REQ_CTX *OCSP_REQ_CTX_new(BIO *io, int maxline);
c1c6c0bf 171void OCSP_REQ_CTX_free(OCSP_REQ_CTX *rctx);
6f9076ff 172void OCSP_set_max_response_length(OCSP_REQ_CTX *rctx, unsigned long len);
0f113f3e
MC
173int OCSP_REQ_CTX_i2d(OCSP_REQ_CTX *rctx, const ASN1_ITEM *it,
174 ASN1_VALUE *val);
175int OCSP_REQ_CTX_nbio_d2i(OCSP_REQ_CTX *rctx, ASN1_VALUE **pval,
176 const ASN1_ITEM *it);
6f9076ff 177BIO *OCSP_REQ_CTX_get0_mem_bio(OCSP_REQ_CTX *rctx);
0f113f3e
MC
178int OCSP_REQ_CTX_i2d(OCSP_REQ_CTX *rctx, const ASN1_ITEM *it,
179 ASN1_VALUE *val);
6f9076ff 180int OCSP_REQ_CTX_http(OCSP_REQ_CTX *rctx, const char *op, const char *path);
18e503f3
DSH
181int OCSP_REQ_CTX_set1_req(OCSP_REQ_CTX *rctx, OCSP_REQUEST *req);
182int OCSP_REQ_CTX_add1_header(OCSP_REQ_CTX *rctx,
0f113f3e 183 const char *name, const char *value);
bf0d176e
DSH
184
185OCSP_CERTID *OCSP_cert_to_id(const EVP_MD *dgst, X509 *subject, X509 *issuer);
186
0f113f3e
MC
187OCSP_CERTID *OCSP_cert_id_new(const EVP_MD *dgst,
188 X509_NAME *issuerName,
189 ASN1_BIT_STRING *issuerKey,
22293ea1 190 ASN1_INTEGER *serialNumber);
eb64730b 191
0b33bc65 192OCSP_ONEREQ *OCSP_request_add0_id(OCSP_REQUEST *req, OCSP_CERTID *cid);
26e083cc 193
0b33bc65 194int OCSP_request_add1_nonce(OCSP_REQUEST *req, unsigned char *val, int len);
46a58ab9 195int OCSP_basic_add1_nonce(OCSP_BASICRESP *resp, unsigned char *val, int len);
0b33bc65 196int OCSP_check_nonce(OCSP_REQUEST *req, OCSP_BASICRESP *bs);
26e083cc
DSH
197int OCSP_copy_nonce(OCSP_BASICRESP *resp, OCSP_REQUEST *req);
198
0b33bc65
DSH
199int OCSP_request_set1_name(OCSP_REQUEST *req, X509_NAME *nm);
200int OCSP_request_add1_cert(OCSP_REQUEST *req, X509 *cert);
eb64730b 201
0f113f3e
MC
202int OCSP_request_sign(OCSP_REQUEST *req,
203 X509 *signer,
204 EVP_PKEY *key,
205 const EVP_MD *dgst,
206 STACK_OF(X509) *certs, unsigned long flags);
0b33bc65
DSH
207
208int OCSP_response_status(OCSP_RESPONSE *resp);
209OCSP_BASICRESP *OCSP_response_get1_basic(OCSP_RESPONSE *resp);
eb64730b 210
79613ea8 211const ASN1_OCTET_STRING *OCSP_resp_get0_signature(const OCSP_BASICRESP *bs);
6ef869d7 212
b5524a3a
DSH
213int OCSP_resp_count(OCSP_BASICRESP *bs);
214OCSP_SINGLERESP *OCSP_resp_get0(OCSP_BASICRESP *bs, int idx);
79613ea8 215const ASN1_GENERALIZEDTIME *OCSP_resp_get0_produced_at(const OCSP_BASICRESP* bs);
02fb7cfe
DSH
216const STACK_OF(X509) *OCSP_resp_get0_certs(const OCSP_BASICRESP *bs);
217int OCSP_resp_get0_id(const OCSP_BASICRESP *bs,
218 const ASN1_OCTET_STRING **pid,
219 const X509_NAME **pname);
220
b5524a3a
DSH
221int OCSP_resp_find(OCSP_BASICRESP *bs, OCSP_CERTID *id, int last);
222int OCSP_single_get0_status(OCSP_SINGLERESP *single, int *reason,
0f113f3e
MC
223 ASN1_GENERALIZEDTIME **revtime,
224 ASN1_GENERALIZEDTIME **thisupd,
225 ASN1_GENERALIZEDTIME **nextupd);
b5524a3a 226int OCSP_resp_find_status(OCSP_BASICRESP *bs, OCSP_CERTID *id, int *status,
0f113f3e
MC
227 int *reason,
228 ASN1_GENERALIZEDTIME **revtime,
229 ASN1_GENERALIZEDTIME **thisupd,
230 ASN1_GENERALIZEDTIME **nextupd);
f1965221 231int OCSP_check_validity(ASN1_GENERALIZEDTIME *thisupd,
0f113f3e 232 ASN1_GENERALIZEDTIME *nextupd, long sec, long maxsec);
b5524a3a 233
0f113f3e
MC
234int OCSP_request_verify(OCSP_REQUEST *req, STACK_OF(X509) *certs,
235 X509_STORE *store, unsigned long flags);
eb64730b 236
0f113f3e
MC
237int OCSP_parse_url(const char *url, char **phost, char **pport, char **ppath,
238 int *pssl);
67c18019 239
81f169e9 240int OCSP_id_issuer_cmp(OCSP_CERTID *a, OCSP_CERTID *b);
0b33bc65
DSH
241int OCSP_id_cmp(OCSP_CERTID *a, OCSP_CERTID *b);
242
02e4fbed
DSH
243int OCSP_request_onereq_count(OCSP_REQUEST *req);
244OCSP_ONEREQ *OCSP_request_onereq_get0(OCSP_REQUEST *req, int i);
245OCSP_CERTID *OCSP_onereq_get0_id(OCSP_ONEREQ *one);
246int OCSP_id_get0_info(ASN1_OCTET_STRING **piNameHash, ASN1_OBJECT **pmd,
0f113f3e
MC
247 ASN1_OCTET_STRING **pikeyHash,
248 ASN1_INTEGER **pserial, OCSP_CERTID *cid);
fafc7f98 249int OCSP_request_is_signed(OCSP_REQUEST *req);
2b916952 250OCSP_RESPONSE *OCSP_response_create(int status, OCSP_BASICRESP *bs);
02e4fbed 251OCSP_SINGLERESP *OCSP_basic_add1_status(OCSP_BASICRESP *rsp,
0f113f3e
MC
252 OCSP_CERTID *cid,
253 int status, int reason,
254 ASN1_TIME *revtime,
255 ASN1_TIME *thisupd,
256 ASN1_TIME *nextupd);
02e4fbed 257int OCSP_basic_add1_cert(OCSP_BASICRESP *resp, X509 *cert);
0f113f3e
MC
258int OCSP_basic_sign(OCSP_BASICRESP *brsp,
259 X509 *signer, EVP_PKEY *key, const EVP_MD *dgst,
260 STACK_OF(X509) *certs, unsigned long flags);
eb64730b 261
eb64730b
RL
262X509_EXTENSION *OCSP_crlID_new(char *url, long *n, char *tim);
263
264X509_EXTENSION *OCSP_accept_responses_new(char **oids);
265
0f113f3e 266X509_EXTENSION *OCSP_archive_cutoff_new(char *tim);
eb64730b 267
0f113f3e 268X509_EXTENSION *OCSP_url_svcloc_new(X509_NAME *issuer, char **urls);
eb64730b 269
ec558b65
DSH
270int OCSP_REQUEST_get_ext_count(OCSP_REQUEST *x);
271int OCSP_REQUEST_get_ext_by_NID(OCSP_REQUEST *x, int nid, int lastpos);
c47ba4e9 272int OCSP_REQUEST_get_ext_by_OBJ(OCSP_REQUEST *x, const ASN1_OBJECT *obj,
0f113f3e 273 int lastpos);
ec558b65
DSH
274int OCSP_REQUEST_get_ext_by_critical(OCSP_REQUEST *x, int crit, int lastpos);
275X509_EXTENSION *OCSP_REQUEST_get_ext(OCSP_REQUEST *x, int loc);
276X509_EXTENSION *OCSP_REQUEST_delete_ext(OCSP_REQUEST *x, int loc);
0f113f3e
MC
277void *OCSP_REQUEST_get1_ext_d2i(OCSP_REQUEST *x, int nid, int *crit,
278 int *idx);
ec558b65 279int OCSP_REQUEST_add1_ext_i2d(OCSP_REQUEST *x, int nid, void *value, int crit,
0f113f3e 280 unsigned long flags);
ec558b65
DSH
281int OCSP_REQUEST_add_ext(OCSP_REQUEST *x, X509_EXTENSION *ex, int loc);
282
283int OCSP_ONEREQ_get_ext_count(OCSP_ONEREQ *x);
284int OCSP_ONEREQ_get_ext_by_NID(OCSP_ONEREQ *x, int nid, int lastpos);
c47ba4e9 285int OCSP_ONEREQ_get_ext_by_OBJ(OCSP_ONEREQ *x, const ASN1_OBJECT *obj, int lastpos);
ec558b65
DSH
286int OCSP_ONEREQ_get_ext_by_critical(OCSP_ONEREQ *x, int crit, int lastpos);
287X509_EXTENSION *OCSP_ONEREQ_get_ext(OCSP_ONEREQ *x, int loc);
288X509_EXTENSION *OCSP_ONEREQ_delete_ext(OCSP_ONEREQ *x, int loc);
289void *OCSP_ONEREQ_get1_ext_d2i(OCSP_ONEREQ *x, int nid, int *crit, int *idx);
290int OCSP_ONEREQ_add1_ext_i2d(OCSP_ONEREQ *x, int nid, void *value, int crit,
0f113f3e 291 unsigned long flags);
ec558b65
DSH
292int OCSP_ONEREQ_add_ext(OCSP_ONEREQ *x, X509_EXTENSION *ex, int loc);
293
294int OCSP_BASICRESP_get_ext_count(OCSP_BASICRESP *x);
295int OCSP_BASICRESP_get_ext_by_NID(OCSP_BASICRESP *x, int nid, int lastpos);
c47ba4e9 296int OCSP_BASICRESP_get_ext_by_OBJ(OCSP_BASICRESP *x, const ASN1_OBJECT *obj,
0f113f3e
MC
297 int lastpos);
298int OCSP_BASICRESP_get_ext_by_critical(OCSP_BASICRESP *x, int crit,
299 int lastpos);
ec558b65
DSH
300X509_EXTENSION *OCSP_BASICRESP_get_ext(OCSP_BASICRESP *x, int loc);
301X509_EXTENSION *OCSP_BASICRESP_delete_ext(OCSP_BASICRESP *x, int loc);
0f113f3e
MC
302void *OCSP_BASICRESP_get1_ext_d2i(OCSP_BASICRESP *x, int nid, int *crit,
303 int *idx);
304int OCSP_BASICRESP_add1_ext_i2d(OCSP_BASICRESP *x, int nid, void *value,
305 int crit, unsigned long flags);
ec558b65
DSH
306int OCSP_BASICRESP_add_ext(OCSP_BASICRESP *x, X509_EXTENSION *ex, int loc);
307
308int OCSP_SINGLERESP_get_ext_count(OCSP_SINGLERESP *x);
309int OCSP_SINGLERESP_get_ext_by_NID(OCSP_SINGLERESP *x, int nid, int lastpos);
c47ba4e9 310int OCSP_SINGLERESP_get_ext_by_OBJ(OCSP_SINGLERESP *x, const ASN1_OBJECT *obj,
0f113f3e
MC
311 int lastpos);
312int OCSP_SINGLERESP_get_ext_by_critical(OCSP_SINGLERESP *x, int crit,
313 int lastpos);
ec558b65
DSH
314X509_EXTENSION *OCSP_SINGLERESP_get_ext(OCSP_SINGLERESP *x, int loc);
315X509_EXTENSION *OCSP_SINGLERESP_delete_ext(OCSP_SINGLERESP *x, int loc);
0f113f3e
MC
316void *OCSP_SINGLERESP_get1_ext_d2i(OCSP_SINGLERESP *x, int nid, int *crit,
317 int *idx);
318int OCSP_SINGLERESP_add1_ext_i2d(OCSP_SINGLERESP *x, int nid, void *value,
319 int crit, unsigned long flags);
ec558b65 320int OCSP_SINGLERESP_add_ext(OCSP_SINGLERESP *x, X509_EXTENSION *ex, int loc);
79613ea8 321const OCSP_CERTID *OCSP_SINGLERESP_get0_id(const OCSP_SINGLERESP *x);
ec558b65 322
c08523d8 323DECLARE_ASN1_FUNCTIONS(OCSP_SINGLERESP)
73e92de5
DSH
324DECLARE_ASN1_FUNCTIONS(OCSP_CERTSTATUS)
325DECLARE_ASN1_FUNCTIONS(OCSP_REVOKEDINFO)
326DECLARE_ASN1_FUNCTIONS(OCSP_BASICRESP)
327DECLARE_ASN1_FUNCTIONS(OCSP_RESPDATA)
328DECLARE_ASN1_FUNCTIONS(OCSP_RESPID)
329DECLARE_ASN1_FUNCTIONS(OCSP_RESPONSE)
330DECLARE_ASN1_FUNCTIONS(OCSP_RESPBYTES)
331DECLARE_ASN1_FUNCTIONS(OCSP_ONEREQ)
332DECLARE_ASN1_FUNCTIONS(OCSP_CERTID)
333DECLARE_ASN1_FUNCTIONS(OCSP_REQUEST)
334DECLARE_ASN1_FUNCTIONS(OCSP_SIGNATURE)
1f47ec53 335DECLARE_ASN1_FUNCTIONS(OCSP_REQINFO)
c08523d8 336DECLARE_ASN1_FUNCTIONS(OCSP_CRLID)
c08523d8 337DECLARE_ASN1_FUNCTIONS(OCSP_SERVICELOC)
eb64730b 338
ebc06fba
AP
339const char *OCSP_response_status_str(long s);
340const char *OCSP_cert_status_str(long s);
341const char *OCSP_crl_reason_str(long s);
73758d43 342
0f113f3e
MC
343int OCSP_REQUEST_print(BIO *bp, OCSP_REQUEST *a, unsigned long flags);
344int OCSP_RESPONSE_print(BIO *bp, OCSP_RESPONSE *o, unsigned long flags);
73e92de5 345
9b4dc830 346int OCSP_basic_verify(OCSP_BASICRESP *bs, STACK_OF(X509) *certs,
0f113f3e 347 X509_STORE *st, unsigned long flags);
73e92de5 348
eb64730b 349/* BEGIN ERROR CODES */
0f113f3e
MC
350/*
351 * The following lines are auto generated by the script mkerr.pl. Any changes
eb64730b
RL
352 * made after this point may be overwritten when the script is next run.
353 */
0cd0a820 354
69588edb 355int ERR_load_OCSP_strings(void);
eb64730b
RL
356
357/* Error codes for the OCSP functions. */
358
359/* Function codes. */
0f113f3e
MC
360# define OCSP_F_D2I_OCSP_NONCE 102
361# define OCSP_F_OCSP_BASIC_ADD1_STATUS 103
362# define OCSP_F_OCSP_BASIC_SIGN 104
363# define OCSP_F_OCSP_BASIC_VERIFY 105
364# define OCSP_F_OCSP_CERT_ID_NEW 101
365# define OCSP_F_OCSP_CHECK_DELEGATED 106
366# define OCSP_F_OCSP_CHECK_IDS 107
367# define OCSP_F_OCSP_CHECK_ISSUER 108
368# define OCSP_F_OCSP_CHECK_VALIDITY 115
369# define OCSP_F_OCSP_MATCH_ISSUERID 109
370# define OCSP_F_OCSP_PARSE_URL 114
371# define OCSP_F_OCSP_REQUEST_SIGN 110
372# define OCSP_F_OCSP_REQUEST_VERIFY 116
373# define OCSP_F_OCSP_RESPONSE_GET1_BASIC 111
0f113f3e 374# define OCSP_F_PARSE_HTTP_LINE1 118
eb64730b
RL
375
376/* Reason codes. */
0f113f3e
MC
377# define OCSP_R_CERTIFICATE_VERIFY_ERROR 101
378# define OCSP_R_DIGEST_ERR 102
379# define OCSP_R_ERROR_IN_NEXTUPDATE_FIELD 122
380# define OCSP_R_ERROR_IN_THISUPDATE_FIELD 123
381# define OCSP_R_ERROR_PARSING_URL 121
382# define OCSP_R_MISSING_OCSPSIGNING_USAGE 103
383# define OCSP_R_NEXTUPDATE_BEFORE_THISUPDATE 124
384# define OCSP_R_NOT_BASIC_RESPONSE 104
385# define OCSP_R_NO_CERTIFICATES_IN_CHAIN 105
0f113f3e
MC
386# define OCSP_R_NO_RESPONSE_DATA 108
387# define OCSP_R_NO_REVOKED_TIME 109
d32f5d87 388# define OCSP_R_NO_SIGNER_KEY 130
0f113f3e
MC
389# define OCSP_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE 110
390# define OCSP_R_REQUEST_NOT_SIGNED 128
391# define OCSP_R_RESPONSE_CONTAINS_NO_REVOCATION_DATA 111
392# define OCSP_R_ROOT_CA_NOT_TRUSTED 112
0f113f3e
MC
393# define OCSP_R_SERVER_RESPONSE_ERROR 114
394# define OCSP_R_SERVER_RESPONSE_PARSE_ERROR 115
0f113f3e
MC
395# define OCSP_R_SIGNATURE_FAILURE 117
396# define OCSP_R_SIGNER_CERTIFICATE_NOT_FOUND 118
397# define OCSP_R_STATUS_EXPIRED 125
398# define OCSP_R_STATUS_NOT_YET_VALID 126
399# define OCSP_R_STATUS_TOO_OLD 127
400# define OCSP_R_UNKNOWN_MESSAGE_DIGEST 119
401# define OCSP_R_UNKNOWN_NID 120
402# define OCSP_R_UNSUPPORTED_REQUESTORNAME_TYPE 129
eb64730b 403
0cd0a820 404# ifdef __cplusplus
eb64730b 405}
0cd0a820 406# endif
5951e840 407# endif
eb64730b 408#endif