]>
Commit | Line | Data |
---|---|---|
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 | |
50 | extern "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 | 70 | typedef struct ocsp_cert_id_st OCSP_CERTID; |
eb64730b | 71 | |
85885715 | 72 | DEFINE_STACK_OF(OCSP_CERTID) |
73758d43 | 73 | |
6ef869d7 | 74 | typedef struct ocsp_one_request_st OCSP_ONEREQ; |
eb64730b | 75 | |
85885715 | 76 | DEFINE_STACK_OF(OCSP_ONEREQ) |
eb64730b | 77 | |
6ef869d7 DSH |
78 | typedef struct ocsp_req_info_st OCSP_REQINFO; |
79 | typedef struct ocsp_signature_st OCSP_SIGNATURE; | |
80 | typedef 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 |
89 | typedef 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 | 94 | DEFINE_STACK_OF(OCSP_RESPID) |
67c8e7f4 DSH |
95 | DECLARE_ASN1_FUNCTIONS(OCSP_RESPID) |
96 | ||
6ef869d7 | 97 | typedef 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 | |
103 | typedef struct ocsp_cert_status_st OCSP_CERTSTATUS; | |
104 | typedef struct ocsp_single_response_st OCSP_SINGLERESP; | |
eb64730b | 105 | |
85885715 | 106 | DEFINE_STACK_OF(OCSP_SINGLERESP) |
eb64730b | 107 | |
6ef869d7 DSH |
108 | typedef struct ocsp_response_data_st OCSP_RESPDATA; |
109 | ||
110 | typedef struct ocsp_basic_response_st OCSP_BASICRESP; | |
eb64730b | 111 | |
6ef869d7 DSH |
112 | typedef struct ocsp_crl_id_st OCSP_CRLID; |
113 | typedef 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( \ |
37659ea4 BE |
123 | (char *(*)())d2i_OCSP_REQUEST,PEM_STRING_OCSP_REQUEST, \ |
124 | bp,(char **)(x),cb,NULL) | |
eb64730b | 125 | |
37659ea4 BE |
126 | # define PEM_read_bio_OCSP_RESPONSE(bp,x,cb)(OCSP_RESPONSE *)PEM_ASN1_read_bio(\ |
127 | (char *(*)())d2i_OCSP_RESPONSE,PEM_STRING_OCSP_RESPONSE, \ | |
128 | bp,(char **)(x),cb,NULL) | |
eb64730b | 129 | |
5951e840 | 130 | # define PEM_write_bio_OCSP_REQUEST(bp,o) \ |
eb64730b | 131 | PEM_ASN1_write_bio((int (*)())i2d_OCSP_REQUEST,PEM_STRING_OCSP_REQUEST,\ |
37659ea4 | 132 | bp,(char *)(o), NULL,NULL,0,NULL,NULL) |
eb64730b | 133 | |
5951e840 | 134 | # define PEM_write_bio_OCSP_RESPONSE(bp,o) \ |
eb64730b | 135 | PEM_ASN1_write_bio((int (*)())i2d_OCSP_RESPONSE,PEM_STRING_OCSP_RESPONSE,\ |
37659ea4 | 136 | bp,(char *)(o), NULL,NULL,0,NULL,NULL) |
eb64730b | 137 | |
5951e840 | 138 | # define i2d_OCSP_RESPONSE_bio(bp,o) ASN1_i2d_bio_of(OCSP_RESPONSE,i2d_OCSP_RESPONSE,bp,o) |
eb64730b | 139 | |
5951e840 | 140 | # define i2d_OCSP_REQUEST_bio(bp,o) ASN1_i2d_bio_of(OCSP_REQUEST,i2d_OCSP_REQUEST,bp,o) |
eb64730b | 141 | |
5951e840 | 142 | # define OCSP_REQUEST_sign(o,pkey,md) \ |
0f113f3e | 143 | ASN1_item_sign(ASN1_ITEM_rptr(OCSP_REQINFO),\ |
37659ea4 BE |
144 | &(o)->optionalSignature->signatureAlgorithm,NULL,\ |
145 | (o)->optionalSignature->signature,&(o)->tbsRequest,pkey,md) | |
eb64730b | 146 | |
5951e840 | 147 | # define OCSP_BASICRESP_sign(o,pkey,md,d) \ |
37659ea4 BE |
148 | ASN1_item_sign(ASN1_ITEM_rptr(OCSP_RESPDATA),&(o)->signatureAlgorithm,\ |
149 | NULL,(o)->signature,&(o)->tbsResponseData,pkey,md) | |
eb64730b | 150 | |
5951e840 | 151 | # define OCSP_REQUEST_verify(a,r) ASN1_item_verify(ASN1_ITEM_rptr(OCSP_REQINFO),\ |
37659ea4 BE |
152 | &(a)->optionalSignature->signatureAlgorithm,\ |
153 | (a)->optionalSignature->signature,&(a)->tbsRequest,r) | |
eb64730b | 154 | |
5951e840 | 155 | # define OCSP_BASICRESP_verify(a,r,d) ASN1_item_verify(ASN1_ITEM_rptr(OCSP_RESPDATA),\ |
37659ea4 | 156 | &(a)->signatureAlgorithm,(a)->signature,&(a)->tbsResponseData,r) |
eb64730b | 157 | |
5951e840 | 158 | # define ASN1_BIT_STRING_digest(data,type,md,len) \ |
0f113f3e | 159 | ASN1_item_digest(ASN1_ITEM_rptr(ASN1_BIT_STRING),type,data,md,len) |
eb64730b | 160 | |
5951e840 | 161 | # define OCSP_CERTSTATUS_dup(cs)\ |
eb64730b | 162 | (OCSP_CERTSTATUS*)ASN1_dup((int(*)())i2d_OCSP_CERTSTATUS,\ |
0f113f3e | 163 | (char *(*)())d2i_OCSP_CERTSTATUS,(char *)(cs)) |
eb64730b | 164 | |
fb596f3b DSH |
165 | OCSP_CERTID *OCSP_CERTID_dup(OCSP_CERTID *id); |
166 | ||
c45a48c1 BL |
167 | OCSP_RESPONSE *OCSP_sendreq_bio(BIO *b, const char *path, OCSP_REQUEST *req); |
168 | OCSP_REQ_CTX *OCSP_sendreq_new(BIO *io, const char *path, OCSP_REQUEST *req, | |
0f113f3e | 169 | int maxline); |
6f9076ff | 170 | int OCSP_REQ_CTX_nbio(OCSP_REQ_CTX *rctx); |
c1c6c0bf | 171 | int OCSP_sendreq_nbio(OCSP_RESPONSE **presp, OCSP_REQ_CTX *rctx); |
6f9076ff | 172 | OCSP_REQ_CTX *OCSP_REQ_CTX_new(BIO *io, int maxline); |
c1c6c0bf | 173 | void OCSP_REQ_CTX_free(OCSP_REQ_CTX *rctx); |
6f9076ff | 174 | void OCSP_set_max_response_length(OCSP_REQ_CTX *rctx, unsigned long len); |
0f113f3e MC |
175 | int OCSP_REQ_CTX_i2d(OCSP_REQ_CTX *rctx, const ASN1_ITEM *it, |
176 | ASN1_VALUE *val); | |
177 | int OCSP_REQ_CTX_nbio_d2i(OCSP_REQ_CTX *rctx, ASN1_VALUE **pval, | |
178 | const ASN1_ITEM *it); | |
6f9076ff | 179 | BIO *OCSP_REQ_CTX_get0_mem_bio(OCSP_REQ_CTX *rctx); |
0f113f3e MC |
180 | int OCSP_REQ_CTX_i2d(OCSP_REQ_CTX *rctx, const ASN1_ITEM *it, |
181 | ASN1_VALUE *val); | |
6f9076ff | 182 | int OCSP_REQ_CTX_http(OCSP_REQ_CTX *rctx, const char *op, const char *path); |
18e503f3 DSH |
183 | int OCSP_REQ_CTX_set1_req(OCSP_REQ_CTX *rctx, OCSP_REQUEST *req); |
184 | int OCSP_REQ_CTX_add1_header(OCSP_REQ_CTX *rctx, | |
0f113f3e | 185 | const char *name, const char *value); |
bf0d176e | 186 | |
68c12bfc DSH |
187 | OCSP_CERTID *OCSP_cert_to_id(const EVP_MD *dgst, const X509 *subject, |
188 | const X509 *issuer); | |
bf0d176e | 189 | |
0f113f3e | 190 | OCSP_CERTID *OCSP_cert_id_new(const EVP_MD *dgst, |
68c12bfc DSH |
191 | const X509_NAME *issuerName, |
192 | const ASN1_BIT_STRING *issuerKey, | |
193 | const ASN1_INTEGER *serialNumber); | |
eb64730b | 194 | |
0b33bc65 | 195 | OCSP_ONEREQ *OCSP_request_add0_id(OCSP_REQUEST *req, OCSP_CERTID *cid); |
26e083cc | 196 | |
0b33bc65 | 197 | int OCSP_request_add1_nonce(OCSP_REQUEST *req, unsigned char *val, int len); |
46a58ab9 | 198 | int OCSP_basic_add1_nonce(OCSP_BASICRESP *resp, unsigned char *val, int len); |
0b33bc65 | 199 | int OCSP_check_nonce(OCSP_REQUEST *req, OCSP_BASICRESP *bs); |
26e083cc DSH |
200 | int OCSP_copy_nonce(OCSP_BASICRESP *resp, OCSP_REQUEST *req); |
201 | ||
0b33bc65 DSH |
202 | int OCSP_request_set1_name(OCSP_REQUEST *req, X509_NAME *nm); |
203 | int OCSP_request_add1_cert(OCSP_REQUEST *req, X509 *cert); | |
eb64730b | 204 | |
0f113f3e MC |
205 | int OCSP_request_sign(OCSP_REQUEST *req, |
206 | X509 *signer, | |
207 | EVP_PKEY *key, | |
208 | const EVP_MD *dgst, | |
209 | STACK_OF(X509) *certs, unsigned long flags); | |
0b33bc65 DSH |
210 | |
211 | int OCSP_response_status(OCSP_RESPONSE *resp); | |
212 | OCSP_BASICRESP *OCSP_response_get1_basic(OCSP_RESPONSE *resp); | |
eb64730b | 213 | |
79613ea8 | 214 | const ASN1_OCTET_STRING *OCSP_resp_get0_signature(const OCSP_BASICRESP *bs); |
6ef869d7 | 215 | |
b5524a3a DSH |
216 | int OCSP_resp_count(OCSP_BASICRESP *bs); |
217 | OCSP_SINGLERESP *OCSP_resp_get0(OCSP_BASICRESP *bs, int idx); | |
79613ea8 | 218 | const ASN1_GENERALIZEDTIME *OCSP_resp_get0_produced_at(const OCSP_BASICRESP* bs); |
02fb7cfe DSH |
219 | const STACK_OF(X509) *OCSP_resp_get0_certs(const OCSP_BASICRESP *bs); |
220 | int OCSP_resp_get0_id(const OCSP_BASICRESP *bs, | |
221 | const ASN1_OCTET_STRING **pid, | |
222 | const X509_NAME **pname); | |
223 | ||
b5524a3a DSH |
224 | int OCSP_resp_find(OCSP_BASICRESP *bs, OCSP_CERTID *id, int last); |
225 | int OCSP_single_get0_status(OCSP_SINGLERESP *single, int *reason, | |
0f113f3e MC |
226 | ASN1_GENERALIZEDTIME **revtime, |
227 | ASN1_GENERALIZEDTIME **thisupd, | |
228 | ASN1_GENERALIZEDTIME **nextupd); | |
b5524a3a | 229 | int OCSP_resp_find_status(OCSP_BASICRESP *bs, OCSP_CERTID *id, int *status, |
0f113f3e MC |
230 | int *reason, |
231 | ASN1_GENERALIZEDTIME **revtime, | |
232 | ASN1_GENERALIZEDTIME **thisupd, | |
233 | ASN1_GENERALIZEDTIME **nextupd); | |
f1965221 | 234 | int OCSP_check_validity(ASN1_GENERALIZEDTIME *thisupd, |
0f113f3e | 235 | ASN1_GENERALIZEDTIME *nextupd, long sec, long maxsec); |
b5524a3a | 236 | |
0f113f3e MC |
237 | int OCSP_request_verify(OCSP_REQUEST *req, STACK_OF(X509) *certs, |
238 | X509_STORE *store, unsigned long flags); | |
eb64730b | 239 | |
0f113f3e MC |
240 | int OCSP_parse_url(const char *url, char **phost, char **pport, char **ppath, |
241 | int *pssl); | |
67c18019 | 242 | |
81f169e9 | 243 | int OCSP_id_issuer_cmp(OCSP_CERTID *a, OCSP_CERTID *b); |
0b33bc65 DSH |
244 | int OCSP_id_cmp(OCSP_CERTID *a, OCSP_CERTID *b); |
245 | ||
02e4fbed DSH |
246 | int OCSP_request_onereq_count(OCSP_REQUEST *req); |
247 | OCSP_ONEREQ *OCSP_request_onereq_get0(OCSP_REQUEST *req, int i); | |
248 | OCSP_CERTID *OCSP_onereq_get0_id(OCSP_ONEREQ *one); | |
249 | int OCSP_id_get0_info(ASN1_OCTET_STRING **piNameHash, ASN1_OBJECT **pmd, | |
0f113f3e MC |
250 | ASN1_OCTET_STRING **pikeyHash, |
251 | ASN1_INTEGER **pserial, OCSP_CERTID *cid); | |
fafc7f98 | 252 | int OCSP_request_is_signed(OCSP_REQUEST *req); |
2b916952 | 253 | OCSP_RESPONSE *OCSP_response_create(int status, OCSP_BASICRESP *bs); |
02e4fbed | 254 | OCSP_SINGLERESP *OCSP_basic_add1_status(OCSP_BASICRESP *rsp, |
0f113f3e MC |
255 | OCSP_CERTID *cid, |
256 | int status, int reason, | |
257 | ASN1_TIME *revtime, | |
258 | ASN1_TIME *thisupd, | |
259 | ASN1_TIME *nextupd); | |
02e4fbed | 260 | int OCSP_basic_add1_cert(OCSP_BASICRESP *resp, X509 *cert); |
0f113f3e MC |
261 | int OCSP_basic_sign(OCSP_BASICRESP *brsp, |
262 | X509 *signer, EVP_PKEY *key, const EVP_MD *dgst, | |
263 | STACK_OF(X509) *certs, unsigned long flags); | |
e12c0beb MC |
264 | int OCSP_RESPID_set_by_name(OCSP_RESPID *respid, X509 *cert); |
265 | int OCSP_RESPID_set_by_key(OCSP_RESPID *respid, X509 *cert); | |
a671b3e6 | 266 | int OCSP_RESPID_match(OCSP_RESPID *respid, X509 *cert); |
eb64730b | 267 | |
a026fbf9 | 268 | X509_EXTENSION *OCSP_crlID_new(const char *url, long *n, char *tim); |
eb64730b RL |
269 | |
270 | X509_EXTENSION *OCSP_accept_responses_new(char **oids); | |
271 | ||
0f113f3e | 272 | X509_EXTENSION *OCSP_archive_cutoff_new(char *tim); |
eb64730b | 273 | |
a026fbf9 | 274 | X509_EXTENSION *OCSP_url_svcloc_new(X509_NAME *issuer, const char **urls); |
eb64730b | 275 | |
ec558b65 DSH |
276 | int OCSP_REQUEST_get_ext_count(OCSP_REQUEST *x); |
277 | int OCSP_REQUEST_get_ext_by_NID(OCSP_REQUEST *x, int nid, int lastpos); | |
c47ba4e9 | 278 | int OCSP_REQUEST_get_ext_by_OBJ(OCSP_REQUEST *x, const ASN1_OBJECT *obj, |
0f113f3e | 279 | int lastpos); |
ec558b65 DSH |
280 | int OCSP_REQUEST_get_ext_by_critical(OCSP_REQUEST *x, int crit, int lastpos); |
281 | X509_EXTENSION *OCSP_REQUEST_get_ext(OCSP_REQUEST *x, int loc); | |
282 | X509_EXTENSION *OCSP_REQUEST_delete_ext(OCSP_REQUEST *x, int loc); | |
0f113f3e MC |
283 | void *OCSP_REQUEST_get1_ext_d2i(OCSP_REQUEST *x, int nid, int *crit, |
284 | int *idx); | |
ec558b65 | 285 | int OCSP_REQUEST_add1_ext_i2d(OCSP_REQUEST *x, int nid, void *value, int crit, |
0f113f3e | 286 | unsigned long flags); |
ec558b65 DSH |
287 | int OCSP_REQUEST_add_ext(OCSP_REQUEST *x, X509_EXTENSION *ex, int loc); |
288 | ||
289 | int OCSP_ONEREQ_get_ext_count(OCSP_ONEREQ *x); | |
290 | int OCSP_ONEREQ_get_ext_by_NID(OCSP_ONEREQ *x, int nid, int lastpos); | |
c47ba4e9 | 291 | int OCSP_ONEREQ_get_ext_by_OBJ(OCSP_ONEREQ *x, const ASN1_OBJECT *obj, int lastpos); |
ec558b65 DSH |
292 | int OCSP_ONEREQ_get_ext_by_critical(OCSP_ONEREQ *x, int crit, int lastpos); |
293 | X509_EXTENSION *OCSP_ONEREQ_get_ext(OCSP_ONEREQ *x, int loc); | |
294 | X509_EXTENSION *OCSP_ONEREQ_delete_ext(OCSP_ONEREQ *x, int loc); | |
295 | void *OCSP_ONEREQ_get1_ext_d2i(OCSP_ONEREQ *x, int nid, int *crit, int *idx); | |
296 | int OCSP_ONEREQ_add1_ext_i2d(OCSP_ONEREQ *x, int nid, void *value, int crit, | |
0f113f3e | 297 | unsigned long flags); |
ec558b65 DSH |
298 | int OCSP_ONEREQ_add_ext(OCSP_ONEREQ *x, X509_EXTENSION *ex, int loc); |
299 | ||
300 | int OCSP_BASICRESP_get_ext_count(OCSP_BASICRESP *x); | |
301 | int OCSP_BASICRESP_get_ext_by_NID(OCSP_BASICRESP *x, int nid, int lastpos); | |
c47ba4e9 | 302 | int OCSP_BASICRESP_get_ext_by_OBJ(OCSP_BASICRESP *x, const ASN1_OBJECT *obj, |
0f113f3e MC |
303 | int lastpos); |
304 | int OCSP_BASICRESP_get_ext_by_critical(OCSP_BASICRESP *x, int crit, | |
305 | int lastpos); | |
ec558b65 DSH |
306 | X509_EXTENSION *OCSP_BASICRESP_get_ext(OCSP_BASICRESP *x, int loc); |
307 | X509_EXTENSION *OCSP_BASICRESP_delete_ext(OCSP_BASICRESP *x, int loc); | |
0f113f3e MC |
308 | void *OCSP_BASICRESP_get1_ext_d2i(OCSP_BASICRESP *x, int nid, int *crit, |
309 | int *idx); | |
310 | int OCSP_BASICRESP_add1_ext_i2d(OCSP_BASICRESP *x, int nid, void *value, | |
311 | int crit, unsigned long flags); | |
ec558b65 DSH |
312 | int OCSP_BASICRESP_add_ext(OCSP_BASICRESP *x, X509_EXTENSION *ex, int loc); |
313 | ||
314 | int OCSP_SINGLERESP_get_ext_count(OCSP_SINGLERESP *x); | |
315 | int OCSP_SINGLERESP_get_ext_by_NID(OCSP_SINGLERESP *x, int nid, int lastpos); | |
c47ba4e9 | 316 | int OCSP_SINGLERESP_get_ext_by_OBJ(OCSP_SINGLERESP *x, const ASN1_OBJECT *obj, |
0f113f3e MC |
317 | int lastpos); |
318 | int OCSP_SINGLERESP_get_ext_by_critical(OCSP_SINGLERESP *x, int crit, | |
319 | int lastpos); | |
ec558b65 DSH |
320 | X509_EXTENSION *OCSP_SINGLERESP_get_ext(OCSP_SINGLERESP *x, int loc); |
321 | X509_EXTENSION *OCSP_SINGLERESP_delete_ext(OCSP_SINGLERESP *x, int loc); | |
0f113f3e MC |
322 | void *OCSP_SINGLERESP_get1_ext_d2i(OCSP_SINGLERESP *x, int nid, int *crit, |
323 | int *idx); | |
324 | int OCSP_SINGLERESP_add1_ext_i2d(OCSP_SINGLERESP *x, int nid, void *value, | |
325 | int crit, unsigned long flags); | |
ec558b65 | 326 | int OCSP_SINGLERESP_add_ext(OCSP_SINGLERESP *x, X509_EXTENSION *ex, int loc); |
79613ea8 | 327 | const OCSP_CERTID *OCSP_SINGLERESP_get0_id(const OCSP_SINGLERESP *x); |
ec558b65 | 328 | |
c08523d8 | 329 | DECLARE_ASN1_FUNCTIONS(OCSP_SINGLERESP) |
73e92de5 DSH |
330 | DECLARE_ASN1_FUNCTIONS(OCSP_CERTSTATUS) |
331 | DECLARE_ASN1_FUNCTIONS(OCSP_REVOKEDINFO) | |
332 | DECLARE_ASN1_FUNCTIONS(OCSP_BASICRESP) | |
333 | DECLARE_ASN1_FUNCTIONS(OCSP_RESPDATA) | |
334 | DECLARE_ASN1_FUNCTIONS(OCSP_RESPID) | |
335 | DECLARE_ASN1_FUNCTIONS(OCSP_RESPONSE) | |
336 | DECLARE_ASN1_FUNCTIONS(OCSP_RESPBYTES) | |
337 | DECLARE_ASN1_FUNCTIONS(OCSP_ONEREQ) | |
338 | DECLARE_ASN1_FUNCTIONS(OCSP_CERTID) | |
339 | DECLARE_ASN1_FUNCTIONS(OCSP_REQUEST) | |
340 | DECLARE_ASN1_FUNCTIONS(OCSP_SIGNATURE) | |
1f47ec53 | 341 | DECLARE_ASN1_FUNCTIONS(OCSP_REQINFO) |
c08523d8 | 342 | DECLARE_ASN1_FUNCTIONS(OCSP_CRLID) |
c08523d8 | 343 | DECLARE_ASN1_FUNCTIONS(OCSP_SERVICELOC) |
eb64730b | 344 | |
ebc06fba AP |
345 | const char *OCSP_response_status_str(long s); |
346 | const char *OCSP_cert_status_str(long s); | |
347 | const char *OCSP_crl_reason_str(long s); | |
73758d43 | 348 | |
0f113f3e MC |
349 | int OCSP_REQUEST_print(BIO *bp, OCSP_REQUEST *a, unsigned long flags); |
350 | int OCSP_RESPONSE_print(BIO *bp, OCSP_RESPONSE *o, unsigned long flags); | |
73e92de5 | 351 | |
9b4dc830 | 352 | int OCSP_basic_verify(OCSP_BASICRESP *bs, STACK_OF(X509) *certs, |
0f113f3e | 353 | X509_STORE *st, unsigned long flags); |
73e92de5 | 354 | |
eb64730b | 355 | /* BEGIN ERROR CODES */ |
0f113f3e MC |
356 | /* |
357 | * The following lines are auto generated by the script mkerr.pl. Any changes | |
eb64730b RL |
358 | * made after this point may be overwritten when the script is next run. |
359 | */ | |
0cd0a820 | 360 | |
69588edb | 361 | int ERR_load_OCSP_strings(void); |
eb64730b RL |
362 | |
363 | /* Error codes for the OCSP functions. */ | |
364 | ||
365 | /* Function codes. */ | |
0f113f3e MC |
366 | # define OCSP_F_D2I_OCSP_NONCE 102 |
367 | # define OCSP_F_OCSP_BASIC_ADD1_STATUS 103 | |
368 | # define OCSP_F_OCSP_BASIC_SIGN 104 | |
369 | # define OCSP_F_OCSP_BASIC_VERIFY 105 | |
370 | # define OCSP_F_OCSP_CERT_ID_NEW 101 | |
371 | # define OCSP_F_OCSP_CHECK_DELEGATED 106 | |
372 | # define OCSP_F_OCSP_CHECK_IDS 107 | |
373 | # define OCSP_F_OCSP_CHECK_ISSUER 108 | |
374 | # define OCSP_F_OCSP_CHECK_VALIDITY 115 | |
375 | # define OCSP_F_OCSP_MATCH_ISSUERID 109 | |
376 | # define OCSP_F_OCSP_PARSE_URL 114 | |
377 | # define OCSP_F_OCSP_REQUEST_SIGN 110 | |
378 | # define OCSP_F_OCSP_REQUEST_VERIFY 116 | |
379 | # define OCSP_F_OCSP_RESPONSE_GET1_BASIC 111 | |
0f113f3e | 380 | # define OCSP_F_PARSE_HTTP_LINE1 118 |
eb64730b RL |
381 | |
382 | /* Reason codes. */ | |
0f113f3e MC |
383 | # define OCSP_R_CERTIFICATE_VERIFY_ERROR 101 |
384 | # define OCSP_R_DIGEST_ERR 102 | |
385 | # define OCSP_R_ERROR_IN_NEXTUPDATE_FIELD 122 | |
386 | # define OCSP_R_ERROR_IN_THISUPDATE_FIELD 123 | |
387 | # define OCSP_R_ERROR_PARSING_URL 121 | |
388 | # define OCSP_R_MISSING_OCSPSIGNING_USAGE 103 | |
389 | # define OCSP_R_NEXTUPDATE_BEFORE_THISUPDATE 124 | |
390 | # define OCSP_R_NOT_BASIC_RESPONSE 104 | |
391 | # define OCSP_R_NO_CERTIFICATES_IN_CHAIN 105 | |
0f113f3e MC |
392 | # define OCSP_R_NO_RESPONSE_DATA 108 |
393 | # define OCSP_R_NO_REVOKED_TIME 109 | |
d32f5d87 | 394 | # define OCSP_R_NO_SIGNER_KEY 130 |
0f113f3e MC |
395 | # define OCSP_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE 110 |
396 | # define OCSP_R_REQUEST_NOT_SIGNED 128 | |
397 | # define OCSP_R_RESPONSE_CONTAINS_NO_REVOCATION_DATA 111 | |
398 | # define OCSP_R_ROOT_CA_NOT_TRUSTED 112 | |
0f113f3e MC |
399 | # define OCSP_R_SERVER_RESPONSE_ERROR 114 |
400 | # define OCSP_R_SERVER_RESPONSE_PARSE_ERROR 115 | |
0f113f3e MC |
401 | # define OCSP_R_SIGNATURE_FAILURE 117 |
402 | # define OCSP_R_SIGNER_CERTIFICATE_NOT_FOUND 118 | |
403 | # define OCSP_R_STATUS_EXPIRED 125 | |
404 | # define OCSP_R_STATUS_NOT_YET_VALID 126 | |
405 | # define OCSP_R_STATUS_TOO_OLD 127 | |
406 | # define OCSP_R_UNKNOWN_MESSAGE_DIGEST 119 | |
407 | # define OCSP_R_UNKNOWN_NID 120 | |
408 | # define OCSP_R_UNSUPPORTED_REQUESTORNAME_TYPE 129 | |
eb64730b | 409 | |
0cd0a820 | 410 | # ifdef __cplusplus |
eb64730b | 411 | } |
0cd0a820 | 412 | # endif |
5951e840 | 413 | # endif |
eb64730b | 414 | #endif |