ocsp.h

Go to the documentation of this file.
00001 /* ocsp.h */
00002 /* Written by Tom Titchener <Tom_Titchener@groove.net> for the OpenSSL
00003  * project. */
00004 
00005 /* History:
00006    This file was transfered to Richard Levitte from CertCo by Kathy
00007    Weinhold in mid-spring 2000 to be included in OpenSSL or released
00008    as a patch kit. */
00009 
00010 /* ====================================================================
00011  * Copyright (c) 1998-2000 The OpenSSL Project.  All rights reserved.
00012  *
00013  * Redistribution and use in source and binary forms, with or without
00014  * modification, are permitted provided that the following conditions
00015  * are met:
00016  *
00017  * 1. Redistributions of source code must retain the above copyright
00018  *    notice, this list of conditions and the following disclaimer.
00019  *
00020  * 2. Redistributions in binary form must reproduce the above copyright
00021  *    notice, this list of conditions and the following disclaimer in
00022  *    the documentation and/or other materials provided with the
00023  *    distribution.
00024  *
00025  * 3. All advertising materials mentioning features or use of this
00026  *    software must display the following acknowledgment:
00027  *    "This product includes software developed by the OpenSSL Project
00028  *    for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
00029  *
00030  * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
00031  *    endorse or promote products derived from this software without
00032  *    prior written permission. For written permission, please contact
00033  *    openssl-core@openssl.org.
00034  *
00035  * 5. Products derived from this software may not be called "OpenSSL"
00036  *    nor may "OpenSSL" appear in their names without prior written
00037  *    permission of the OpenSSL Project.
00038  *
00039  * 6. Redistributions of any form whatsoever must retain the following
00040  *    acknowledgment:
00041  *    "This product includes software developed by the OpenSSL Project
00042  *    for use in the OpenSSL Toolkit (http://www.openssl.org/)"
00043  *
00044  * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
00045  * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00046  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00047  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR
00048  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
00049  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
00050  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
00051  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
00052  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
00053  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
00054  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
00055  * OF THE POSSIBILITY OF SUCH DAMAGE.
00056  * ====================================================================
00057  *
00058  * This product includes cryptographic software written by Eric Young
00059  * (eay@cryptsoft.com).  This product includes software written by Tim
00060  * Hudson (tjh@cryptsoft.com).
00061  *
00062  */
00063 
00064 #ifndef HEADER_OCSP_H
00065 #define HEADER_OCSP_H
00066 
00067 #include <openssl/x509.h>
00068 #include <openssl/x509v3.h>
00069 #include <openssl/safestack.h>
00070 
00071 #ifdef  __cplusplus
00072 extern "C" {
00073 #endif
00074 
00075 /* Various flags and values */
00076 
00077 #define OCSP_DEFAULT_NONCE_LENGTH   16
00078 
00079 #define OCSP_NOCERTS       0x1
00080 #define OCSP_NOINTERN         0x2
00081 #define OCSP_NOSIGS        0x4
00082 #define OCSP_NOCHAIN       0x8
00083 #define OCSP_NOVERIFY         0x10
00084 #define OCSP_NOEXPLICIT       0x20
00085 #define OCSP_NOCASIGN         0x40
00086 #define OCSP_NODELEGATED      0x80
00087 #define OCSP_NOCHECKS         0x100
00088 #define OCSP_TRUSTOTHER       0x200
00089 #define OCSP_RESPID_KEY       0x400
00090 #define OCSP_NOTIME        0x800
00091 
00092 /*   CertID ::= SEQUENCE {
00093  *       hashAlgorithm            AlgorithmIdentifier,
00094  *       issuerNameHash     OCTET STRING, -- Hash of Issuer's DN
00095  *       issuerKeyHash      OCTET STRING, -- Hash of Issuers public key (excluding the tag & length fields)
00096  *       serialNumber       CertificateSerialNumber }
00097  */
00098 typedef struct ocsp_cert_id_st
00099    {
00100    X509_ALGOR *hashAlgorithm;
00101    ASN1_OCTET_STRING *issuerNameHash;
00102    ASN1_OCTET_STRING *issuerKeyHash;
00103    ASN1_INTEGER *serialNumber;
00104    } OCSP_CERTID;
00105 
00106 DECLARE_STACK_OF(OCSP_CERTID)
00107 
00108 /*   Request ::=     SEQUENCE {
00109  *       reqCert                    CertID,
00110  *       singleRequestExtensions    [0] EXPLICIT Extensions OPTIONAL }
00111  */
00112 typedef struct ocsp_one_request_st
00113    {
00114    OCSP_CERTID *reqCert;
00115    STACK_OF(X509_EXTENSION) *singleRequestExtensions;
00116    } OCSP_ONEREQ;
00117 
00118 DECLARE_STACK_OF(OCSP_ONEREQ)
00119 DECLARE_ASN1_SET_OF(OCSP_ONEREQ)
00120 
00121 
00122 /*   TBSRequest      ::=     SEQUENCE {
00123  *       version             [0] EXPLICIT Version DEFAULT v1,
00124  *       requestorName       [1] EXPLICIT GeneralName OPTIONAL,
00125  *       requestList             SEQUENCE OF Request,
00126  *       requestExtensions   [2] EXPLICIT Extensions OPTIONAL }
00127  */
00128 typedef struct ocsp_req_info_st
00129    {
00130    ASN1_INTEGER *version;
00131    GENERAL_NAME *requestorName;
00132    STACK_OF(OCSP_ONEREQ) *requestList;
00133    STACK_OF(X509_EXTENSION) *requestExtensions;
00134    } OCSP_REQINFO;
00135 
00136 /*   Signature       ::=     SEQUENCE {
00137  *       signatureAlgorithm   AlgorithmIdentifier,
00138  *       signature            BIT STRING,
00139  *       certs                [0] EXPLICIT SEQUENCE OF Certificate OPTIONAL }
00140  */
00141 typedef struct ocsp_signature_st
00142    {
00143    X509_ALGOR *signatureAlgorithm;
00144    ASN1_BIT_STRING *signature;
00145    STACK_OF(X509) *certs;
00146    } OCSP_SIGNATURE;
00147 
00148 /*   OCSPRequest     ::=     SEQUENCE {
00149  *       tbsRequest                  TBSRequest,
00150  *       optionalSignature   [0]     EXPLICIT Signature OPTIONAL }
00151  */
00152 typedef struct ocsp_request_st
00153    {
00154    OCSP_REQINFO *tbsRequest;
00155    OCSP_SIGNATURE *optionalSignature; /* OPTIONAL */
00156    } OCSP_REQUEST;
00157 
00158 /*   OCSPResponseStatus ::= ENUMERATED {
00159  *       successful            (0),      --Response has valid confirmations
00160  *       malformedRequest      (1),      --Illegal confirmation request
00161  *       internalError         (2),      --Internal error in issuer
00162  *       tryLater              (3),      --Try again later
00163  *                                       --(4) is not used
00164  *       sigRequired           (5),      --Must sign the request
00165  *       unauthorized          (6)       --Request unauthorized
00166  *   }
00167  */
00168 #define OCSP_RESPONSE_STATUS_SUCCESSFUL          0
00169 #define OCSP_RESPONSE_STATUS_MALFORMEDREQUEST     1
00170 #define OCSP_RESPONSE_STATUS_INTERNALERROR        2
00171 #define OCSP_RESPONSE_STATUS_TRYLATER             3
00172 #define OCSP_RESPONSE_STATUS_SIGREQUIRED          5
00173 #define OCSP_RESPONSE_STATUS_UNAUTHORIZED         6
00174 
00175 /*   ResponseBytes ::=       SEQUENCE {
00176  *       responseType   OBJECT IDENTIFIER,
00177  *       response       OCTET STRING }
00178  */
00179 typedef struct ocsp_resp_bytes_st
00180    {
00181    ASN1_OBJECT *responseType;
00182    ASN1_OCTET_STRING *response;
00183    } OCSP_RESPBYTES;
00184 
00185 /*   OCSPResponse ::= SEQUENCE {
00186  *      responseStatus         OCSPResponseStatus,
00187  *      responseBytes          [0] EXPLICIT ResponseBytes OPTIONAL }
00188  */
00189 typedef struct ocsp_response_st
00190    {
00191    ASN1_ENUMERATED *responseStatus;
00192    OCSP_RESPBYTES  *responseBytes;
00193    } OCSP_RESPONSE;
00194 
00195 /*   ResponderID ::= CHOICE {
00196  *      byName   [1] Name,
00197  *      byKey    [2] KeyHash }
00198  */
00199 #define V_OCSP_RESPID_NAME 0
00200 #define V_OCSP_RESPID_KEY  1
00201 typedef struct ocsp_responder_id_st
00202    {
00203    int type;
00204    union   {
00205       X509_NAME* byName;
00206          ASN1_OCTET_STRING *byKey;
00207       } value;
00208    } OCSP_RESPID;
00209 /*   KeyHash ::= OCTET STRING --SHA-1 hash of responder's public key
00210  *                            --(excluding the tag and length fields)
00211  */
00212 
00213 /*   RevokedInfo ::= SEQUENCE {
00214  *       revocationTime              GeneralizedTime,
00215  *       revocationReason    [0]     EXPLICIT CRLReason OPTIONAL }
00216  */
00217 typedef struct ocsp_revoked_info_st
00218    {
00219    ASN1_GENERALIZEDTIME *revocationTime;
00220    ASN1_ENUMERATED *revocationReason;
00221    } OCSP_REVOKEDINFO;
00222 
00223 /*   CertStatus ::= CHOICE {
00224  *       good                [0]     IMPLICIT NULL,
00225  *       revoked             [1]     IMPLICIT RevokedInfo,
00226  *       unknown             [2]     IMPLICIT UnknownInfo }
00227  */
00228 #define V_OCSP_CERTSTATUS_GOOD    0
00229 #define V_OCSP_CERTSTATUS_REVOKED 1
00230 #define V_OCSP_CERTSTATUS_UNKNOWN 2
00231 typedef struct ocsp_cert_status_st
00232    {
00233    int type;
00234    union {
00235       ASN1_NULL *good;
00236       OCSP_REVOKEDINFO *revoked;
00237       ASN1_NULL *unknown;
00238       } value;
00239    } OCSP_CERTSTATUS;
00240 
00241 /*   SingleResponse ::= SEQUENCE {
00242  *      certID                       CertID,
00243  *      certStatus                   CertStatus,
00244  *      thisUpdate                   GeneralizedTime,
00245  *      nextUpdate           [0]     EXPLICIT GeneralizedTime OPTIONAL,
00246  *      singleExtensions     [1]     EXPLICIT Extensions OPTIONAL }
00247  */
00248 typedef struct ocsp_single_response_st
00249    {
00250    OCSP_CERTID *certId;
00251    OCSP_CERTSTATUS *certStatus;
00252    ASN1_GENERALIZEDTIME *thisUpdate;
00253    ASN1_GENERALIZEDTIME *nextUpdate;
00254    STACK_OF(X509_EXTENSION) *singleExtensions;
00255    } OCSP_SINGLERESP;
00256 
00257 DECLARE_STACK_OF(OCSP_SINGLERESP)
00258 DECLARE_ASN1_SET_OF(OCSP_SINGLERESP)
00259 
00260 /*   ResponseData ::= SEQUENCE {
00261  *      version              [0] EXPLICIT Version DEFAULT v1,
00262  *      responderID              ResponderID,
00263  *      producedAt               GeneralizedTime,
00264  *      responses                SEQUENCE OF SingleResponse,
00265  *      responseExtensions   [1] EXPLICIT Extensions OPTIONAL }
00266  */
00267 typedef struct ocsp_response_data_st
00268    {
00269    ASN1_INTEGER *version;
00270    OCSP_RESPID  *responderId;
00271    ASN1_GENERALIZEDTIME *producedAt;
00272    STACK_OF(OCSP_SINGLERESP) *responses;
00273    STACK_OF(X509_EXTENSION) *responseExtensions;
00274    } OCSP_RESPDATA;
00275 
00276 /*   BasicOCSPResponse       ::= SEQUENCE {
00277  *      tbsResponseData      ResponseData,
00278  *      signatureAlgorithm   AlgorithmIdentifier,
00279  *      signature            BIT STRING,
00280  *      certs                [0] EXPLICIT SEQUENCE OF Certificate OPTIONAL }
00281  */
00282   /* Note 1:
00283      The value for "signature" is specified in the OCSP rfc2560 as follows:
00284      "The value for the signature SHALL be computed on the hash of the DER
00285      encoding ResponseData."  This means that you must hash the DER-encoded
00286      tbsResponseData, and then run it through a crypto-signing function, which
00287      will (at least w/RSA) do a hash-'n'-private-encrypt operation.  This seems
00288      a bit odd, but that's the spec.  Also note that the data structures do not
00289      leave anywhere to independently specify the algorithm used for the initial
00290      hash. So, we look at the signature-specification algorithm, and try to do
00291      something intelligent.   -- Kathy Weinhold, CertCo */
00292   /* Note 2:
00293      It seems that the mentioned passage from RFC 2560 (section 4.2.1) is open
00294      for interpretation.  I've done tests against another responder, and found
00295      that it doesn't do the double hashing that the RFC seems to say one
00296      should.  Therefore, all relevant functions take a flag saying which
00297      variant should be used.  -- Richard Levitte, OpenSSL team and CeloCom */
00298 typedef struct ocsp_basic_response_st
00299    {
00300    OCSP_RESPDATA *tbsResponseData;
00301    X509_ALGOR *signatureAlgorithm;
00302    ASN1_BIT_STRING *signature;
00303    STACK_OF(X509) *certs;
00304    } OCSP_BASICRESP;
00305 
00306 /*
00307  *   CRLReason ::= ENUMERATED {
00308  *        unspecified             (0),
00309  *        keyCompromise           (1),
00310  *        cACompromise            (2),
00311  *        affiliationChanged      (3),
00312  *        superseded              (4),
00313  *        cessationOfOperation    (5),
00314  *        certificateHold         (6),
00315  *        removeFromCRL           (8) }
00316  */
00317 #define OCSP_REVOKED_STATUS_NOSTATUS               -1
00318 #define OCSP_REVOKED_STATUS_UNSPECIFIED             0
00319 #define OCSP_REVOKED_STATUS_KEYCOMPROMISE           1
00320 #define OCSP_REVOKED_STATUS_CACOMPROMISE            2
00321 #define OCSP_REVOKED_STATUS_AFFILIATIONCHANGED      3
00322 #define OCSP_REVOKED_STATUS_SUPERSEDED              4
00323 #define OCSP_REVOKED_STATUS_CESSATIONOFOPERATION    5
00324 #define OCSP_REVOKED_STATUS_CERTIFICATEHOLD         6
00325 #define OCSP_REVOKED_STATUS_REMOVEFROMCRL           8
00326 
00327 /* CrlID ::= SEQUENCE {
00328  *     crlUrl               [0]     EXPLICIT IA5String OPTIONAL,
00329  *     crlNum               [1]     EXPLICIT INTEGER OPTIONAL,
00330  *     crlTime              [2]     EXPLICIT GeneralizedTime OPTIONAL }
00331  */
00332 typedef struct ocsp_crl_id_st
00333         {
00334    ASN1_IA5STRING *crlUrl;
00335    ASN1_INTEGER *crlNum;
00336    ASN1_GENERALIZEDTIME *crlTime;
00337         } OCSP_CRLID;
00338 
00339 /* ServiceLocator ::= SEQUENCE {
00340  *      issuer    Name,
00341  *      locator   AuthorityInfoAccessSyntax OPTIONAL }
00342  */
00343 typedef struct ocsp_service_locator_st
00344         {
00345    X509_NAME* issuer;
00346    STACK_OF(ACCESS_DESCRIPTION) *locator;
00347         } OCSP_SERVICELOC;
00348 
00349 #define PEM_STRING_OCSP_REQUEST  "OCSP REQUEST"
00350 #define PEM_STRING_OCSP_RESPONSE "OCSP RESPONSE"
00351 
00352 #define d2i_OCSP_REQUEST_bio(bp,p) ASN1_d2i_bio_of(OCSP_REQUEST,OCSP_REQUEST_new,d2i_OCSP_REQUEST,bp,p)
00353 
00354 #define d2i_OCSP_RESPONSE_bio(bp,p) ASN1_d2i_bio_of(OCSP_RESPONSE,OCSP_RESPONSE_new,d2i_OCSP_RESPONSE,bp,p)
00355 
00356 #define  PEM_read_bio_OCSP_REQUEST(bp,x,cb) (OCSP_REQUEST *)PEM_ASN1_read_bio( \
00357      (char *(*)())d2i_OCSP_REQUEST,PEM_STRING_OCSP_REQUEST,bp,(char **)x,cb,NULL)
00358 
00359 #define  PEM_read_bio_OCSP_RESPONSE(bp,x,cb)(OCSP_RESPONSE *)PEM_ASN1_read_bio(\
00360      (char *(*)())d2i_OCSP_RESPONSE,PEM_STRING_OCSP_RESPONSE,bp,(char **)x,cb,NULL)
00361 
00362 #define PEM_write_bio_OCSP_REQUEST(bp,o) \
00363     PEM_ASN1_write_bio((int (*)())i2d_OCSP_REQUEST,PEM_STRING_OCSP_REQUEST,\
00364          bp,(char *)o, NULL,NULL,0,NULL,NULL)
00365 
00366 #define PEM_write_bio_OCSP_RESPONSE(bp,o) \
00367     PEM_ASN1_write_bio((int (*)())i2d_OCSP_RESPONSE,PEM_STRING_OCSP_RESPONSE,\
00368          bp,(char *)o, NULL,NULL,0,NULL,NULL)
00369 
00370 #define i2d_OCSP_RESPONSE_bio(bp,o) ASN1_i2d_bio_of(OCSP_RESPONSE,i2d_OCSP_RESPONSE,bp,o)
00371 
00372 #define i2d_OCSP_REQUEST_bio(bp,o) ASN1_i2d_bio_of(OCSP_REQUEST,i2d_OCSP_REQUEST,bp,o)
00373 
00374 #define OCSP_REQUEST_sign(o,pkey,md) \
00375    ASN1_item_sign(ASN1_ITEM_rptr(OCSP_REQINFO),\
00376       o->optionalSignature->signatureAlgorithm,NULL,\
00377            o->optionalSignature->signature,o->tbsRequest,pkey,md)
00378 
00379 #define OCSP_BASICRESP_sign(o,pkey,md,d) \
00380    ASN1_item_sign(ASN1_ITEM_rptr(OCSP_RESPDATA),o->signatureAlgorithm,NULL,\
00381       o->signature,o->tbsResponseData,pkey,md)
00382 
00383 #define OCSP_REQUEST_verify(a,r) ASN1_item_verify(ASN1_ITEM_rptr(OCSP_REQINFO),\
00384         a->optionalSignature->signatureAlgorithm,\
00385    a->optionalSignature->signature,a->tbsRequest,r)
00386 
00387 #define OCSP_BASICRESP_verify(a,r,d) ASN1_item_verify(ASN1_ITEM_rptr(OCSP_RESPDATA),\
00388    a->signatureAlgorithm,a->signature,a->tbsResponseData,r)
00389 
00390 #define ASN1_BIT_STRING_digest(data,type,md,len) \
00391    ASN1_item_digest(ASN1_ITEM_rptr(ASN1_BIT_STRING),type,data,md,len)
00392 
00393 #define OCSP_CERTID_dup(cid) ASN1_dup_of(OCSP_CERTID,i2d_OCSP_CERTID,d2i_OCSP_CERTID,cid)
00394 
00395 #define OCSP_CERTSTATUS_dup(cs)\
00396                 (OCSP_CERTSTATUS*)ASN1_dup((int(*)())i2d_OCSP_CERTSTATUS,\
00397       (char *(*)())d2i_OCSP_CERTSTATUS,(char *)(cs))
00398 
00399 OCSP_RESPONSE *OCSP_sendreq_bio(BIO *b, char *path, OCSP_REQUEST *req);
00400 
00401 OCSP_CERTID *OCSP_cert_to_id(const EVP_MD *dgst, X509 *subject, X509 *issuer);
00402 
00403 OCSP_CERTID *OCSP_cert_id_new(const EVP_MD *dgst,
00404                X509_NAME *issuerName,
00405                ASN1_BIT_STRING* issuerKey,
00406                ASN1_INTEGER *serialNumber);
00407 
00408 OCSP_ONEREQ *OCSP_request_add0_id(OCSP_REQUEST *req, OCSP_CERTID *cid);
00409 
00410 int OCSP_request_add1_nonce(OCSP_REQUEST *req, unsigned char *val, int len);
00411 int OCSP_basic_add1_nonce(OCSP_BASICRESP *resp, unsigned char *val, int len);
00412 int OCSP_check_nonce(OCSP_REQUEST *req, OCSP_BASICRESP *bs);
00413 int OCSP_copy_nonce(OCSP_BASICRESP *resp, OCSP_REQUEST *req);
00414 
00415 int OCSP_request_set1_name(OCSP_REQUEST *req, X509_NAME *nm);
00416 int OCSP_request_add1_cert(OCSP_REQUEST *req, X509 *cert);
00417 
00418 int OCSP_request_sign(OCSP_REQUEST   *req,
00419             X509           *signer,
00420             EVP_PKEY       *key,
00421             const EVP_MD   *dgst,
00422             STACK_OF(X509) *certs,
00423             unsigned long flags);
00424 
00425 int OCSP_response_status(OCSP_RESPONSE *resp);
00426 OCSP_BASICRESP *OCSP_response_get1_basic(OCSP_RESPONSE *resp);
00427 
00428 int OCSP_resp_count(OCSP_BASICRESP *bs);
00429 OCSP_SINGLERESP *OCSP_resp_get0(OCSP_BASICRESP *bs, int idx);
00430 int OCSP_resp_find(OCSP_BASICRESP *bs, OCSP_CERTID *id, int last);
00431 int OCSP_single_get0_status(OCSP_SINGLERESP *single, int *reason,
00432             ASN1_GENERALIZEDTIME **revtime,
00433             ASN1_GENERALIZEDTIME **thisupd,
00434             ASN1_GENERALIZEDTIME **nextupd);
00435 int OCSP_resp_find_status(OCSP_BASICRESP *bs, OCSP_CERTID *id, int *status,
00436             int *reason,
00437             ASN1_GENERALIZEDTIME **revtime,
00438             ASN1_GENERALIZEDTIME **thisupd,
00439             ASN1_GENERALIZEDTIME **nextupd);
00440 int OCSP_check_validity(ASN1_GENERALIZEDTIME *thisupd,
00441          ASN1_GENERALIZEDTIME *nextupd,
00442          long sec, long maxsec);
00443 
00444 int OCSP_request_verify(OCSP_REQUEST *req, STACK_OF(X509) *certs, X509_STORE *store, unsigned long flags);
00445 
00446 int OCSP_parse_url(char *url, char **phost, char **pport, char **ppath, int *pssl);
00447 
00448 int OCSP_id_issuer_cmp(OCSP_CERTID *a, OCSP_CERTID *b);
00449 int OCSP_id_cmp(OCSP_CERTID *a, OCSP_CERTID *b);
00450 
00451 int OCSP_request_onereq_count(OCSP_REQUEST *req);
00452 OCSP_ONEREQ *OCSP_request_onereq_get0(OCSP_REQUEST *req, int i);
00453 OCSP_CERTID *OCSP_onereq_get0_id(OCSP_ONEREQ *one);
00454 int OCSP_id_get0_info(ASN1_OCTET_STRING **piNameHash, ASN1_OBJECT **pmd,
00455          ASN1_OCTET_STRING **pikeyHash,
00456          ASN1_INTEGER **pserial, OCSP_CERTID *cid);
00457 int OCSP_request_is_signed(OCSP_REQUEST *req);
00458 OCSP_RESPONSE *OCSP_response_create(int status, OCSP_BASICRESP *bs);
00459 OCSP_SINGLERESP *OCSP_basic_add1_status(OCSP_BASICRESP *rsp,
00460                   OCSP_CERTID *cid,
00461                   int status, int reason,
00462                   ASN1_TIME *revtime,
00463                ASN1_TIME *thisupd, ASN1_TIME *nextupd);
00464 int OCSP_basic_add1_cert(OCSP_BASICRESP *resp, X509 *cert);
00465 int OCSP_basic_sign(OCSP_BASICRESP *brsp,
00466          X509 *signer, EVP_PKEY *key, const EVP_MD *dgst,
00467          STACK_OF(X509) *certs, unsigned long flags);
00468 
00469 ASN1_STRING *ASN1_STRING_encode(ASN1_STRING *s, i2d_of_void *i2d,
00470             void *data, STACK_OF(ASN1_OBJECT) *sk);
00471 #define ASN1_STRING_encode_of(type,s,i2d,data,sk) \
00472 ((ASN1_STRING *(*)(ASN1_STRING *,I2D_OF(type),type *,STACK_OF(ASN1_OBJECT) *))openssl_fcast(ASN1_STRING_encode))(s,i2d,data,sk)
00473 
00474 X509_EXTENSION *OCSP_crlID_new(char *url, long *n, char *tim);
00475 
00476 X509_EXTENSION *OCSP_accept_responses_new(char **oids);
00477 
00478 X509_EXTENSION *OCSP_archive_cutoff_new(char* tim);
00479 
00480 X509_EXTENSION *OCSP_url_svcloc_new(X509_NAME* issuer, char **urls);
00481 
00482 int OCSP_REQUEST_get_ext_count(OCSP_REQUEST *x);
00483 int OCSP_REQUEST_get_ext_by_NID(OCSP_REQUEST *x, int nid, int lastpos);
00484 int OCSP_REQUEST_get_ext_by_OBJ(OCSP_REQUEST *x, ASN1_OBJECT *obj, int lastpos);
00485 int OCSP_REQUEST_get_ext_by_critical(OCSP_REQUEST *x, int crit, int lastpos);
00486 X509_EXTENSION *OCSP_REQUEST_get_ext(OCSP_REQUEST *x, int loc);
00487 X509_EXTENSION *OCSP_REQUEST_delete_ext(OCSP_REQUEST *x, int loc);
00488 void *OCSP_REQUEST_get1_ext_d2i(OCSP_REQUEST *x, int nid, int *crit, int *idx);
00489 int OCSP_REQUEST_add1_ext_i2d(OCSP_REQUEST *x, int nid, void *value, int crit,
00490                      unsigned long flags);
00491 int OCSP_REQUEST_add_ext(OCSP_REQUEST *x, X509_EXTENSION *ex, int loc);
00492 
00493 int OCSP_ONEREQ_get_ext_count(OCSP_ONEREQ *x);
00494 int OCSP_ONEREQ_get_ext_by_NID(OCSP_ONEREQ *x, int nid, int lastpos);
00495 int OCSP_ONEREQ_get_ext_by_OBJ(OCSP_ONEREQ *x, ASN1_OBJECT *obj, int lastpos);
00496 int OCSP_ONEREQ_get_ext_by_critical(OCSP_ONEREQ *x, int crit, int lastpos);
00497 X509_EXTENSION *OCSP_ONEREQ_get_ext(OCSP_ONEREQ *x, int loc);
00498 X509_EXTENSION *OCSP_ONEREQ_delete_ext(OCSP_ONEREQ *x, int loc);
00499 void *OCSP_ONEREQ_get1_ext_d2i(OCSP_ONEREQ *x, int nid, int *crit, int *idx);
00500 int OCSP_ONEREQ_add1_ext_i2d(OCSP_ONEREQ *x, int nid, void *value, int crit,
00501                      unsigned long flags);
00502 int OCSP_ONEREQ_add_ext(OCSP_ONEREQ *x, X509_EXTENSION *ex, int loc);
00503 
00504 int OCSP_BASICRESP_get_ext_count(OCSP_BASICRESP *x);
00505 int OCSP_BASICRESP_get_ext_by_NID(OCSP_BASICRESP *x, int nid, int lastpos);
00506 int OCSP_BASICRESP_get_ext_by_OBJ(OCSP_BASICRESP *x, ASN1_OBJECT *obj, int lastpos);
00507 int OCSP_BASICRESP_get_ext_by_critical(OCSP_BASICRESP *x, int crit, int lastpos);
00508 X509_EXTENSION *OCSP_BASICRESP_get_ext(OCSP_BASICRESP *x, int loc);
00509 X509_EXTENSION *OCSP_BASICRESP_delete_ext(OCSP_BASICRESP *x, int loc);
00510 void *OCSP_BASICRESP_get1_ext_d2i(OCSP_BASICRESP *x, int nid, int *crit, int *idx);
00511 int OCSP_BASICRESP_add1_ext_i2d(OCSP_BASICRESP *x, int nid, void *value, int crit,
00512                      unsigned long flags);
00513 int OCSP_BASICRESP_add_ext(OCSP_BASICRESP *x, X509_EXTENSION *ex, int loc);
00514 
00515 int OCSP_SINGLERESP_get_ext_count(OCSP_SINGLERESP *x);
00516 int OCSP_SINGLERESP_get_ext_by_NID(OCSP_SINGLERESP *x, int nid, int lastpos);
00517 int OCSP_SINGLERESP_get_ext_by_OBJ(OCSP_SINGLERESP *x, ASN1_OBJECT *obj, int lastpos);
00518 int OCSP_SINGLERESP_get_ext_by_critical(OCSP_SINGLERESP *x, int crit, int lastpos);
00519 X509_EXTENSION *OCSP_SINGLERESP_get_ext(OCSP_SINGLERESP *x, int loc);
00520 X509_EXTENSION *OCSP_SINGLERESP_delete_ext(OCSP_SINGLERESP *x, int loc);
00521 void *OCSP_SINGLERESP_get1_ext_d2i(OCSP_SINGLERESP *x, int nid, int *crit, int *idx);
00522 int OCSP_SINGLERESP_add1_ext_i2d(OCSP_SINGLERESP *x, int nid, void *value, int crit,
00523                      unsigned long flags);
00524 int OCSP_SINGLERESP_add_ext(OCSP_SINGLERESP *x, X509_EXTENSION *ex, int loc);
00525 
00526 DECLARE_ASN1_FUNCTIONS(OCSP_SINGLERESP)
00527 DECLARE_ASN1_FUNCTIONS(OCSP_CERTSTATUS)
00528 DECLARE_ASN1_FUNCTIONS(OCSP_REVOKEDINFO)
00529 DECLARE_ASN1_FUNCTIONS(OCSP_BASICRESP)
00530 DECLARE_ASN1_FUNCTIONS(OCSP_RESPDATA)
00531 DECLARE_ASN1_FUNCTIONS(OCSP_RESPID)
00532 DECLARE_ASN1_FUNCTIONS(OCSP_RESPONSE)
00533 DECLARE_ASN1_FUNCTIONS(OCSP_RESPBYTES)
00534 DECLARE_ASN1_FUNCTIONS(OCSP_ONEREQ)
00535 DECLARE_ASN1_FUNCTIONS(OCSP_CERTID)
00536 DECLARE_ASN1_FUNCTIONS(OCSP_REQUEST)
00537 DECLARE_ASN1_FUNCTIONS(OCSP_SIGNATURE)
00538 DECLARE_ASN1_FUNCTIONS(OCSP_REQINFO)
00539 DECLARE_ASN1_FUNCTIONS(OCSP_CRLID)
00540 DECLARE_ASN1_FUNCTIONS(OCSP_SERVICELOC)
00541 
00542 char *OCSP_response_status_str(long s);
00543 char *OCSP_cert_status_str(long s);
00544 char *OCSP_crl_reason_str(long s);
00545 
00546 int OCSP_REQUEST_print(BIO *bp, OCSP_REQUEST* a, unsigned long flags);
00547 int OCSP_RESPONSE_print(BIO *bp, OCSP_RESPONSE* o, unsigned long flags);
00548 
00549 int OCSP_basic_verify(OCSP_BASICRESP *bs, STACK_OF(X509) *certs,
00550             X509_STORE *st, unsigned long flags);
00551 
00552 /* BEGIN ERROR CODES */
00553 /* The following lines are auto generated by the script mkerr.pl. Any changes
00554  * made after this point may be overwritten when the script is next run.
00555  */
00556 void ERR_load_OCSP_strings(void);
00557 
00558 /* Error codes for the OCSP functions. */
00559 
00560 /* Function codes. */
00561 #define OCSP_F_ASN1_STRING_ENCODE          100
00562 #define OCSP_F_D2I_OCSP_NONCE           102
00563 #define OCSP_F_OCSP_BASIC_ADD1_STATUS         103
00564 #define OCSP_F_OCSP_BASIC_SIGN             104
00565 #define OCSP_F_OCSP_BASIC_VERIFY        105
00566 #define OCSP_F_OCSP_CERT_ID_NEW            101
00567 #define OCSP_F_OCSP_CHECK_DELEGATED        106
00568 #define OCSP_F_OCSP_CHECK_IDS           107
00569 #define OCSP_F_OCSP_CHECK_ISSUER        108
00570 #define OCSP_F_OCSP_CHECK_VALIDITY         115
00571 #define OCSP_F_OCSP_MATCH_ISSUERID         109
00572 #define OCSP_F_OCSP_PARSE_URL           114
00573 #define OCSP_F_OCSP_REQUEST_SIGN        110
00574 #define OCSP_F_OCSP_REQUEST_VERIFY         116
00575 #define OCSP_F_OCSP_RESPONSE_GET1_BASIC          111
00576 #define OCSP_F_OCSP_SENDREQ_BIO            112
00577 #define OCSP_F_REQUEST_VERIFY           113
00578 
00579 /* Reason codes. */
00580 #define OCSP_R_BAD_DATA              100
00581 #define OCSP_R_CERTIFICATE_VERIFY_ERROR          101
00582 #define OCSP_R_DIGEST_ERR            102
00583 #define OCSP_R_ERROR_IN_NEXTUPDATE_FIELD      122
00584 #define OCSP_R_ERROR_IN_THISUPDATE_FIELD      123
00585 #define OCSP_R_ERROR_PARSING_URL        121
00586 #define OCSP_R_MISSING_OCSPSIGNING_USAGE      103
00587 #define OCSP_R_NEXTUPDATE_BEFORE_THISUPDATE      124
00588 #define OCSP_R_NOT_BASIC_RESPONSE          104
00589 #define OCSP_R_NO_CERTIFICATES_IN_CHAIN          105
00590 #define OCSP_R_NO_CONTENT            106
00591 #define OCSP_R_NO_PUBLIC_KEY            107
00592 #define OCSP_R_NO_RESPONSE_DATA            108
00593 #define OCSP_R_NO_REVOKED_TIME             109
00594 #define OCSP_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE  110
00595 #define OCSP_R_REQUEST_NOT_SIGNED          128
00596 #define OCSP_R_RESPONSE_CONTAINS_NO_REVOCATION_DATA    111
00597 #define OCSP_R_ROOT_CA_NOT_TRUSTED         112
00598 #define OCSP_R_SERVER_READ_ERROR        113
00599 #define OCSP_R_SERVER_RESPONSE_ERROR          114
00600 #define OCSP_R_SERVER_RESPONSE_PARSE_ERROR       115
00601 #define OCSP_R_SERVER_WRITE_ERROR          116
00602 #define OCSP_R_SIGNATURE_FAILURE        117
00603 #define OCSP_R_SIGNER_CERTIFICATE_NOT_FOUND      118
00604 #define OCSP_R_STATUS_EXPIRED           125
00605 #define OCSP_R_STATUS_NOT_YET_VALID        126
00606 #define OCSP_R_STATUS_TOO_OLD           127
00607 #define OCSP_R_UNKNOWN_MESSAGE_DIGEST         119
00608 #define OCSP_R_UNKNOWN_NID           120
00609 #define OCSP_R_UNSUPPORTED_REQUESTORNAME_TYPE       129
00610 
00611 #ifdef  __cplusplus
00612 }
00613 #endif
00614 #endif

Generated on Thu Aug 20 22:33:05 2009 for OpenXDAS by  doxygen 1.5.6