source: lab.git/Dev/utvpn/utvpn-unix-v101-7101-public/src/Mayaqua/openssl/ocsp.h @ a1bae3e

trunk
Last change on this file since a1bae3e was a1bae3e, checked in by mitty <mitty@…>, 12 years ago
  • copy vendor drop to trunk

git-svn-id: https://lab.mitty.jp/svn/lab/trunk@147 7d2118f6-f56c-43e7-95a2-4bb3031d96e7

  • Property mode set to 100644
File size: 23.9 KB
Line 
1/* ocsp.h */
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/x509.h>
68#include <openssl/x509v3.h>
69#include <openssl/safestack.h>
70
71#ifdef  __cplusplus
72extern "C" {
73#endif
74
75/* Various flags and values */
76
77#define OCSP_DEFAULT_NONCE_LENGTH   16
78
79#define OCSP_NOCERTS            0x1
80#define OCSP_NOINTERN           0x2
81#define OCSP_NOSIGS         0x4
82#define OCSP_NOCHAIN            0x8
83#define OCSP_NOVERIFY           0x10
84#define OCSP_NOEXPLICIT         0x20
85#define OCSP_NOCASIGN           0x40
86#define OCSP_NODELEGATED        0x80
87#define OCSP_NOCHECKS           0x100
88#define OCSP_TRUSTOTHER         0x200
89#define OCSP_RESPID_KEY         0x400
90#define OCSP_NOTIME         0x800
91
92/*   CertID ::= SEQUENCE {
93 *       hashAlgorithm            AlgorithmIdentifier,
94 *       issuerNameHash     OCTET STRING, -- Hash of Issuer's DN
95 *       issuerKeyHash      OCTET STRING, -- Hash of Issuers public key (excluding the tag & length fields)
96 *       serialNumber       CertificateSerialNumber }
97 */
98typedef struct ocsp_cert_id_st
99    {
100    X509_ALGOR *hashAlgorithm;
101    ASN1_OCTET_STRING *issuerNameHash;
102    ASN1_OCTET_STRING *issuerKeyHash;
103    ASN1_INTEGER *serialNumber;
104    } OCSP_CERTID;
105
106DECLARE_STACK_OF(OCSP_CERTID)
107
108/*   Request ::=     SEQUENCE {
109 *       reqCert                    CertID,
110 *       singleRequestExtensions    [0] EXPLICIT Extensions OPTIONAL }
111 */
112typedef struct ocsp_one_request_st
113    {
114    OCSP_CERTID *reqCert;
115    STACK_OF(X509_EXTENSION) *singleRequestExtensions;
116    } OCSP_ONEREQ;
117
118DECLARE_STACK_OF(OCSP_ONEREQ)
119DECLARE_ASN1_SET_OF(OCSP_ONEREQ)
120
121
122/*   TBSRequest      ::=     SEQUENCE {
123 *       version             [0] EXPLICIT Version DEFAULT v1,
124 *       requestorName       [1] EXPLICIT GeneralName OPTIONAL,
125 *       requestList             SEQUENCE OF Request,
126 *       requestExtensions   [2] EXPLICIT Extensions OPTIONAL }
127 */
128typedef struct ocsp_req_info_st
129    {
130    ASN1_INTEGER *version;
131    GENERAL_NAME *requestorName;
132    STACK_OF(OCSP_ONEREQ) *requestList;
133    STACK_OF(X509_EXTENSION) *requestExtensions;
134    } OCSP_REQINFO;
135
136/*   Signature       ::=     SEQUENCE {
137 *       signatureAlgorithm   AlgorithmIdentifier,
138 *       signature            BIT STRING,
139 *       certs                [0] EXPLICIT SEQUENCE OF Certificate OPTIONAL }
140 */
141typedef struct ocsp_signature_st
142    {
143    X509_ALGOR *signatureAlgorithm;
144    ASN1_BIT_STRING *signature;
145    STACK_OF(X509) *certs;
146    } OCSP_SIGNATURE;
147
148/*   OCSPRequest     ::=     SEQUENCE {
149 *       tbsRequest                  TBSRequest,
150 *       optionalSignature   [0]     EXPLICIT Signature OPTIONAL }
151 */
152typedef struct ocsp_request_st
153    {
154    OCSP_REQINFO *tbsRequest;
155    OCSP_SIGNATURE *optionalSignature; /* OPTIONAL */
156    } OCSP_REQUEST;
157
158/*   OCSPResponseStatus ::= ENUMERATED {
159 *       successful            (0),      --Response has valid confirmations
160 *       malformedRequest      (1),      --Illegal confirmation request
161 *       internalError         (2),      --Internal error in issuer
162 *       tryLater              (3),      --Try again later
163 *                                       --(4) is not used
164 *       sigRequired           (5),      --Must sign the request
165 *       unauthorized          (6)       --Request unauthorized
166 *   }
167 */
168#define OCSP_RESPONSE_STATUS_SUCCESSFUL          0
169#define OCSP_RESPONSE_STATUS_MALFORMEDREQUEST     1
170#define OCSP_RESPONSE_STATUS_INTERNALERROR        2
171#define OCSP_RESPONSE_STATUS_TRYLATER             3
172#define OCSP_RESPONSE_STATUS_SIGREQUIRED          5
173#define OCSP_RESPONSE_STATUS_UNAUTHORIZED         6
174
175/*   ResponseBytes ::=       SEQUENCE {
176 *       responseType   OBJECT IDENTIFIER,
177 *       response       OCTET STRING }
178 */
179typedef struct ocsp_resp_bytes_st
180    {
181    ASN1_OBJECT *responseType;
182    ASN1_OCTET_STRING *response;
183    } OCSP_RESPBYTES;
184
185/*   OCSPResponse ::= SEQUENCE {
186 *      responseStatus         OCSPResponseStatus,
187 *      responseBytes          [0] EXPLICIT ResponseBytes OPTIONAL }
188 */
189typedef struct ocsp_response_st
190    {
191    ASN1_ENUMERATED *responseStatus;
192    OCSP_RESPBYTES  *responseBytes;
193    } OCSP_RESPONSE;
194
195/*   ResponderID ::= CHOICE {
196 *      byName   [1] Name,
197 *      byKey    [2] KeyHash }
198 */
199#define V_OCSP_RESPID_NAME 0
200#define V_OCSP_RESPID_KEY  1
201typedef struct ocsp_responder_id_st
202    {
203    int type;
204    union   {
205        X509_NAME* byName;
206            ASN1_OCTET_STRING *byKey;
207        } value;
208    } OCSP_RESPID;
209/*   KeyHash ::= OCTET STRING --SHA-1 hash of responder's public key
210 *                            --(excluding the tag and length fields)
211 */
212
213/*   RevokedInfo ::= SEQUENCE {
214 *       revocationTime              GeneralizedTime,
215 *       revocationReason    [0]     EXPLICIT CRLReason OPTIONAL }
216 */
217typedef struct ocsp_revoked_info_st
218    {
219    ASN1_GENERALIZEDTIME *revocationTime;
220    ASN1_ENUMERATED *revocationReason;
221    } OCSP_REVOKEDINFO;
222
223/*   CertStatus ::= CHOICE {
224 *       good                [0]     IMPLICIT NULL,
225 *       revoked             [1]     IMPLICIT RevokedInfo,
226 *       unknown             [2]     IMPLICIT UnknownInfo }
227 */
228#define V_OCSP_CERTSTATUS_GOOD    0
229#define V_OCSP_CERTSTATUS_REVOKED 1
230#define V_OCSP_CERTSTATUS_UNKNOWN 2
231typedef struct ocsp_cert_status_st
232    {
233    int type;
234    union   {
235        ASN1_NULL *good;
236        OCSP_REVOKEDINFO *revoked;
237        ASN1_NULL *unknown;
238        } value;
239    } OCSP_CERTSTATUS;
240
241/*   SingleResponse ::= SEQUENCE {
242 *      certID                       CertID,
243 *      certStatus                   CertStatus,
244 *      thisUpdate                   GeneralizedTime,
245 *      nextUpdate           [0]     EXPLICIT GeneralizedTime OPTIONAL,
246 *      singleExtensions     [1]     EXPLICIT Extensions OPTIONAL }
247 */
248typedef struct ocsp_single_response_st
249    {
250    OCSP_CERTID *certId;
251    OCSP_CERTSTATUS *certStatus;
252    ASN1_GENERALIZEDTIME *thisUpdate;
253    ASN1_GENERALIZEDTIME *nextUpdate;
254    STACK_OF(X509_EXTENSION) *singleExtensions;
255    } OCSP_SINGLERESP;
256
257DECLARE_STACK_OF(OCSP_SINGLERESP)
258DECLARE_ASN1_SET_OF(OCSP_SINGLERESP)
259
260/*   ResponseData ::= SEQUENCE {
261 *      version              [0] EXPLICIT Version DEFAULT v1,
262 *      responderID              ResponderID,
263 *      producedAt               GeneralizedTime,
264 *      responses                SEQUENCE OF SingleResponse,
265 *      responseExtensions   [1] EXPLICIT Extensions OPTIONAL }
266 */
267typedef struct ocsp_response_data_st
268    {
269    ASN1_INTEGER *version;
270    OCSP_RESPID  *responderId;
271    ASN1_GENERALIZEDTIME *producedAt;
272    STACK_OF(OCSP_SINGLERESP) *responses;
273    STACK_OF(X509_EXTENSION) *responseExtensions;
274    } OCSP_RESPDATA;
275
276/*   BasicOCSPResponse       ::= SEQUENCE {
277 *      tbsResponseData      ResponseData,
278 *      signatureAlgorithm   AlgorithmIdentifier,
279 *      signature            BIT STRING,
280 *      certs                [0] EXPLICIT SEQUENCE OF Certificate OPTIONAL }
281 */
282  /* Note 1:
283     The value for "signature" is specified in the OCSP rfc2560 as follows:
284     "The value for the signature SHALL be computed on the hash of the DER
285     encoding ResponseData."  This means that you must hash the DER-encoded
286     tbsResponseData, and then run it through a crypto-signing function, which
287     will (at least w/RSA) do a hash-'n'-private-encrypt operation.  This seems
288     a bit odd, but that's the spec.  Also note that the data structures do not
289     leave anywhere to independently specify the algorithm used for the initial
290     hash. So, we look at the signature-specification algorithm, and try to do
291     something intelligent. -- Kathy Weinhold, CertCo */
292  /* Note 2:
293     It seems that the mentioned passage from RFC 2560 (section 4.2.1) is open
294     for interpretation.  I've done tests against another responder, and found
295     that it doesn't do the double hashing that the RFC seems to say one
296     should.  Therefore, all relevant functions take a flag saying which
297     variant should be used.    -- Richard Levitte, OpenSSL team and CeloCom */
298typedef struct ocsp_basic_response_st
299    {
300    OCSP_RESPDATA *tbsResponseData;
301    X509_ALGOR *signatureAlgorithm;
302    ASN1_BIT_STRING *signature;
303    STACK_OF(X509) *certs;
304    } OCSP_BASICRESP;
305
306/*
307 *   CRLReason ::= ENUMERATED {
308 *        unspecified             (0),
309 *        keyCompromise           (1),
310 *        cACompromise            (2),
311 *        affiliationChanged      (3),
312 *        superseded              (4),
313 *        cessationOfOperation    (5),
314 *        certificateHold         (6),
315 *        removeFromCRL           (8) }
316 */
317#define OCSP_REVOKED_STATUS_NOSTATUS               -1
318#define OCSP_REVOKED_STATUS_UNSPECIFIED             0
319#define OCSP_REVOKED_STATUS_KEYCOMPROMISE           1
320#define OCSP_REVOKED_STATUS_CACOMPROMISE            2
321#define OCSP_REVOKED_STATUS_AFFILIATIONCHANGED      3
322#define OCSP_REVOKED_STATUS_SUPERSEDED              4
323#define OCSP_REVOKED_STATUS_CESSATIONOFOPERATION    5
324#define OCSP_REVOKED_STATUS_CERTIFICATEHOLD         6
325#define OCSP_REVOKED_STATUS_REMOVEFROMCRL           8
326
327/* CrlID ::= SEQUENCE {
328 *     crlUrl               [0]     EXPLICIT IA5String OPTIONAL,
329 *     crlNum               [1]     EXPLICIT INTEGER OPTIONAL,
330 *     crlTime              [2]     EXPLICIT GeneralizedTime OPTIONAL }
331 */
332typedef struct ocsp_crl_id_st
333        {
334    ASN1_IA5STRING *crlUrl;
335    ASN1_INTEGER *crlNum;
336    ASN1_GENERALIZEDTIME *crlTime;
337        } OCSP_CRLID;
338
339/* ServiceLocator ::= SEQUENCE {
340 *      issuer    Name,
341 *      locator   AuthorityInfoAccessSyntax OPTIONAL }
342 */
343typedef struct ocsp_service_locator_st
344        {
345    X509_NAME* issuer;
346    STACK_OF(ACCESS_DESCRIPTION) *locator;
347        } OCSP_SERVICELOC;
348 
349#define PEM_STRING_OCSP_REQUEST "OCSP REQUEST"
350#define PEM_STRING_OCSP_RESPONSE "OCSP RESPONSE"
351
352#define d2i_OCSP_REQUEST_bio(bp,p) ASN1_d2i_bio_of(OCSP_REQUEST,OCSP_REQUEST_new,d2i_OCSP_REQUEST,bp,p)
353
354#define d2i_OCSP_RESPONSE_bio(bp,p) ASN1_d2i_bio_of(OCSP_RESPONSE,OCSP_RESPONSE_new,d2i_OCSP_RESPONSE,bp,p)
355
356#define PEM_read_bio_OCSP_REQUEST(bp,x,cb) (OCSP_REQUEST *)PEM_ASN1_read_bio( \
357     (char *(*)())d2i_OCSP_REQUEST,PEM_STRING_OCSP_REQUEST,bp,(char **)x,cb,NULL)
358
359#define PEM_read_bio_OCSP_RESPONSE(bp,x,cb)(OCSP_RESPONSE *)PEM_ASN1_read_bio(\
360     (char *(*)())d2i_OCSP_RESPONSE,PEM_STRING_OCSP_RESPONSE,bp,(char **)x,cb,NULL)
361
362#define PEM_write_bio_OCSP_REQUEST(bp,o) \
363    PEM_ASN1_write_bio((int (*)())i2d_OCSP_REQUEST,PEM_STRING_OCSP_REQUEST,\
364            bp,(char *)o, NULL,NULL,0,NULL,NULL)
365
366#define PEM_write_bio_OCSP_RESPONSE(bp,o) \
367    PEM_ASN1_write_bio((int (*)())i2d_OCSP_RESPONSE,PEM_STRING_OCSP_RESPONSE,\
368            bp,(char *)o, NULL,NULL,0,NULL,NULL)
369
370#define i2d_OCSP_RESPONSE_bio(bp,o) ASN1_i2d_bio_of(OCSP_RESPONSE,i2d_OCSP_RESPONSE,bp,o)
371
372#define i2d_OCSP_REQUEST_bio(bp,o) ASN1_i2d_bio_of(OCSP_REQUEST,i2d_OCSP_REQUEST,bp,o)
373
374#define OCSP_REQUEST_sign(o,pkey,md) \
375    ASN1_item_sign(ASN1_ITEM_rptr(OCSP_REQINFO),\
376        o->optionalSignature->signatureAlgorithm,NULL,\
377            o->optionalSignature->signature,o->tbsRequest,pkey,md)
378
379#define OCSP_BASICRESP_sign(o,pkey,md,d) \
380    ASN1_item_sign(ASN1_ITEM_rptr(OCSP_RESPDATA),o->signatureAlgorithm,NULL,\
381        o->signature,o->tbsResponseData,pkey,md)
382
383#define OCSP_REQUEST_verify(a,r) ASN1_item_verify(ASN1_ITEM_rptr(OCSP_REQINFO),\
384        a->optionalSignature->signatureAlgorithm,\
385    a->optionalSignature->signature,a->tbsRequest,r)
386
387#define OCSP_BASICRESP_verify(a,r,d) ASN1_item_verify(ASN1_ITEM_rptr(OCSP_RESPDATA),\
388    a->signatureAlgorithm,a->signature,a->tbsResponseData,r)
389
390#define ASN1_BIT_STRING_digest(data,type,md,len) \
391    ASN1_item_digest(ASN1_ITEM_rptr(ASN1_BIT_STRING),type,data,md,len)
392
393#define OCSP_CERTID_dup(cid) ASN1_dup_of(OCSP_CERTID,i2d_OCSP_CERTID,d2i_OCSP_CERTID,cid)
394
395#define OCSP_CERTSTATUS_dup(cs)\
396                (OCSP_CERTSTATUS*)ASN1_dup((int(*)())i2d_OCSP_CERTSTATUS,\
397        (char *(*)())d2i_OCSP_CERTSTATUS,(char *)(cs))
398
399OCSP_RESPONSE *OCSP_sendreq_bio(BIO *b, char *path, OCSP_REQUEST *req);
400
401OCSP_CERTID *OCSP_cert_to_id(const EVP_MD *dgst, X509 *subject, X509 *issuer);
402
403OCSP_CERTID *OCSP_cert_id_new(const EVP_MD *dgst, 
404                  X509_NAME *issuerName, 
405                  ASN1_BIT_STRING* issuerKey, 
406                  ASN1_INTEGER *serialNumber);
407
408OCSP_ONEREQ *OCSP_request_add0_id(OCSP_REQUEST *req, OCSP_CERTID *cid);
409
410int OCSP_request_add1_nonce(OCSP_REQUEST *req, unsigned char *val, int len);
411int OCSP_basic_add1_nonce(OCSP_BASICRESP *resp, unsigned char *val, int len);
412int OCSP_check_nonce(OCSP_REQUEST *req, OCSP_BASICRESP *bs);
413int OCSP_copy_nonce(OCSP_BASICRESP *resp, OCSP_REQUEST *req);
414
415int OCSP_request_set1_name(OCSP_REQUEST *req, X509_NAME *nm);
416int OCSP_request_add1_cert(OCSP_REQUEST *req, X509 *cert);
417
418int OCSP_request_sign(OCSP_REQUEST   *req,
419              X509           *signer,
420              EVP_PKEY       *key,
421              const EVP_MD   *dgst,
422              STACK_OF(X509) *certs,
423              unsigned long flags);
424
425int OCSP_response_status(OCSP_RESPONSE *resp);
426OCSP_BASICRESP *OCSP_response_get1_basic(OCSP_RESPONSE *resp);
427
428int OCSP_resp_count(OCSP_BASICRESP *bs);
429OCSP_SINGLERESP *OCSP_resp_get0(OCSP_BASICRESP *bs, int idx);
430int OCSP_resp_find(OCSP_BASICRESP *bs, OCSP_CERTID *id, int last);
431int OCSP_single_get0_status(OCSP_SINGLERESP *single, int *reason,
432                ASN1_GENERALIZEDTIME **revtime,
433                ASN1_GENERALIZEDTIME **thisupd,
434                ASN1_GENERALIZEDTIME **nextupd);
435int OCSP_resp_find_status(OCSP_BASICRESP *bs, OCSP_CERTID *id, int *status,
436                int *reason,
437                ASN1_GENERALIZEDTIME **revtime,
438                ASN1_GENERALIZEDTIME **thisupd,
439                ASN1_GENERALIZEDTIME **nextupd);
440int OCSP_check_validity(ASN1_GENERALIZEDTIME *thisupd,
441            ASN1_GENERALIZEDTIME *nextupd,
442            long sec, long maxsec);
443
444int OCSP_request_verify(OCSP_REQUEST *req, STACK_OF(X509) *certs, X509_STORE *store, unsigned long flags);
445
446int OCSP_parse_url(char *url, char **phost, char **pport, char **ppath, int *pssl);
447
448int OCSP_id_issuer_cmp(OCSP_CERTID *a, OCSP_CERTID *b);
449int OCSP_id_cmp(OCSP_CERTID *a, OCSP_CERTID *b);
450
451int OCSP_request_onereq_count(OCSP_REQUEST *req);
452OCSP_ONEREQ *OCSP_request_onereq_get0(OCSP_REQUEST *req, int i);
453OCSP_CERTID *OCSP_onereq_get0_id(OCSP_ONEREQ *one);
454int OCSP_id_get0_info(ASN1_OCTET_STRING **piNameHash, ASN1_OBJECT **pmd,
455            ASN1_OCTET_STRING **pikeyHash,
456            ASN1_INTEGER **pserial, OCSP_CERTID *cid);
457int OCSP_request_is_signed(OCSP_REQUEST *req);
458OCSP_RESPONSE *OCSP_response_create(int status, OCSP_BASICRESP *bs);
459OCSP_SINGLERESP *OCSP_basic_add1_status(OCSP_BASICRESP *rsp,
460                        OCSP_CERTID *cid,
461                        int status, int reason,
462                        ASN1_TIME *revtime,
463                    ASN1_TIME *thisupd, ASN1_TIME *nextupd);
464int OCSP_basic_add1_cert(OCSP_BASICRESP *resp, X509 *cert);
465int OCSP_basic_sign(OCSP_BASICRESP *brsp, 
466            X509 *signer, EVP_PKEY *key, const EVP_MD *dgst,
467            STACK_OF(X509) *certs, unsigned long flags);
468
469ASN1_STRING *ASN1_STRING_encode(ASN1_STRING *s, i2d_of_void *i2d,
470                void *data, STACK_OF(ASN1_OBJECT) *sk);
471#define ASN1_STRING_encode_of(type,s,i2d,data,sk) \
472((ASN1_STRING *(*)(ASN1_STRING *,I2D_OF(type),type *,STACK_OF(ASN1_OBJECT) *))openssl_fcast(ASN1_STRING_encode))(s,i2d,data,sk)
473
474X509_EXTENSION *OCSP_crlID_new(char *url, long *n, char *tim);
475
476X509_EXTENSION *OCSP_accept_responses_new(char **oids);
477
478X509_EXTENSION *OCSP_archive_cutoff_new(char* tim);
479
480X509_EXTENSION *OCSP_url_svcloc_new(X509_NAME* issuer, char **urls);
481
482int OCSP_REQUEST_get_ext_count(OCSP_REQUEST *x);
483int OCSP_REQUEST_get_ext_by_NID(OCSP_REQUEST *x, int nid, int lastpos);
484int OCSP_REQUEST_get_ext_by_OBJ(OCSP_REQUEST *x, ASN1_OBJECT *obj, int lastpos);
485int OCSP_REQUEST_get_ext_by_critical(OCSP_REQUEST *x, int crit, int lastpos);
486X509_EXTENSION *OCSP_REQUEST_get_ext(OCSP_REQUEST *x, int loc);
487X509_EXTENSION *OCSP_REQUEST_delete_ext(OCSP_REQUEST *x, int loc);
488void *OCSP_REQUEST_get1_ext_d2i(OCSP_REQUEST *x, int nid, int *crit, int *idx);
489int OCSP_REQUEST_add1_ext_i2d(OCSP_REQUEST *x, int nid, void *value, int crit,
490                            unsigned long flags);
491int OCSP_REQUEST_add_ext(OCSP_REQUEST *x, X509_EXTENSION *ex, int loc);
492
493int OCSP_ONEREQ_get_ext_count(OCSP_ONEREQ *x);
494int OCSP_ONEREQ_get_ext_by_NID(OCSP_ONEREQ *x, int nid, int lastpos);
495int OCSP_ONEREQ_get_ext_by_OBJ(OCSP_ONEREQ *x, ASN1_OBJECT *obj, int lastpos);
496int OCSP_ONEREQ_get_ext_by_critical(OCSP_ONEREQ *x, int crit, int lastpos);
497X509_EXTENSION *OCSP_ONEREQ_get_ext(OCSP_ONEREQ *x, int loc);
498X509_EXTENSION *OCSP_ONEREQ_delete_ext(OCSP_ONEREQ *x, int loc);
499void *OCSP_ONEREQ_get1_ext_d2i(OCSP_ONEREQ *x, int nid, int *crit, int *idx);
500int OCSP_ONEREQ_add1_ext_i2d(OCSP_ONEREQ *x, int nid, void *value, int crit,
501                            unsigned long flags);
502int OCSP_ONEREQ_add_ext(OCSP_ONEREQ *x, X509_EXTENSION *ex, int loc);
503
504int OCSP_BASICRESP_get_ext_count(OCSP_BASICRESP *x);
505int OCSP_BASICRESP_get_ext_by_NID(OCSP_BASICRESP *x, int nid, int lastpos);
506int OCSP_BASICRESP_get_ext_by_OBJ(OCSP_BASICRESP *x, ASN1_OBJECT *obj, int lastpos);
507int OCSP_BASICRESP_get_ext_by_critical(OCSP_BASICRESP *x, int crit, int lastpos);
508X509_EXTENSION *OCSP_BASICRESP_get_ext(OCSP_BASICRESP *x, int loc);
509X509_EXTENSION *OCSP_BASICRESP_delete_ext(OCSP_BASICRESP *x, int loc);
510void *OCSP_BASICRESP_get1_ext_d2i(OCSP_BASICRESP *x, int nid, int *crit, int *idx);
511int OCSP_BASICRESP_add1_ext_i2d(OCSP_BASICRESP *x, int nid, void *value, int crit,
512                            unsigned long flags);
513int OCSP_BASICRESP_add_ext(OCSP_BASICRESP *x, X509_EXTENSION *ex, int loc);
514
515int OCSP_SINGLERESP_get_ext_count(OCSP_SINGLERESP *x);
516int OCSP_SINGLERESP_get_ext_by_NID(OCSP_SINGLERESP *x, int nid, int lastpos);
517int OCSP_SINGLERESP_get_ext_by_OBJ(OCSP_SINGLERESP *x, ASN1_OBJECT *obj, int lastpos);
518int OCSP_SINGLERESP_get_ext_by_critical(OCSP_SINGLERESP *x, int crit, int lastpos);
519X509_EXTENSION *OCSP_SINGLERESP_get_ext(OCSP_SINGLERESP *x, int loc);
520X509_EXTENSION *OCSP_SINGLERESP_delete_ext(OCSP_SINGLERESP *x, int loc);
521void *OCSP_SINGLERESP_get1_ext_d2i(OCSP_SINGLERESP *x, int nid, int *crit, int *idx);
522int OCSP_SINGLERESP_add1_ext_i2d(OCSP_SINGLERESP *x, int nid, void *value, int crit,
523                            unsigned long flags);
524int OCSP_SINGLERESP_add_ext(OCSP_SINGLERESP *x, X509_EXTENSION *ex, int loc);
525
526DECLARE_ASN1_FUNCTIONS(OCSP_SINGLERESP)
527DECLARE_ASN1_FUNCTIONS(OCSP_CERTSTATUS)
528DECLARE_ASN1_FUNCTIONS(OCSP_REVOKEDINFO)
529DECLARE_ASN1_FUNCTIONS(OCSP_BASICRESP)
530DECLARE_ASN1_FUNCTIONS(OCSP_RESPDATA)
531DECLARE_ASN1_FUNCTIONS(OCSP_RESPID)
532DECLARE_ASN1_FUNCTIONS(OCSP_RESPONSE)
533DECLARE_ASN1_FUNCTIONS(OCSP_RESPBYTES)
534DECLARE_ASN1_FUNCTIONS(OCSP_ONEREQ)
535DECLARE_ASN1_FUNCTIONS(OCSP_CERTID)
536DECLARE_ASN1_FUNCTIONS(OCSP_REQUEST)
537DECLARE_ASN1_FUNCTIONS(OCSP_SIGNATURE)
538DECLARE_ASN1_FUNCTIONS(OCSP_REQINFO)
539DECLARE_ASN1_FUNCTIONS(OCSP_CRLID)
540DECLARE_ASN1_FUNCTIONS(OCSP_SERVICELOC)
541
542char *OCSP_response_status_str(long s);
543char *OCSP_cert_status_str(long s);
544char *OCSP_crl_reason_str(long s);
545
546int OCSP_REQUEST_print(BIO *bp, OCSP_REQUEST* a, unsigned long flags);
547int OCSP_RESPONSE_print(BIO *bp, OCSP_RESPONSE* o, unsigned long flags);
548
549int OCSP_basic_verify(OCSP_BASICRESP *bs, STACK_OF(X509) *certs,
550                X509_STORE *st, unsigned long flags);
551
552/* BEGIN ERROR CODES */
553/* The following lines are auto generated by the script mkerr.pl. Any changes
554 * made after this point may be overwritten when the script is next run.
555 */
556void ERR_load_OCSP_strings(void);
557
558/* Error codes for the OCSP functions. */
559
560/* Function codes. */
561#define OCSP_F_ASN1_STRING_ENCODE            100
562#define OCSP_F_D2I_OCSP_NONCE                102
563#define OCSP_F_OCSP_BASIC_ADD1_STATUS            103
564#define OCSP_F_OCSP_BASIC_SIGN               104
565#define OCSP_F_OCSP_BASIC_VERIFY             105
566#define OCSP_F_OCSP_CERT_ID_NEW              101
567#define OCSP_F_OCSP_CHECK_DELEGATED          106
568#define OCSP_F_OCSP_CHECK_IDS                107
569#define OCSP_F_OCSP_CHECK_ISSUER             108
570#define OCSP_F_OCSP_CHECK_VALIDITY           115
571#define OCSP_F_OCSP_MATCH_ISSUERID           109
572#define OCSP_F_OCSP_PARSE_URL                114
573#define OCSP_F_OCSP_REQUEST_SIGN             110
574#define OCSP_F_OCSP_REQUEST_VERIFY           116
575#define OCSP_F_OCSP_RESPONSE_GET1_BASIC          111
576#define OCSP_F_OCSP_SENDREQ_BIO              112
577#define OCSP_F_REQUEST_VERIFY                113
578
579/* Reason codes. */
580#define OCSP_R_BAD_DATA                  100
581#define OCSP_R_CERTIFICATE_VERIFY_ERROR          101
582#define OCSP_R_DIGEST_ERR                102
583#define OCSP_R_ERROR_IN_NEXTUPDATE_FIELD         122
584#define OCSP_R_ERROR_IN_THISUPDATE_FIELD         123
585#define OCSP_R_ERROR_PARSING_URL             121
586#define OCSP_R_MISSING_OCSPSIGNING_USAGE         103
587#define OCSP_R_NEXTUPDATE_BEFORE_THISUPDATE      124
588#define OCSP_R_NOT_BASIC_RESPONSE            104
589#define OCSP_R_NO_CERTIFICATES_IN_CHAIN          105
590#define OCSP_R_NO_CONTENT                106
591#define OCSP_R_NO_PUBLIC_KEY                 107
592#define OCSP_R_NO_RESPONSE_DATA              108
593#define OCSP_R_NO_REVOKED_TIME               109
594#define OCSP_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE    110
595#define OCSP_R_REQUEST_NOT_SIGNED            128
596#define OCSP_R_RESPONSE_CONTAINS_NO_REVOCATION_DATA  111
597#define OCSP_R_ROOT_CA_NOT_TRUSTED           112
598#define OCSP_R_SERVER_READ_ERROR             113
599#define OCSP_R_SERVER_RESPONSE_ERROR             114
600#define OCSP_R_SERVER_RESPONSE_PARSE_ERROR       115
601#define OCSP_R_SERVER_WRITE_ERROR            116
602#define OCSP_R_SIGNATURE_FAILURE             117
603#define OCSP_R_SIGNER_CERTIFICATE_NOT_FOUND      118
604#define OCSP_R_STATUS_EXPIRED                125
605#define OCSP_R_STATUS_NOT_YET_VALID          126
606#define OCSP_R_STATUS_TOO_OLD                127
607#define OCSP_R_UNKNOWN_MESSAGE_DIGEST            119
608#define OCSP_R_UNKNOWN_NID               120
609#define OCSP_R_UNSUPPORTED_REQUESTORNAME_TYPE        129
610
611#ifdef  __cplusplus
612}
613#endif
614#endif
Note: See TracBrowser for help on using the repository browser.