xref: /onnv-gate/usr/src/common/openssl/crypto/ocsp/ocsp.h (revision 2139:6243c3338933)
10Sstevel@tonic-gate /* ocsp.h */
20Sstevel@tonic-gate /* Written by Tom Titchener <Tom_Titchener@groove.net> for the OpenSSL
30Sstevel@tonic-gate  * project. */
40Sstevel@tonic-gate 
50Sstevel@tonic-gate /* History:
60Sstevel@tonic-gate    This file was transfered to Richard Levitte from CertCo by Kathy
70Sstevel@tonic-gate    Weinhold in mid-spring 2000 to be included in OpenSSL or released
80Sstevel@tonic-gate    as a patch kit. */
90Sstevel@tonic-gate 
100Sstevel@tonic-gate /* ====================================================================
110Sstevel@tonic-gate  * Copyright (c) 1998-2000 The OpenSSL Project.  All rights reserved.
120Sstevel@tonic-gate  *
130Sstevel@tonic-gate  * Redistribution and use in source and binary forms, with or without
140Sstevel@tonic-gate  * modification, are permitted provided that the following conditions
150Sstevel@tonic-gate  * are met:
160Sstevel@tonic-gate  *
170Sstevel@tonic-gate  * 1. Redistributions of source code must retain the above copyright
180Sstevel@tonic-gate  *    notice, this list of conditions and the following disclaimer.
190Sstevel@tonic-gate  *
200Sstevel@tonic-gate  * 2. Redistributions in binary form must reproduce the above copyright
210Sstevel@tonic-gate  *    notice, this list of conditions and the following disclaimer in
220Sstevel@tonic-gate  *    the documentation and/or other materials provided with the
230Sstevel@tonic-gate  *    distribution.
240Sstevel@tonic-gate  *
250Sstevel@tonic-gate  * 3. All advertising materials mentioning features or use of this
260Sstevel@tonic-gate  *    software must display the following acknowledgment:
270Sstevel@tonic-gate  *    "This product includes software developed by the OpenSSL Project
280Sstevel@tonic-gate  *    for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
290Sstevel@tonic-gate  *
300Sstevel@tonic-gate  * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
310Sstevel@tonic-gate  *    endorse or promote products derived from this software without
320Sstevel@tonic-gate  *    prior written permission. For written permission, please contact
330Sstevel@tonic-gate  *    openssl-core@openssl.org.
340Sstevel@tonic-gate  *
350Sstevel@tonic-gate  * 5. Products derived from this software may not be called "OpenSSL"
360Sstevel@tonic-gate  *    nor may "OpenSSL" appear in their names without prior written
370Sstevel@tonic-gate  *    permission of the OpenSSL Project.
380Sstevel@tonic-gate  *
390Sstevel@tonic-gate  * 6. Redistributions of any form whatsoever must retain the following
400Sstevel@tonic-gate  *    acknowledgment:
410Sstevel@tonic-gate  *    "This product includes software developed by the OpenSSL Project
420Sstevel@tonic-gate  *    for use in the OpenSSL Toolkit (http://www.openssl.org/)"
430Sstevel@tonic-gate  *
440Sstevel@tonic-gate  * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
450Sstevel@tonic-gate  * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
460Sstevel@tonic-gate  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
470Sstevel@tonic-gate  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR
480Sstevel@tonic-gate  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
490Sstevel@tonic-gate  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
500Sstevel@tonic-gate  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
510Sstevel@tonic-gate  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
520Sstevel@tonic-gate  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
530Sstevel@tonic-gate  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
540Sstevel@tonic-gate  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
550Sstevel@tonic-gate  * OF THE POSSIBILITY OF SUCH DAMAGE.
560Sstevel@tonic-gate  * ====================================================================
570Sstevel@tonic-gate  *
580Sstevel@tonic-gate  * This product includes cryptographic software written by Eric Young
590Sstevel@tonic-gate  * (eay@cryptsoft.com).  This product includes software written by Tim
600Sstevel@tonic-gate  * Hudson (tjh@cryptsoft.com).
610Sstevel@tonic-gate  *
620Sstevel@tonic-gate  */
630Sstevel@tonic-gate 
640Sstevel@tonic-gate #ifndef HEADER_OCSP_H
650Sstevel@tonic-gate #define HEADER_OCSP_H
660Sstevel@tonic-gate 
670Sstevel@tonic-gate #include <openssl/x509.h>
680Sstevel@tonic-gate #include <openssl/x509v3.h>
690Sstevel@tonic-gate #include <openssl/safestack.h>
700Sstevel@tonic-gate 
710Sstevel@tonic-gate #ifdef  __cplusplus
720Sstevel@tonic-gate extern "C" {
730Sstevel@tonic-gate #endif
740Sstevel@tonic-gate 
750Sstevel@tonic-gate /* Various flags and values */
760Sstevel@tonic-gate 
770Sstevel@tonic-gate #define OCSP_DEFAULT_NONCE_LENGTH	16
780Sstevel@tonic-gate 
790Sstevel@tonic-gate #define OCSP_NOCERTS			0x1
800Sstevel@tonic-gate #define OCSP_NOINTERN			0x2
810Sstevel@tonic-gate #define OCSP_NOSIGS			0x4
820Sstevel@tonic-gate #define OCSP_NOCHAIN			0x8
830Sstevel@tonic-gate #define OCSP_NOVERIFY			0x10
840Sstevel@tonic-gate #define OCSP_NOEXPLICIT			0x20
850Sstevel@tonic-gate #define OCSP_NOCASIGN			0x40
860Sstevel@tonic-gate #define OCSP_NODELEGATED		0x80
870Sstevel@tonic-gate #define OCSP_NOCHECKS			0x100
880Sstevel@tonic-gate #define OCSP_TRUSTOTHER			0x200
890Sstevel@tonic-gate #define OCSP_RESPID_KEY			0x400
900Sstevel@tonic-gate #define OCSP_NOTIME			0x800
910Sstevel@tonic-gate 
920Sstevel@tonic-gate /*   CertID ::= SEQUENCE {
930Sstevel@tonic-gate  *       hashAlgorithm            AlgorithmIdentifier,
940Sstevel@tonic-gate  *       issuerNameHash     OCTET STRING, -- Hash of Issuer's DN
950Sstevel@tonic-gate  *       issuerKeyHash      OCTET STRING, -- Hash of Issuers public key (excluding the tag & length fields)
960Sstevel@tonic-gate  *       serialNumber       CertificateSerialNumber }
970Sstevel@tonic-gate  */
980Sstevel@tonic-gate typedef struct ocsp_cert_id_st
990Sstevel@tonic-gate 	{
1000Sstevel@tonic-gate 	X509_ALGOR *hashAlgorithm;
1010Sstevel@tonic-gate 	ASN1_OCTET_STRING *issuerNameHash;
1020Sstevel@tonic-gate 	ASN1_OCTET_STRING *issuerKeyHash;
1030Sstevel@tonic-gate 	ASN1_INTEGER *serialNumber;
1040Sstevel@tonic-gate 	} OCSP_CERTID;
1050Sstevel@tonic-gate 
1060Sstevel@tonic-gate DECLARE_STACK_OF(OCSP_CERTID)
1070Sstevel@tonic-gate 
1080Sstevel@tonic-gate /*   Request ::=     SEQUENCE {
1090Sstevel@tonic-gate  *       reqCert                    CertID,
1100Sstevel@tonic-gate  *       singleRequestExtensions    [0] EXPLICIT Extensions OPTIONAL }
1110Sstevel@tonic-gate  */
1120Sstevel@tonic-gate typedef struct ocsp_one_request_st
1130Sstevel@tonic-gate 	{
1140Sstevel@tonic-gate 	OCSP_CERTID *reqCert;
1150Sstevel@tonic-gate 	STACK_OF(X509_EXTENSION) *singleRequestExtensions;
1160Sstevel@tonic-gate 	} OCSP_ONEREQ;
1170Sstevel@tonic-gate 
1180Sstevel@tonic-gate DECLARE_STACK_OF(OCSP_ONEREQ)
1190Sstevel@tonic-gate DECLARE_ASN1_SET_OF(OCSP_ONEREQ)
1200Sstevel@tonic-gate 
1210Sstevel@tonic-gate 
1220Sstevel@tonic-gate /*   TBSRequest      ::=     SEQUENCE {
1230Sstevel@tonic-gate  *       version             [0] EXPLICIT Version DEFAULT v1,
1240Sstevel@tonic-gate  *       requestorName       [1] EXPLICIT GeneralName OPTIONAL,
1250Sstevel@tonic-gate  *       requestList             SEQUENCE OF Request,
1260Sstevel@tonic-gate  *       requestExtensions   [2] EXPLICIT Extensions OPTIONAL }
1270Sstevel@tonic-gate  */
1280Sstevel@tonic-gate typedef struct ocsp_req_info_st
1290Sstevel@tonic-gate 	{
1300Sstevel@tonic-gate 	ASN1_INTEGER *version;
1310Sstevel@tonic-gate 	GENERAL_NAME *requestorName;
1320Sstevel@tonic-gate 	STACK_OF(OCSP_ONEREQ) *requestList;
1330Sstevel@tonic-gate 	STACK_OF(X509_EXTENSION) *requestExtensions;
1340Sstevel@tonic-gate 	} OCSP_REQINFO;
1350Sstevel@tonic-gate 
1360Sstevel@tonic-gate /*   Signature       ::=     SEQUENCE {
1370Sstevel@tonic-gate  *       signatureAlgorithm   AlgorithmIdentifier,
1380Sstevel@tonic-gate  *       signature            BIT STRING,
1390Sstevel@tonic-gate  *       certs                [0] EXPLICIT SEQUENCE OF Certificate OPTIONAL }
1400Sstevel@tonic-gate  */
1410Sstevel@tonic-gate typedef struct ocsp_signature_st
1420Sstevel@tonic-gate 	{
1430Sstevel@tonic-gate 	X509_ALGOR *signatureAlgorithm;
1440Sstevel@tonic-gate 	ASN1_BIT_STRING *signature;
1450Sstevel@tonic-gate 	STACK_OF(X509) *certs;
1460Sstevel@tonic-gate 	} OCSP_SIGNATURE;
1470Sstevel@tonic-gate 
1480Sstevel@tonic-gate /*   OCSPRequest     ::=     SEQUENCE {
1490Sstevel@tonic-gate  *       tbsRequest                  TBSRequest,
1500Sstevel@tonic-gate  *       optionalSignature   [0]     EXPLICIT Signature OPTIONAL }
1510Sstevel@tonic-gate  */
1520Sstevel@tonic-gate typedef struct ocsp_request_st
1530Sstevel@tonic-gate 	{
1540Sstevel@tonic-gate 	OCSP_REQINFO *tbsRequest;
1550Sstevel@tonic-gate 	OCSP_SIGNATURE *optionalSignature; /* OPTIONAL */
1560Sstevel@tonic-gate 	} OCSP_REQUEST;
1570Sstevel@tonic-gate 
1580Sstevel@tonic-gate /*   OCSPResponseStatus ::= ENUMERATED {
1590Sstevel@tonic-gate  *       successful            (0),      --Response has valid confirmations
1600Sstevel@tonic-gate  *       malformedRequest      (1),      --Illegal confirmation request
1610Sstevel@tonic-gate  *       internalError         (2),      --Internal error in issuer
1620Sstevel@tonic-gate  *       tryLater              (3),      --Try again later
1630Sstevel@tonic-gate  *                                       --(4) is not used
1640Sstevel@tonic-gate  *       sigRequired           (5),      --Must sign the request
1650Sstevel@tonic-gate  *       unauthorized          (6)       --Request unauthorized
1660Sstevel@tonic-gate  *   }
1670Sstevel@tonic-gate  */
1680Sstevel@tonic-gate #define OCSP_RESPONSE_STATUS_SUCCESSFUL          0
1690Sstevel@tonic-gate #define OCSP_RESPONSE_STATUS_MALFORMEDREQUEST     1
1700Sstevel@tonic-gate #define OCSP_RESPONSE_STATUS_INTERNALERROR        2
1710Sstevel@tonic-gate #define OCSP_RESPONSE_STATUS_TRYLATER             3
1720Sstevel@tonic-gate #define OCSP_RESPONSE_STATUS_SIGREQUIRED          5
1730Sstevel@tonic-gate #define OCSP_RESPONSE_STATUS_UNAUTHORIZED         6
1740Sstevel@tonic-gate 
1750Sstevel@tonic-gate /*   ResponseBytes ::=       SEQUENCE {
1760Sstevel@tonic-gate  *       responseType   OBJECT IDENTIFIER,
1770Sstevel@tonic-gate  *       response       OCTET STRING }
1780Sstevel@tonic-gate  */
1790Sstevel@tonic-gate typedef struct ocsp_resp_bytes_st
1800Sstevel@tonic-gate 	{
1810Sstevel@tonic-gate 	ASN1_OBJECT *responseType;
1820Sstevel@tonic-gate 	ASN1_OCTET_STRING *response;
1830Sstevel@tonic-gate 	} OCSP_RESPBYTES;
1840Sstevel@tonic-gate 
1850Sstevel@tonic-gate /*   OCSPResponse ::= SEQUENCE {
1860Sstevel@tonic-gate  *      responseStatus         OCSPResponseStatus,
1870Sstevel@tonic-gate  *      responseBytes          [0] EXPLICIT ResponseBytes OPTIONAL }
1880Sstevel@tonic-gate  */
1890Sstevel@tonic-gate typedef struct ocsp_response_st
1900Sstevel@tonic-gate 	{
1910Sstevel@tonic-gate 	ASN1_ENUMERATED *responseStatus;
1920Sstevel@tonic-gate 	OCSP_RESPBYTES  *responseBytes;
1930Sstevel@tonic-gate 	} OCSP_RESPONSE;
1940Sstevel@tonic-gate 
1950Sstevel@tonic-gate /*   ResponderID ::= CHOICE {
1960Sstevel@tonic-gate  *      byName   [1] Name,
1970Sstevel@tonic-gate  *      byKey    [2] KeyHash }
1980Sstevel@tonic-gate  */
1990Sstevel@tonic-gate #define V_OCSP_RESPID_NAME 0
2000Sstevel@tonic-gate #define V_OCSP_RESPID_KEY  1
2010Sstevel@tonic-gate typedef struct ocsp_responder_id_st
2020Sstevel@tonic-gate 	{
2030Sstevel@tonic-gate 	int type;
2040Sstevel@tonic-gate 	union   {
2050Sstevel@tonic-gate 		X509_NAME* byName;
2060Sstevel@tonic-gate         	ASN1_OCTET_STRING *byKey;
2070Sstevel@tonic-gate 		} value;
2080Sstevel@tonic-gate 	} OCSP_RESPID;
2090Sstevel@tonic-gate /*   KeyHash ::= OCTET STRING --SHA-1 hash of responder's public key
2100Sstevel@tonic-gate  *                            --(excluding the tag and length fields)
2110Sstevel@tonic-gate  */
2120Sstevel@tonic-gate 
2130Sstevel@tonic-gate /*   RevokedInfo ::= SEQUENCE {
2140Sstevel@tonic-gate  *       revocationTime              GeneralizedTime,
2150Sstevel@tonic-gate  *       revocationReason    [0]     EXPLICIT CRLReason OPTIONAL }
2160Sstevel@tonic-gate  */
2170Sstevel@tonic-gate typedef struct ocsp_revoked_info_st
2180Sstevel@tonic-gate 	{
2190Sstevel@tonic-gate 	ASN1_GENERALIZEDTIME *revocationTime;
2200Sstevel@tonic-gate 	ASN1_ENUMERATED *revocationReason;
2210Sstevel@tonic-gate 	} OCSP_REVOKEDINFO;
2220Sstevel@tonic-gate 
2230Sstevel@tonic-gate /*   CertStatus ::= CHOICE {
2240Sstevel@tonic-gate  *       good                [0]     IMPLICIT NULL,
2250Sstevel@tonic-gate  *       revoked             [1]     IMPLICIT RevokedInfo,
2260Sstevel@tonic-gate  *       unknown             [2]     IMPLICIT UnknownInfo }
2270Sstevel@tonic-gate  */
2280Sstevel@tonic-gate #define V_OCSP_CERTSTATUS_GOOD    0
2290Sstevel@tonic-gate #define V_OCSP_CERTSTATUS_REVOKED 1
2300Sstevel@tonic-gate #define V_OCSP_CERTSTATUS_UNKNOWN 2
2310Sstevel@tonic-gate typedef struct ocsp_cert_status_st
2320Sstevel@tonic-gate 	{
2330Sstevel@tonic-gate 	int type;
2340Sstevel@tonic-gate 	union	{
2350Sstevel@tonic-gate 		ASN1_NULL *good;
2360Sstevel@tonic-gate 		OCSP_REVOKEDINFO *revoked;
2370Sstevel@tonic-gate 		ASN1_NULL *unknown;
2380Sstevel@tonic-gate 		} value;
2390Sstevel@tonic-gate 	} OCSP_CERTSTATUS;
2400Sstevel@tonic-gate 
2410Sstevel@tonic-gate /*   SingleResponse ::= SEQUENCE {
2420Sstevel@tonic-gate  *      certID                       CertID,
2430Sstevel@tonic-gate  *      certStatus                   CertStatus,
2440Sstevel@tonic-gate  *      thisUpdate                   GeneralizedTime,
2450Sstevel@tonic-gate  *      nextUpdate           [0]     EXPLICIT GeneralizedTime OPTIONAL,
2460Sstevel@tonic-gate  *      singleExtensions     [1]     EXPLICIT Extensions OPTIONAL }
2470Sstevel@tonic-gate  */
2480Sstevel@tonic-gate typedef struct ocsp_single_response_st
2490Sstevel@tonic-gate 	{
2500Sstevel@tonic-gate 	OCSP_CERTID *certId;
2510Sstevel@tonic-gate 	OCSP_CERTSTATUS *certStatus;
2520Sstevel@tonic-gate 	ASN1_GENERALIZEDTIME *thisUpdate;
2530Sstevel@tonic-gate 	ASN1_GENERALIZEDTIME *nextUpdate;
2540Sstevel@tonic-gate 	STACK_OF(X509_EXTENSION) *singleExtensions;
2550Sstevel@tonic-gate 	} OCSP_SINGLERESP;
2560Sstevel@tonic-gate 
2570Sstevel@tonic-gate DECLARE_STACK_OF(OCSP_SINGLERESP)
2580Sstevel@tonic-gate DECLARE_ASN1_SET_OF(OCSP_SINGLERESP)
2590Sstevel@tonic-gate 
2600Sstevel@tonic-gate /*   ResponseData ::= SEQUENCE {
2610Sstevel@tonic-gate  *      version              [0] EXPLICIT Version DEFAULT v1,
2620Sstevel@tonic-gate  *      responderID              ResponderID,
2630Sstevel@tonic-gate  *      producedAt               GeneralizedTime,
2640Sstevel@tonic-gate  *      responses                SEQUENCE OF SingleResponse,
2650Sstevel@tonic-gate  *      responseExtensions   [1] EXPLICIT Extensions OPTIONAL }
2660Sstevel@tonic-gate  */
2670Sstevel@tonic-gate typedef struct ocsp_response_data_st
2680Sstevel@tonic-gate 	{
2690Sstevel@tonic-gate 	ASN1_INTEGER *version;
2700Sstevel@tonic-gate 	OCSP_RESPID  *responderId;
2710Sstevel@tonic-gate 	ASN1_GENERALIZEDTIME *producedAt;
2720Sstevel@tonic-gate 	STACK_OF(OCSP_SINGLERESP) *responses;
2730Sstevel@tonic-gate 	STACK_OF(X509_EXTENSION) *responseExtensions;
2740Sstevel@tonic-gate 	} OCSP_RESPDATA;
2750Sstevel@tonic-gate 
2760Sstevel@tonic-gate /*   BasicOCSPResponse       ::= SEQUENCE {
2770Sstevel@tonic-gate  *      tbsResponseData      ResponseData,
2780Sstevel@tonic-gate  *      signatureAlgorithm   AlgorithmIdentifier,
2790Sstevel@tonic-gate  *      signature            BIT STRING,
2800Sstevel@tonic-gate  *      certs                [0] EXPLICIT SEQUENCE OF Certificate OPTIONAL }
2810Sstevel@tonic-gate  */
2820Sstevel@tonic-gate   /* Note 1:
2830Sstevel@tonic-gate      The value for "signature" is specified in the OCSP rfc2560 as follows:
2840Sstevel@tonic-gate      "The value for the signature SHALL be computed on the hash of the DER
2850Sstevel@tonic-gate      encoding ResponseData."  This means that you must hash the DER-encoded
2860Sstevel@tonic-gate      tbsResponseData, and then run it through a crypto-signing function, which
2870Sstevel@tonic-gate      will (at least w/RSA) do a hash-'n'-private-encrypt operation.  This seems
2880Sstevel@tonic-gate      a bit odd, but that's the spec.  Also note that the data structures do not
2890Sstevel@tonic-gate      leave anywhere to independently specify the algorithm used for the initial
2900Sstevel@tonic-gate      hash. So, we look at the signature-specification algorithm, and try to do
2910Sstevel@tonic-gate      something intelligent.	-- Kathy Weinhold, CertCo */
2920Sstevel@tonic-gate   /* Note 2:
2930Sstevel@tonic-gate      It seems that the mentioned passage from RFC 2560 (section 4.2.1) is open
2940Sstevel@tonic-gate      for interpretation.  I've done tests against another responder, and found
2950Sstevel@tonic-gate      that it doesn't do the double hashing that the RFC seems to say one
2960Sstevel@tonic-gate      should.  Therefore, all relevant functions take a flag saying which
2970Sstevel@tonic-gate      variant should be used.	-- Richard Levitte, OpenSSL team and CeloCom */
2980Sstevel@tonic-gate typedef struct ocsp_basic_response_st
2990Sstevel@tonic-gate 	{
3000Sstevel@tonic-gate 	OCSP_RESPDATA *tbsResponseData;
3010Sstevel@tonic-gate 	X509_ALGOR *signatureAlgorithm;
3020Sstevel@tonic-gate 	ASN1_BIT_STRING *signature;
3030Sstevel@tonic-gate 	STACK_OF(X509) *certs;
3040Sstevel@tonic-gate 	} OCSP_BASICRESP;
3050Sstevel@tonic-gate 
3060Sstevel@tonic-gate /*
3070Sstevel@tonic-gate  *   CRLReason ::= ENUMERATED {
3080Sstevel@tonic-gate  *        unspecified             (0),
3090Sstevel@tonic-gate  *        keyCompromise           (1),
3100Sstevel@tonic-gate  *        cACompromise            (2),
3110Sstevel@tonic-gate  *        affiliationChanged      (3),
3120Sstevel@tonic-gate  *        superseded              (4),
3130Sstevel@tonic-gate  *        cessationOfOperation    (5),
3140Sstevel@tonic-gate  *        certificateHold         (6),
3150Sstevel@tonic-gate  *        removeFromCRL           (8) }
3160Sstevel@tonic-gate  */
3170Sstevel@tonic-gate #define OCSP_REVOKED_STATUS_NOSTATUS               -1
3180Sstevel@tonic-gate #define OCSP_REVOKED_STATUS_UNSPECIFIED             0
3190Sstevel@tonic-gate #define OCSP_REVOKED_STATUS_KEYCOMPROMISE           1
3200Sstevel@tonic-gate #define OCSP_REVOKED_STATUS_CACOMPROMISE            2
3210Sstevel@tonic-gate #define OCSP_REVOKED_STATUS_AFFILIATIONCHANGED      3
3220Sstevel@tonic-gate #define OCSP_REVOKED_STATUS_SUPERSEDED              4
3230Sstevel@tonic-gate #define OCSP_REVOKED_STATUS_CESSATIONOFOPERATION    5
3240Sstevel@tonic-gate #define OCSP_REVOKED_STATUS_CERTIFICATEHOLD         6
3250Sstevel@tonic-gate #define OCSP_REVOKED_STATUS_REMOVEFROMCRL           8
3260Sstevel@tonic-gate 
3270Sstevel@tonic-gate /* CrlID ::= SEQUENCE {
3280Sstevel@tonic-gate  *     crlUrl               [0]     EXPLICIT IA5String OPTIONAL,
3290Sstevel@tonic-gate  *     crlNum               [1]     EXPLICIT INTEGER OPTIONAL,
3300Sstevel@tonic-gate  *     crlTime              [2]     EXPLICIT GeneralizedTime OPTIONAL }
3310Sstevel@tonic-gate  */
3320Sstevel@tonic-gate typedef struct ocsp_crl_id_st
3330Sstevel@tonic-gate         {
3340Sstevel@tonic-gate 	ASN1_IA5STRING *crlUrl;
3350Sstevel@tonic-gate 	ASN1_INTEGER *crlNum;
3360Sstevel@tonic-gate 	ASN1_GENERALIZEDTIME *crlTime;
3370Sstevel@tonic-gate         } OCSP_CRLID;
3380Sstevel@tonic-gate 
3390Sstevel@tonic-gate /* ServiceLocator ::= SEQUENCE {
3400Sstevel@tonic-gate  *      issuer    Name,
3410Sstevel@tonic-gate  *      locator   AuthorityInfoAccessSyntax OPTIONAL }
3420Sstevel@tonic-gate  */
3430Sstevel@tonic-gate typedef struct ocsp_service_locator_st
3440Sstevel@tonic-gate         {
3450Sstevel@tonic-gate 	X509_NAME* issuer;
3460Sstevel@tonic-gate 	STACK_OF(ACCESS_DESCRIPTION) *locator;
3470Sstevel@tonic-gate         } OCSP_SERVICELOC;
3480Sstevel@tonic-gate 
3490Sstevel@tonic-gate #define PEM_STRING_OCSP_REQUEST	"OCSP REQUEST"
3500Sstevel@tonic-gate #define PEM_STRING_OCSP_RESPONSE "OCSP RESPONSE"
3510Sstevel@tonic-gate 
352*2139Sjp161948 #define d2i_OCSP_REQUEST_bio(bp,p) ASN1_d2i_bio_of(OCSP_REQUEST,OCSP_REQUEST_new,d2i_OCSP_REQUEST,bp,p)
3530Sstevel@tonic-gate 
354*2139Sjp161948 #define d2i_OCSP_RESPONSE_bio(bp,p) ASN1_d2i_bio_of(OCSP_RESPONSE,OCSP_RESPONSE_new,d2i_OCSP_RESPONSE,bp,p)
3550Sstevel@tonic-gate 
3560Sstevel@tonic-gate #define	PEM_read_bio_OCSP_REQUEST(bp,x,cb) (OCSP_REQUEST *)PEM_ASN1_read_bio( \
3570Sstevel@tonic-gate      (char *(*)())d2i_OCSP_REQUEST,PEM_STRING_OCSP_REQUEST,bp,(char **)x,cb,NULL)
3580Sstevel@tonic-gate 
3590Sstevel@tonic-gate #define	PEM_read_bio_OCSP_RESPONSE(bp,x,cb)(OCSP_RESPONSE *)PEM_ASN1_read_bio(\
3600Sstevel@tonic-gate      (char *(*)())d2i_OCSP_RESPONSE,PEM_STRING_OCSP_RESPONSE,bp,(char **)x,cb,NULL)
3610Sstevel@tonic-gate 
3620Sstevel@tonic-gate #define PEM_write_bio_OCSP_REQUEST(bp,o) \
3630Sstevel@tonic-gate     PEM_ASN1_write_bio((int (*)())i2d_OCSP_REQUEST,PEM_STRING_OCSP_REQUEST,\
3640Sstevel@tonic-gate 			bp,(char *)o, NULL,NULL,0,NULL,NULL)
3650Sstevel@tonic-gate 
3660Sstevel@tonic-gate #define PEM_write_bio_OCSP_RESPONSE(bp,o) \
3670Sstevel@tonic-gate     PEM_ASN1_write_bio((int (*)())i2d_OCSP_RESPONSE,PEM_STRING_OCSP_RESPONSE,\
3680Sstevel@tonic-gate 			bp,(char *)o, NULL,NULL,0,NULL,NULL)
3690Sstevel@tonic-gate 
370*2139Sjp161948 #define i2d_OCSP_RESPONSE_bio(bp,o) ASN1_i2d_bio_of(OCSP_RESPONSE,i2d_OCSP_RESPONSE,bp,o)
3710Sstevel@tonic-gate 
372*2139Sjp161948 #define i2d_OCSP_REQUEST_bio(bp,o) ASN1_i2d_bio_of(OCSP_REQUEST,i2d_OCSP_REQUEST,bp,o)
3730Sstevel@tonic-gate 
3740Sstevel@tonic-gate #define OCSP_REQUEST_sign(o,pkey,md) \
3750Sstevel@tonic-gate 	ASN1_item_sign(ASN1_ITEM_rptr(OCSP_REQINFO),\
3760Sstevel@tonic-gate 		o->optionalSignature->signatureAlgorithm,NULL,\
3770Sstevel@tonic-gate 	        o->optionalSignature->signature,o->tbsRequest,pkey,md)
3780Sstevel@tonic-gate 
3790Sstevel@tonic-gate #define OCSP_BASICRESP_sign(o,pkey,md,d) \
3800Sstevel@tonic-gate 	ASN1_item_sign(ASN1_ITEM_rptr(OCSP_RESPDATA),o->signatureAlgorithm,NULL,\
3810Sstevel@tonic-gate 		o->signature,o->tbsResponseData,pkey,md)
3820Sstevel@tonic-gate 
3830Sstevel@tonic-gate #define OCSP_REQUEST_verify(a,r) ASN1_item_verify(ASN1_ITEM_rptr(OCSP_REQINFO),\
3840Sstevel@tonic-gate         a->optionalSignature->signatureAlgorithm,\
3850Sstevel@tonic-gate 	a->optionalSignature->signature,a->tbsRequest,r)
3860Sstevel@tonic-gate 
3870Sstevel@tonic-gate #define OCSP_BASICRESP_verify(a,r,d) ASN1_item_verify(ASN1_ITEM_rptr(OCSP_RESPDATA),\
3880Sstevel@tonic-gate 	a->signatureAlgorithm,a->signature,a->tbsResponseData,r)
3890Sstevel@tonic-gate 
3900Sstevel@tonic-gate #define ASN1_BIT_STRING_digest(data,type,md,len) \
3910Sstevel@tonic-gate 	ASN1_item_digest(ASN1_ITEM_rptr(ASN1_BIT_STRING),type,data,md,len)
3920Sstevel@tonic-gate 
393*2139Sjp161948 #define OCSP_CERTID_dup(cid) ASN1_dup_of(OCSP_CERTID,i2d_OCSP_CERTID,d2i_OCSP_CERTID,cid)
3940Sstevel@tonic-gate 
3950Sstevel@tonic-gate #define OCSP_CERTSTATUS_dup(cs)\
3960Sstevel@tonic-gate                 (OCSP_CERTSTATUS*)ASN1_dup((int(*)())i2d_OCSP_CERTSTATUS,\
3970Sstevel@tonic-gate 		(char *(*)())d2i_OCSP_CERTSTATUS,(char *)(cs))
3980Sstevel@tonic-gate 
3990Sstevel@tonic-gate OCSP_RESPONSE *OCSP_sendreq_bio(BIO *b, char *path, OCSP_REQUEST *req);
4000Sstevel@tonic-gate 
4010Sstevel@tonic-gate OCSP_CERTID *OCSP_cert_to_id(const EVP_MD *dgst, X509 *subject, X509 *issuer);
4020Sstevel@tonic-gate 
4030Sstevel@tonic-gate OCSP_CERTID *OCSP_cert_id_new(const EVP_MD *dgst,
4040Sstevel@tonic-gate 			      X509_NAME *issuerName,
4050Sstevel@tonic-gate 			      ASN1_BIT_STRING* issuerKey,
4060Sstevel@tonic-gate 			      ASN1_INTEGER *serialNumber);
4070Sstevel@tonic-gate 
4080Sstevel@tonic-gate OCSP_ONEREQ *OCSP_request_add0_id(OCSP_REQUEST *req, OCSP_CERTID *cid);
4090Sstevel@tonic-gate 
4100Sstevel@tonic-gate int OCSP_request_add1_nonce(OCSP_REQUEST *req, unsigned char *val, int len);
4110Sstevel@tonic-gate int OCSP_basic_add1_nonce(OCSP_BASICRESP *resp, unsigned char *val, int len);
4120Sstevel@tonic-gate int OCSP_check_nonce(OCSP_REQUEST *req, OCSP_BASICRESP *bs);
4130Sstevel@tonic-gate int OCSP_copy_nonce(OCSP_BASICRESP *resp, OCSP_REQUEST *req);
4140Sstevel@tonic-gate 
4150Sstevel@tonic-gate int OCSP_request_set1_name(OCSP_REQUEST *req, X509_NAME *nm);
4160Sstevel@tonic-gate int OCSP_request_add1_cert(OCSP_REQUEST *req, X509 *cert);
4170Sstevel@tonic-gate 
4180Sstevel@tonic-gate int OCSP_request_sign(OCSP_REQUEST   *req,
4190Sstevel@tonic-gate 		      X509           *signer,
4200Sstevel@tonic-gate 		      EVP_PKEY       *key,
4210Sstevel@tonic-gate 		      const EVP_MD   *dgst,
4220Sstevel@tonic-gate 		      STACK_OF(X509) *certs,
4230Sstevel@tonic-gate 		      unsigned long flags);
4240Sstevel@tonic-gate 
4250Sstevel@tonic-gate int OCSP_response_status(OCSP_RESPONSE *resp);
4260Sstevel@tonic-gate OCSP_BASICRESP *OCSP_response_get1_basic(OCSP_RESPONSE *resp);
4270Sstevel@tonic-gate 
4280Sstevel@tonic-gate int OCSP_resp_count(OCSP_BASICRESP *bs);
4290Sstevel@tonic-gate OCSP_SINGLERESP *OCSP_resp_get0(OCSP_BASICRESP *bs, int idx);
4300Sstevel@tonic-gate int OCSP_resp_find(OCSP_BASICRESP *bs, OCSP_CERTID *id, int last);
4310Sstevel@tonic-gate int OCSP_single_get0_status(OCSP_SINGLERESP *single, int *reason,
4320Sstevel@tonic-gate 				ASN1_GENERALIZEDTIME **revtime,
4330Sstevel@tonic-gate 				ASN1_GENERALIZEDTIME **thisupd,
4340Sstevel@tonic-gate 				ASN1_GENERALIZEDTIME **nextupd);
4350Sstevel@tonic-gate int OCSP_resp_find_status(OCSP_BASICRESP *bs, OCSP_CERTID *id, int *status,
4360Sstevel@tonic-gate 				int *reason,
4370Sstevel@tonic-gate 				ASN1_GENERALIZEDTIME **revtime,
4380Sstevel@tonic-gate 				ASN1_GENERALIZEDTIME **thisupd,
4390Sstevel@tonic-gate 				ASN1_GENERALIZEDTIME **nextupd);
4400Sstevel@tonic-gate int OCSP_check_validity(ASN1_GENERALIZEDTIME *thisupd,
4410Sstevel@tonic-gate 			ASN1_GENERALIZEDTIME *nextupd,
4420Sstevel@tonic-gate 			long sec, long maxsec);
4430Sstevel@tonic-gate 
4440Sstevel@tonic-gate int OCSP_request_verify(OCSP_REQUEST *req, STACK_OF(X509) *certs, X509_STORE *store, unsigned long flags);
4450Sstevel@tonic-gate 
4460Sstevel@tonic-gate int OCSP_parse_url(char *url, char **phost, char **pport, char **ppath, int *pssl);
4470Sstevel@tonic-gate 
4480Sstevel@tonic-gate int OCSP_id_issuer_cmp(OCSP_CERTID *a, OCSP_CERTID *b);
4490Sstevel@tonic-gate int OCSP_id_cmp(OCSP_CERTID *a, OCSP_CERTID *b);
4500Sstevel@tonic-gate 
4510Sstevel@tonic-gate int OCSP_request_onereq_count(OCSP_REQUEST *req);
4520Sstevel@tonic-gate OCSP_ONEREQ *OCSP_request_onereq_get0(OCSP_REQUEST *req, int i);
4530Sstevel@tonic-gate OCSP_CERTID *OCSP_onereq_get0_id(OCSP_ONEREQ *one);
4540Sstevel@tonic-gate int OCSP_id_get0_info(ASN1_OCTET_STRING **piNameHash, ASN1_OBJECT **pmd,
4550Sstevel@tonic-gate 			ASN1_OCTET_STRING **pikeyHash,
4560Sstevel@tonic-gate 			ASN1_INTEGER **pserial, OCSP_CERTID *cid);
4570Sstevel@tonic-gate int OCSP_request_is_signed(OCSP_REQUEST *req);
4580Sstevel@tonic-gate OCSP_RESPONSE *OCSP_response_create(int status, OCSP_BASICRESP *bs);
4590Sstevel@tonic-gate OCSP_SINGLERESP *OCSP_basic_add1_status(OCSP_BASICRESP *rsp,
4600Sstevel@tonic-gate 						OCSP_CERTID *cid,
4610Sstevel@tonic-gate 						int status, int reason,
4620Sstevel@tonic-gate 						ASN1_TIME *revtime,
4630Sstevel@tonic-gate 					ASN1_TIME *thisupd, ASN1_TIME *nextupd);
4640Sstevel@tonic-gate int OCSP_basic_add1_cert(OCSP_BASICRESP *resp, X509 *cert);
4650Sstevel@tonic-gate int OCSP_basic_sign(OCSP_BASICRESP *brsp,
4660Sstevel@tonic-gate 			X509 *signer, EVP_PKEY *key, const EVP_MD *dgst,
4670Sstevel@tonic-gate 			STACK_OF(X509) *certs, unsigned long flags);
4680Sstevel@tonic-gate 
469*2139Sjp161948 ASN1_STRING *ASN1_STRING_encode(ASN1_STRING *s, i2d_of_void *i2d,
470*2139Sjp161948 				void *data, STACK_OF(ASN1_OBJECT) *sk);
471*2139Sjp161948 #define ASN1_STRING_encode_of(type,s,i2d,data,sk) \
472*2139Sjp161948 ((ASN1_STRING *(*)(ASN1_STRING *,I2D_OF(type),type *,STACK_OF(ASN1_OBJECT) *))openssl_fcast(ASN1_STRING_encode))(s,i2d,data,sk)
4730Sstevel@tonic-gate 
4740Sstevel@tonic-gate X509_EXTENSION *OCSP_crlID_new(char *url, long *n, char *tim);
4750Sstevel@tonic-gate 
4760Sstevel@tonic-gate X509_EXTENSION *OCSP_accept_responses_new(char **oids);
4770Sstevel@tonic-gate 
4780Sstevel@tonic-gate X509_EXTENSION *OCSP_archive_cutoff_new(char* tim);
4790Sstevel@tonic-gate 
4800Sstevel@tonic-gate X509_EXTENSION *OCSP_url_svcloc_new(X509_NAME* issuer, char **urls);
4810Sstevel@tonic-gate 
4820Sstevel@tonic-gate int OCSP_REQUEST_get_ext_count(OCSP_REQUEST *x);
4830Sstevel@tonic-gate int OCSP_REQUEST_get_ext_by_NID(OCSP_REQUEST *x, int nid, int lastpos);
4840Sstevel@tonic-gate int OCSP_REQUEST_get_ext_by_OBJ(OCSP_REQUEST *x, ASN1_OBJECT *obj, int lastpos);
4850Sstevel@tonic-gate int OCSP_REQUEST_get_ext_by_critical(OCSP_REQUEST *x, int crit, int lastpos);
4860Sstevel@tonic-gate X509_EXTENSION *OCSP_REQUEST_get_ext(OCSP_REQUEST *x, int loc);
4870Sstevel@tonic-gate X509_EXTENSION *OCSP_REQUEST_delete_ext(OCSP_REQUEST *x, int loc);
4880Sstevel@tonic-gate void *OCSP_REQUEST_get1_ext_d2i(OCSP_REQUEST *x, int nid, int *crit, int *idx);
4890Sstevel@tonic-gate int OCSP_REQUEST_add1_ext_i2d(OCSP_REQUEST *x, int nid, void *value, int crit,
4900Sstevel@tonic-gate 							unsigned long flags);
4910Sstevel@tonic-gate int OCSP_REQUEST_add_ext(OCSP_REQUEST *x, X509_EXTENSION *ex, int loc);
4920Sstevel@tonic-gate 
4930Sstevel@tonic-gate int OCSP_ONEREQ_get_ext_count(OCSP_ONEREQ *x);
4940Sstevel@tonic-gate int OCSP_ONEREQ_get_ext_by_NID(OCSP_ONEREQ *x, int nid, int lastpos);
4950Sstevel@tonic-gate int OCSP_ONEREQ_get_ext_by_OBJ(OCSP_ONEREQ *x, ASN1_OBJECT *obj, int lastpos);
4960Sstevel@tonic-gate int OCSP_ONEREQ_get_ext_by_critical(OCSP_ONEREQ *x, int crit, int lastpos);
4970Sstevel@tonic-gate X509_EXTENSION *OCSP_ONEREQ_get_ext(OCSP_ONEREQ *x, int loc);
4980Sstevel@tonic-gate X509_EXTENSION *OCSP_ONEREQ_delete_ext(OCSP_ONEREQ *x, int loc);
4990Sstevel@tonic-gate void *OCSP_ONEREQ_get1_ext_d2i(OCSP_ONEREQ *x, int nid, int *crit, int *idx);
5000Sstevel@tonic-gate int OCSP_ONEREQ_add1_ext_i2d(OCSP_ONEREQ *x, int nid, void *value, int crit,
5010Sstevel@tonic-gate 							unsigned long flags);
5020Sstevel@tonic-gate int OCSP_ONEREQ_add_ext(OCSP_ONEREQ *x, X509_EXTENSION *ex, int loc);
5030Sstevel@tonic-gate 
5040Sstevel@tonic-gate int OCSP_BASICRESP_get_ext_count(OCSP_BASICRESP *x);
5050Sstevel@tonic-gate int OCSP_BASICRESP_get_ext_by_NID(OCSP_BASICRESP *x, int nid, int lastpos);
5060Sstevel@tonic-gate int OCSP_BASICRESP_get_ext_by_OBJ(OCSP_BASICRESP *x, ASN1_OBJECT *obj, int lastpos);
5070Sstevel@tonic-gate int OCSP_BASICRESP_get_ext_by_critical(OCSP_BASICRESP *x, int crit, int lastpos);
5080Sstevel@tonic-gate X509_EXTENSION *OCSP_BASICRESP_get_ext(OCSP_BASICRESP *x, int loc);
5090Sstevel@tonic-gate X509_EXTENSION *OCSP_BASICRESP_delete_ext(OCSP_BASICRESP *x, int loc);
5100Sstevel@tonic-gate void *OCSP_BASICRESP_get1_ext_d2i(OCSP_BASICRESP *x, int nid, int *crit, int *idx);
5110Sstevel@tonic-gate int OCSP_BASICRESP_add1_ext_i2d(OCSP_BASICRESP *x, int nid, void *value, int crit,
5120Sstevel@tonic-gate 							unsigned long flags);
5130Sstevel@tonic-gate int OCSP_BASICRESP_add_ext(OCSP_BASICRESP *x, X509_EXTENSION *ex, int loc);
5140Sstevel@tonic-gate 
5150Sstevel@tonic-gate int OCSP_SINGLERESP_get_ext_count(OCSP_SINGLERESP *x);
5160Sstevel@tonic-gate int OCSP_SINGLERESP_get_ext_by_NID(OCSP_SINGLERESP *x, int nid, int lastpos);
5170Sstevel@tonic-gate int OCSP_SINGLERESP_get_ext_by_OBJ(OCSP_SINGLERESP *x, ASN1_OBJECT *obj, int lastpos);
5180Sstevel@tonic-gate int OCSP_SINGLERESP_get_ext_by_critical(OCSP_SINGLERESP *x, int crit, int lastpos);
5190Sstevel@tonic-gate X509_EXTENSION *OCSP_SINGLERESP_get_ext(OCSP_SINGLERESP *x, int loc);
5200Sstevel@tonic-gate X509_EXTENSION *OCSP_SINGLERESP_delete_ext(OCSP_SINGLERESP *x, int loc);
5210Sstevel@tonic-gate void *OCSP_SINGLERESP_get1_ext_d2i(OCSP_SINGLERESP *x, int nid, int *crit, int *idx);
5220Sstevel@tonic-gate int OCSP_SINGLERESP_add1_ext_i2d(OCSP_SINGLERESP *x, int nid, void *value, int crit,
5230Sstevel@tonic-gate 							unsigned long flags);
5240Sstevel@tonic-gate int OCSP_SINGLERESP_add_ext(OCSP_SINGLERESP *x, X509_EXTENSION *ex, int loc);
5250Sstevel@tonic-gate 
5260Sstevel@tonic-gate DECLARE_ASN1_FUNCTIONS(OCSP_SINGLERESP)
5270Sstevel@tonic-gate DECLARE_ASN1_FUNCTIONS(OCSP_CERTSTATUS)
5280Sstevel@tonic-gate DECLARE_ASN1_FUNCTIONS(OCSP_REVOKEDINFO)
5290Sstevel@tonic-gate DECLARE_ASN1_FUNCTIONS(OCSP_BASICRESP)
5300Sstevel@tonic-gate DECLARE_ASN1_FUNCTIONS(OCSP_RESPDATA)
5310Sstevel@tonic-gate DECLARE_ASN1_FUNCTIONS(OCSP_RESPID)
5320Sstevel@tonic-gate DECLARE_ASN1_FUNCTIONS(OCSP_RESPONSE)
5330Sstevel@tonic-gate DECLARE_ASN1_FUNCTIONS(OCSP_RESPBYTES)
5340Sstevel@tonic-gate DECLARE_ASN1_FUNCTIONS(OCSP_ONEREQ)
5350Sstevel@tonic-gate DECLARE_ASN1_FUNCTIONS(OCSP_CERTID)
5360Sstevel@tonic-gate DECLARE_ASN1_FUNCTIONS(OCSP_REQUEST)
5370Sstevel@tonic-gate DECLARE_ASN1_FUNCTIONS(OCSP_SIGNATURE)
5380Sstevel@tonic-gate DECLARE_ASN1_FUNCTIONS(OCSP_REQINFO)
5390Sstevel@tonic-gate DECLARE_ASN1_FUNCTIONS(OCSP_CRLID)
5400Sstevel@tonic-gate DECLARE_ASN1_FUNCTIONS(OCSP_SERVICELOC)
5410Sstevel@tonic-gate 
5420Sstevel@tonic-gate char *OCSP_response_status_str(long s);
5430Sstevel@tonic-gate char *OCSP_cert_status_str(long s);
5440Sstevel@tonic-gate char *OCSP_crl_reason_str(long s);
5450Sstevel@tonic-gate 
5460Sstevel@tonic-gate int OCSP_REQUEST_print(BIO *bp, OCSP_REQUEST* a, unsigned long flags);
5470Sstevel@tonic-gate int OCSP_RESPONSE_print(BIO *bp, OCSP_RESPONSE* o, unsigned long flags);
5480Sstevel@tonic-gate 
5490Sstevel@tonic-gate int OCSP_basic_verify(OCSP_BASICRESP *bs, STACK_OF(X509) *certs,
5500Sstevel@tonic-gate 				X509_STORE *st, unsigned long flags);
5510Sstevel@tonic-gate 
5520Sstevel@tonic-gate /* BEGIN ERROR CODES */
5530Sstevel@tonic-gate /* The following lines are auto generated by the script mkerr.pl. Any changes
5540Sstevel@tonic-gate  * made after this point may be overwritten when the script is next run.
5550Sstevel@tonic-gate  */
5560Sstevel@tonic-gate void ERR_load_OCSP_strings(void);
5570Sstevel@tonic-gate 
5580Sstevel@tonic-gate /* Error codes for the OCSP functions. */
5590Sstevel@tonic-gate 
5600Sstevel@tonic-gate /* Function codes. */
5610Sstevel@tonic-gate #define OCSP_F_ASN1_STRING_ENCODE			 100
5620Sstevel@tonic-gate #define OCSP_F_D2I_OCSP_NONCE				 102
5630Sstevel@tonic-gate #define OCSP_F_OCSP_BASIC_ADD1_STATUS			 103
5640Sstevel@tonic-gate #define OCSP_F_OCSP_BASIC_SIGN				 104
5650Sstevel@tonic-gate #define OCSP_F_OCSP_BASIC_VERIFY			 105
566*2139Sjp161948 #define OCSP_F_OCSP_CERT_ID_NEW				 101
5670Sstevel@tonic-gate #define OCSP_F_OCSP_CHECK_DELEGATED			 106
5680Sstevel@tonic-gate #define OCSP_F_OCSP_CHECK_IDS				 107
5690Sstevel@tonic-gate #define OCSP_F_OCSP_CHECK_ISSUER			 108
5700Sstevel@tonic-gate #define OCSP_F_OCSP_CHECK_VALIDITY			 115
5710Sstevel@tonic-gate #define OCSP_F_OCSP_MATCH_ISSUERID			 109
5720Sstevel@tonic-gate #define OCSP_F_OCSP_PARSE_URL				 114
5730Sstevel@tonic-gate #define OCSP_F_OCSP_REQUEST_SIGN			 110
5740Sstevel@tonic-gate #define OCSP_F_OCSP_REQUEST_VERIFY			 116
5750Sstevel@tonic-gate #define OCSP_F_OCSP_RESPONSE_GET1_BASIC			 111
5760Sstevel@tonic-gate #define OCSP_F_OCSP_SENDREQ_BIO				 112
5770Sstevel@tonic-gate #define OCSP_F_REQUEST_VERIFY				 113
5780Sstevel@tonic-gate 
5790Sstevel@tonic-gate /* Reason codes. */
5800Sstevel@tonic-gate #define OCSP_R_BAD_DATA					 100
5810Sstevel@tonic-gate #define OCSP_R_CERTIFICATE_VERIFY_ERROR			 101
5820Sstevel@tonic-gate #define OCSP_R_DIGEST_ERR				 102
5830Sstevel@tonic-gate #define OCSP_R_ERROR_IN_NEXTUPDATE_FIELD		 122
5840Sstevel@tonic-gate #define OCSP_R_ERROR_IN_THISUPDATE_FIELD		 123
5850Sstevel@tonic-gate #define OCSP_R_ERROR_PARSING_URL			 121
5860Sstevel@tonic-gate #define OCSP_R_MISSING_OCSPSIGNING_USAGE		 103
5870Sstevel@tonic-gate #define OCSP_R_NEXTUPDATE_BEFORE_THISUPDATE		 124
5880Sstevel@tonic-gate #define OCSP_R_NOT_BASIC_RESPONSE			 104
5890Sstevel@tonic-gate #define OCSP_R_NO_CERTIFICATES_IN_CHAIN			 105
5900Sstevel@tonic-gate #define OCSP_R_NO_CONTENT				 106
5910Sstevel@tonic-gate #define OCSP_R_NO_PUBLIC_KEY				 107
5920Sstevel@tonic-gate #define OCSP_R_NO_RESPONSE_DATA				 108
5930Sstevel@tonic-gate #define OCSP_R_NO_REVOKED_TIME				 109
5940Sstevel@tonic-gate #define OCSP_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE	 110
5950Sstevel@tonic-gate #define OCSP_R_REQUEST_NOT_SIGNED			 128
5960Sstevel@tonic-gate #define OCSP_R_RESPONSE_CONTAINS_NO_REVOCATION_DATA	 111
5970Sstevel@tonic-gate #define OCSP_R_ROOT_CA_NOT_TRUSTED			 112
5980Sstevel@tonic-gate #define OCSP_R_SERVER_READ_ERROR			 113
5990Sstevel@tonic-gate #define OCSP_R_SERVER_RESPONSE_ERROR			 114
6000Sstevel@tonic-gate #define OCSP_R_SERVER_RESPONSE_PARSE_ERROR		 115
6010Sstevel@tonic-gate #define OCSP_R_SERVER_WRITE_ERROR			 116
6020Sstevel@tonic-gate #define OCSP_R_SIGNATURE_FAILURE			 117
6030Sstevel@tonic-gate #define OCSP_R_SIGNER_CERTIFICATE_NOT_FOUND		 118
6040Sstevel@tonic-gate #define OCSP_R_STATUS_EXPIRED				 125
6050Sstevel@tonic-gate #define OCSP_R_STATUS_NOT_YET_VALID			 126
6060Sstevel@tonic-gate #define OCSP_R_STATUS_TOO_OLD				 127
6070Sstevel@tonic-gate #define OCSP_R_UNKNOWN_MESSAGE_DIGEST			 119
6080Sstevel@tonic-gate #define OCSP_R_UNKNOWN_NID				 120
6090Sstevel@tonic-gate #define OCSP_R_UNSUPPORTED_REQUESTORNAME_TYPE		 129
6100Sstevel@tonic-gate 
6110Sstevel@tonic-gate #ifdef  __cplusplus
6120Sstevel@tonic-gate }
6130Sstevel@tonic-gate #endif
6140Sstevel@tonic-gate #endif
615