HTTP/1.1 200 OK Date: Tue, 09 Apr 2002 06:26:16 GMT Server: Apache/1.3.20 (Unix) Last-Modified: Tue, 07 Apr 1998 20:43:00 GMT ETag: "2e7b71-6cd7-352a8fd4" Accept-Ranges: bytes Content-Length: 27863 Connection: close Content-Type: text/plain PKIX Working Group Michael Myers(VeriSign) draft-ietf-pkix-ocsp-03.txt Rich Ankney (CertCo) Ambarish Malpani (Valicert) Slava Galperin (Netscape) Carlisle Adams (Entrust Technologies) Expires in 6 months March 1998 X.509 Internet Public Key Infrastructure Online Certificate Status Protocol - OCSP Status of this Memo This document is an Internet-Draft. Internet-Drafts are working documents of the Internet Engineering Task Force (IETF), its areas, and its working groups. Note that other groups may also distribute working documents as Internet-Drafts. Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress." To view the entire list of current Internet-Drafts, please check the "1id-abstracts.txt" listing contained in the Internet-Drafts Shadow Directories on ftp.is.co.za (Africa), ftp.nordu.net (Northern Europe), ftp.nis.garr.it (Southern Europe), munnari.oz.au (Pacific Rim), ftp.ietf.org (US East Coast), or ftp.isi.edu (US West Coast). 1. Abstract This document specifies a protocol useful in determining the current status of a digital certificate without the use of CRLs. Additional mechanisms addressing PKIX operational requirements are specified in separate documents. Section 2 provides an overview of the protocol. Section 3 goes establishes functional requirements, while section 4 provides the details of the protocol. In section 5 we cover security issues with the protocol. Appendix A demonstrates OCSP over HTTP and appendix B accumulates ASN.1 syntactic elements. 2. Protocol Overview In lieu of or as a supplement to checking against a periodic CRL, it may be necessary to obtain timely status regarding a certificate’s revocation state (cf. PKIX Part 1, Section 3.3). Examples include high- value funds transfer or the compromise of a highly sensitive key. The Online Certificate Status Protocol (OCSP) enables applications to determine the revocation state of an identified certificate. OCSP may Myers, Ankney, Malpani, Galperin, Adams [Page 1] INTERNET DRAFT March 1998 be used to satisfy some of the operational requirements of providing more timely revocation information than is possible with CRLs. An OCSP client issues a status request to an OCSP responder and suspends acceptance of the certificate in question until the responder provides a response. This protocol specifies the data that needs to be exchanged between an application checking the revocation status of a certificate and the server providing that status. 2.1 Request An OCSP request contains the following data: - protocol version - service request - target certificate identifier or a single end-entity certificate - optional extensions which MAY be processed by the OCSP Responder Upon receipt of a request, an OCSP Responder determines if: 1) the message is well formed, 2) the responder is configured to provide the requested service, and 3) the responder can perform the requested service for the subject certificate. If any one of the prior conditions are not met, the OCSP responder produces an error message; otherwise, it returns a definitive response. 2.2 Response All definitive response messages SHALL be digitally signed. The key used to sign the response MUST belong to one of the following: - the CA who issued the certificate in question - a Trusted Responder whose public key is trusted by the requester A definitive response message is composed of: - response type identifier (to allow for different response types) - version of the response - name of the responder - responses for each of the certificates in a request - optional extensions - signature algorithm OID - signature computed across hash of the response The response for each of the certificates in a request consists of - target certificate identifier - certificate status value - response validity interval - optional extensions This specification defines the following definitive response indicators for use in the certificate status value: Myers, Ankney, Malpani, Galperin, Adams [Page 2] INTERNET DRAFT March 1998 - notRevoked - revoked - onHold - expired The notRevoked state indicates that the certificate is not revoked. It does not necessarily mean that the certificate was ever issued. Nor does it mean that the certificate is in its validity interval. A notRevoked state by an OCSP responder DOES NOT absolve the application of the responsibility of checking that the certificate is in its validity period and has been correctly signed. The revoked state indicates that the certificate has been revoked. The onHold state corresponds to valid certificates that are operationally suspended in accordance with PKIX Part 1. A request that returns an expired state indicates that the validity of the subject certificate has expired. Applications SHOULD check the validity interval of a certificate and not perform an OCSP request if the certificate’s validity has expired. 2.3 Exception Cases In case of errors, the OCSP Responder may return an error message. Errors can be of the following types: - malformedRequest - internalError - tryLater - notFound - certRequired - noCRL A server produces the malformedRequest response if the request received does not conform to the OCSP syntax. The response internalError indicates that the OCSP responder reached an inconsistent internal state. The query should be retried, potentially with another responder. In the event that the OCSP responder is operational, but unable to return a status for the requested certificate, the tryLater response can be used to indicate that the service exists, but is temporarily unable to respond. A recipient of a request may not be able to resolve a reference to the subject certificate; a value of notFound is returned in such a case. This value should not be taken as confirmation of the certificate's existence. The response certRequired is returned in cases where the server requires the client to supply the certificate data itself in order to construct a response. Myers, Ankney, Malpani, Galperin, Adams [Page 3] INTERNET DRAFT March 1998 An extension is defined to enable delivery of CRLs with OCSP responses. However, there is no requirement to list certificates on a CRL in order to use OCSP to acquire revocation status on those certificates. The error value noCRL is defined for this instance. 2.4 Response Pre-production The response validity interval noted in the prior section is composed of a {thisUpdate, nextUpdate} pair of elements in the response syntax. Section 4.2 provides details of the response syntax. OCSP responders MAY pre-produce signed responses specifying the current status of certificates at the time the response was produced. The time at which the response was produced SHALL be reflected in the thisUpdate field of the response. If responses are pre-produced, then for a given certificate, the periodicity of this pre-production SHOULD match the response validity interval of the most recently produced response. [need to resolve the above statement with the following RCSP assertions, esp. with respect to positive responses. Question put to the list.] The time at which the response was known to be correct SHALL be specified in the producedAt field of the response. This time is not necessarily the same as the time at which the response was produced - e.g. if the responder obtains a CRL from a CA and creates pre-produced responses, the thisUpdate time should specify the thisUpdate time in the CRL. The producer of the response MAY include a value for nextUpdate. The exact interval between thisUpdate and nextUpdate for given response is a matter of local security and operational policy. If the nextUpdate field is not present, the response is is known to be correct at the thisUpdate time. Equivalently, the nextUpdate field is considered to be the same as the thisUpdate field. No assertions are being made about the current state of the certificate, nor are any recommendations being made as to when the requestor should check again with the responder. If the value of nextUpdate is set, it is just a hint, not a guarantee, of when the responder expects to have new information about that certificate's status. 3. Functional Requirements 3.1 Certificate Content In order to convey to OCSP clients a well-known point of information access, CAs SHALL provide the capability to include the AuthorityInfoAccess extension (defined in PKIX Part 1, section 4.2.2.1) in certificates that can be checked using OCSP. Alternatively, the accessLocation for the OCSP provider may be configured locally at the OCSP client. Myers, Ankney, Malpani, Galperin, Adams [Page 4] INTERNET DRAFT March 1998 CAs that support an OCSP service, either hosted locally or provided by an Authorized Responder, MAY provide a value for a uniformResourceIndicator (URI) accessLocation and the OID value id-ad-ocsp for the accessMethod in the AccessDescription SEQUENCE. The value of the accessLocation field in the subject certificate corresponds to the URL placed into an OCSP request. 3.3 Error Responses Upon receipt of a request which fails to parse, the receiving OCSP responder SHALL respond with an error message. Error responses MAY be signed. 3.5 Signed Response Acceptance Requirements Prior to accepting a signed response as valid, OCSP clients SHALL confirm that: 1. The certificate identified in a received response corresponds to that which was identified in the corresponding request; 2. The signature on the response is valid; 3. The identity of the signer matches the intended recipient of the request. 4. Detailed Protocol The ASN.1 syntax imports terms defined in the X.509 Certificate and CRL Profile Internet Draft. For signature calculation, the data to be signed is encoded using the ASN.1 distinguished encoding rules (DER) [X.690]. ASN.1 EXPLICIT tagging is used as a default unless specified otherwise. The terms imported from elsewhere are: Version, Extensions, CertificateSerialNumber, SubjectPublicKeyInfo, Name, AlgorithmIdentifier, GeneralizedTime 4.1 Request Syntax OCSPRequest ::= SEQUENCE { version [0] EXPLICIT Version DEFAULT v1, hashAlgorithm AlgorithmIdentifier, requestList SEQUENCE OF Request, requestExtensions [1] EXPLICIT Extensions OPTIONAL } Version ::= INTEGER { v1(0) } Request ::= CHOICE { certID [0] EXPLICIT CertID, cert [1] EXPLICIT Certificate } Myers, Ankney, Malpani, Galperin, Adams [Page 5] INTERNET DRAFT March 1998 CertID ::= SEQUENCE { issuerNameAndKeyHash Hash, serialNumber CertificateSerialNumber } IssuerNameAndKey ::= SEQUENCE { issuer Name, issuerPublicKey SubjectPublicKeyInfo } Hash ::= OCTET STRING --hash of IssuerNameAndKey-- 3.2 Response Syntax This section specifies the ASN.1 specification for a confirmation response. The actual formatting of the message could vary depending on the transport mechanism used (http, smtp, ldap, etc.). 3.2.1 ASN.1 Specification of the OCSP Response An OCSP response at a minimum consists of a responseStatus field indicating the processing status of the prior request. If the value of responseStatus is one of the error conditions, responseBytes are not set. OCSPResponse ::= SEQUENCE { responseStatus OCSPResponseStatus, responseBytes [0] EXPLICIT ResponseBytes OPTIONAL } OCSPResponseStatus ::= ENUMERATED { successful (0), --Response has valid confirmations malformedRequest (1), --Illegal confirmation request internalError (2), --Internal error in issuer tryLater (3), --Try again later notFound (4), --Certificate not on record certRequired (5) --Must supply certificate } 3.2.1.1 BasicResponse The value for responseBytes consists of an OBJECT IDENTIFIER and a response syntax identified by that OID encoded as an OCTET STRING: ResponseBytes ::= SEQUENCE { responseType OBJECT IDENTIFIER, response OCTET STRING } For a basic OCSP responder, responseType will be id-pkix-ocsp-basic, where: id-pkix-ocsp OBJECT IDENTIFIER ::= { id-ad-ocsp } id-pkix-ocsp-basic OBJECT IDENTIFIER ::= { id-pkix-ocsp 1 } OCSP responders SHALL be capable of recognizing and responding to the id-pkix-ocsp-basic response type. Correspondingly, OCSP clients SHALL be capable of receiving and processing the id-pkix-ocsp-basic response type. Myers, Ankney, Malpani, Galperin, Adams [Page 6] INTERNET DRAFT March 1998 The value for response SHALL be the DER encoding of BasicOCSPResponse: BasicOCSPResponse ::= SEQUENCE { tbsResponseData ResponseData, signatureAlgorithm AlgorithmIdentifier, signature BIT STRING, certs [1] EXPLICIT SEQUENCE OF Certificate OPTIONAL } The value for signature SHALL be computed on the hash of the DER encoding ResponseData. 3.2.1.2 ResponseData ResponseData ::= SEQUENCE { version [0] EXPLICIT Version DEFAULT v1, reponderID ResponderID, responses SEQUENCE OF SingleResponse, responseExtensions [1] EXPLICIT Extensions OPTIONAL } ResponderID ::= CHOICE { byName [0] Name, byKey [1] KeyHash } KeyHash ::= KeyIdentifier –-SHA-1 hash as defined in PKIX Part.1 3.2.1.3 SingleResponse [note: question put to the list regarding bandwidth issues associated with sending certificates back; could just use certID directly since requester already has certificates in question.] SingleResponse ::= SEQUENCE { request Request, certStatus CertStatus, producedAt GeneralizedTime, nextUpdate [0] EXPLICIT GeneralizedTime OPTIONAL, singleExtensions [2] EXPLICIT Extensions OPTIONAL } CertStatus ::= CHOICE { certStatusType [0] EXPLICIT CertStatusType (notRevoked | onHold), statusWithTime [1] EXPLICIT StatusWithTime } StatusWithTime ::= SEQUENCE { certStatusType CertStatusType (revoked), time GeneralizedTime } CertStatusType ::= ENUMERATED { notRevoked (0), --This serial number is not revoked revoked (1), --Serial number was revoked onHold (2), --Cert is on hold expired (3) -- certificate is expired } Applications SHOULD determine by observation of the certificate’s validity interval that a certificate is expired. The expired value of Myers, Ankney, Malpani, Galperin, Adams [Page 7] INTERNET DRAFT March 1998 CertStatusType defines a value to return when a request is received for a subject certificate in this state. 3.2.2 Notes on OCSP Responses If the certStatusType is revoked, onHold or expired, the time field of StatusWithTime is the time of revocation, suspension or expiration respectively. The date returned for expiration should match the notAfter date of the certificate’s validity interval. The thisUpdate and nextUpdate fields define a recommended validity interval. This interval corresponds to the {thisUpdate, nextUpdate} interval in CRLs. Responses whose nextUpdate value is earlier than the local system time value SHOULD be considered unreliable. Responses whose thusUpdate time is earlier than the local system time SHOULD be considered unreliable. Responses where the nextUpdate value is not set are equivalant to a CRL with no time for nextUpdate (see section 2.3). 3.3 Mandatory and Optional Cryptographic Algorithms Clients that request OCSP services SHALL be capable of processing responses signed used DSA keys identified by the DSA sig-alg-oid specified in section 7.2.2 of PKIX Part 1. Clients SHOULD also be capable of processing RSA signatures as specified in section 7.2.1 of PKIX Part 1. OCSP responders SHALL support the SHA1 hash algorithm. 3.4 Extensions This section defines some standard extensions. Support for all extensions is OPTIONAL. For each extension, the definition indicates its syntax, processing performed by the OCSP Responder, and any extensions which are included in the corresponding response. 3.4.1 Nonce The nonce cryptographically binds a request and a response to prevent replay attacks. The nonce is included as one of the requestExtensions in requests, while in responses it would be included as one of the responseExtensions. In both the request and the response, the nonce will be identified by the object identifier id-pkix-ocsp-nonce, while the extnValue is the value of the nonce. id-pkix-ocsp-nonce OBJECT IDENTIFIER ::= { id-pkix-ocsp 2 } 3.4.2 Signed Requests This extension allows the requester to sign a request. The requestor includes an extension that has the signatureIdentifier, the actual bits of the signature and a sequence of certificates to allow the OCSP responder to verify the signature. The data to be signed is just the basic request (none of the extensions). The OCSP Responder can verify the signature, potentially using certificates that have been included Myers, Ankney, Malpani, Galperin, Adams [Page 8] INTERNET DRAFT March 1998 with the extension. The signature on a request will be identified by id- pkix-ocsp-signature, while the value will be SignatureData, where: id-pkix-ocsp-signature OBJECT IDENTIFIER ::= { id-pkix-ocsp 5 } SignatureData ::= SEQUENCE { signatureAlgorithm AlgorithmIdentifier, signature BIT STRING, certs [0] EXPLICIT SEQUENCE OF Certificate OPTIONAL } 3.4.3 CRL References It may be desirable for the OCSP responder to indicate the CRL on which a revoked or onHold certificate is found. This can be useful where OCSP is used between repositories, and also as an auditing mechanism. The CRL may be specified by a URL (the URL at which the CRL is available), a number (CRL number) or a time (the time at which the relevant CRL was created). These extensions will be specified as singleExtensions. The identifier for this extension will be id-pkix-ocsp-crl, while the value will be CrlID. id-pkix-ocsp-crl OBJECT IDENTIFIER ::= { id-pkix-ocsp 4 } CrlID ::= SEQUENCE { crlUrl [0] EXPLICIT IA5String OPTIONAL, crlNum [1] EXPLICIT INTEGER OPTIONAL, crlTime [2] EXPLICIT GeneralizedTime OPTIONAL } For the choice crlUrl, the IA5String will specify the URL at which the CRL is available. For crlNum, the INTEGER will specify the value of the CRL number extension of the relevant CRL. For crlTime, the GeneralizedTime will indicate the time at which the relevant CRL was issued. Note: There is no requirement to list certificates on a CRL in order to use OCSP to acquire revocation status on those certificates. Therefore inclusion of this extension in a request may yield no CRL information. The error value noCRL is defined for this instance. 3.4.4 Acceptable Response Types An OCSP client MAY wish to specify the kinds of response types it understands. To do so, it SHOULD use an extension with the OID id-pkix-ocsp-response, and the value AcceptableResponses. The OIDs included in AcceptableResponses are the OIDs of the various response types this client can accept (e.g., id-pkix-ocsp-basic). id-pkix-ocsp-response OBJECT IDENTIFIER ::= { id-pkix-ocsp 3 } AcceptableResponses ::= SEQUENCE OF { id OBJECT IDENTIFIER } As noted in section 3.3, OCSP responders SHALL be capable of recognizing and responding to the id-pkix-ocsp-basic response type. Correspondingly, Myers, Ankney, Malpani, Galperin, Adams [Page 9] INTERNET DRAFT March 1998 OCSP clients SHALL be capable of receiving and processing the id-pkix- ocsp-basic response type. 3.4.5 Other Extensions CRL Entry Extensions - specified in Section 5.3 of PKIX part I - are also supported as singleExtensions. 4. Security Considerations For this service to be effective, certificate using systems must connect to the certificate status service provider. In the event such a connection cannot be obtained, certificate-using systems could implement CRL processing logic as a fall-back position. A denial of service vulnerability is evident with respect to a flood of queries constructed to produce error responses. The production of a cryptographic signature significantly affects response generation cycle time, thereby exacerbating the situation. Unsigned error responses can be produced more rapidly and thus reduce the danger of this attack. However, unsigned error responses open up the protocol to another denial of service attack, where the attacker sends false error responses. The use of precomputed responses allows replay attacks in which an old (notRevoked) response is replayed prior to its expiration date but after the certificate has been revoked. Deployments of OCSP should carefully evaluate the benefit of precomputed responses against the probability of a replay attack and the costs associated its successful execution. 5. References [HTTP] Hypertext Transfer Protocol -- HTTP/1.0. T. Berners-Lee, R. Fielding & H. Frystyk, RFC 1945, May 1996. [ABNF] Augmented BNF for Syntax Specifications: ABNF. D. Crocker, P. Overell, RFC 2234, November 1997. [MUSTSHOULD] Key words for use in RFCs to Indicate Requirement Levels, S. Bradner, RFC 2119, March 1997. [URL] Uniform Resource Locators (URL), T. Berners-Lee, L. Masinter, M. McCahill, RFC 1738, December 1994. 7. Author’s Address Michael Myers VeriSign, Inc. 1390 Shorebird Way Mountain View, CA 94019 mmyers@verisign.com Myers, Ankney, Malpani, Galperin, Adams [Page 10] INTERNET DRAFT March 1998 Rich Ankney CertCo, LLC 13506 King Charles Dr. Chantilly, VA 20151 rankney@erols.com Ambarish Malpani ValiCert, Inc. 3160 W. Bayshore Drive Palo Alto, CA 94303 ambarish@valicert.com Slava Galperin Netscape Communications Corp. MV-068 501 E. Middlefield Rd. Mountain View, CA 94043 galperin@netscape.com Carlisle Adams Entrust Technologies 750 Heron Road, Suite E08 Ottawa, Ontario K1V 1A7 Canada cadams@entrust.com Appendix A A.1 OCSP over HTTP This section describes the formatting that will be done to the request and response to support HTTP. A.1.1 Request An OCSP request is an HTTP 1.0 POST method. The Content-Type header has the value "application/ocsp-request" while the body of the message is the DER encoding of the OCSPRequest. A.1.2 Response An HTTP-based OCSP response is composed of the appropriate HTTP headers, followed by the DER encoding of the OCSPResponse. The Content-Type header has the value "application/ocsp-response". The Content-Length header SHOULD specify the length of the response. Other HTTP headers MAY be present and MAY be ignored if not understood by the requestor. Myers, Ankney, Malpani, Galperin, Adams [Page 11] INTERNET DRAFT March 1998 Appendix B: OCSP in ASN.1 OCSPRequest ::= SEQUENCE { version [0] EXPLICIT Version DEFAULT v1, hashAlgorithm AlgorithmIdentifier, requestList SEQUENCE OF Request, requestExtensions [1] EXPLICIT Extensions OPTIONAL } Version ::= INTEGER { v1(0) } Request ::= CHOICE { certID [0] EXPLICIT CertID, cert [1] EXPLICIT Certificate } CertID ::= SEQUENCE { issuerNameAndKeyHash Hash, serialNumber CertificateSerialNumber } IssuerNameAndKey ::= SEQUENCE { issuer Name, issuerPublicKey SubjectPublicKeyInfo } Hash ::= OCTET STRING --hash of IssuerNameAndKey-- OCSPResponse ::= SEQUENCE { responseStatus OCSPResponseStatus, responseBytes [0] EXPLICIT ResponseBytes OPTIONAL } OCSPResponseStatus ::= ENUMERATED { successful (0), --Response has valid confirmations malformedRequest (1), --Illegal confirmation request internalError (2), --Internal error in issuer tryLater (3), --Try again later notFound (4), --Certificate not on record certRequired (5) --Must supply certificate } BasicOCSPResponse ::= SEQUENCE { tbsResponseData ResponseData, signatureAlgorithm AlgorithmIdentifier, signature BIT STRING, certs [1] EXPLICIT SEQUENCE OF Certificate OPTIONAL } ResponseData ::= SEQUENCE { version [0] EXPLICIT Version DEFAULT v1, reponderID ResponderID, responses SEQUENCE OF SingleResponse, responseExtensions [1] EXPLICIT Extensions OPTIONAL } ResponderID ::= CHOICE { byName [0] Name, byKey [1] KeyHash } KeyHash ::= KeyIdentifier –-SHA-1 hash as defined in PKIX Part.1 Myers, Ankney, Malpani, Galperin, Adams [Page 12] INTERNET DRAFT March 1998 SingleResponse ::= SEQUENCE { request Request, certStatus CertStatus, producedAt GeneralizedTime, nextUpdate [0] EXPLICIT GeneralizedTime OPTIONAL, singleExtensions [2] EXPLICIT Extensions OPTIONAL } CertStatus ::= CHOICE { certStatusType [0] EXPLICIT CertStatusType (notRevoked | onHold), statusWithTime [1] EXPLICIT StatusWithTime } StatusWithTime ::= SEQUENCE { certStatusType CertStatusType (revoked), time GeneralizedTime } CertStatusType ::= ENUMERATED { notRevoked (0), --This serial number is not revoked revoked (1), --Serial number was revoked onHold (2), --Cert is on hold expired (3) -- certificate is expired } --Extensions SignatureData ::= SEQUENCE { signatureAlgorithm AlgorithmIdentifier, signature BIT STRING, certs [0] EXPLICIT SEQUENCE OF Certificate OPTIONAL } AcceptableResponses ::= SEQUENCE OF { id OBJECT IDENTIFIER } CrlID ::= SEQUENCE { crlUrl [0] EXPLICIT IA5String OPTIONAL, crlNum [1] EXPLICIT INTEGER OPTIONAL, crlTime [2] EXPLICIT GeneralizedTime OPTIONAL } -- Object Identifiers id-pkix-ocsp OBJECT IDENTIFIER ::= { id-ad-ocsp } id-pkix-ocsp-basic OBJECT IDENTIFIER ::= { id-pkix-ocsp 1 } id-pkix-ocsp-nonce OBJECT IDENTIFIER ::= { id-pkix-ocsp 2 } id-pkix-ocsp-response OBJECT IDENTIFIER ::= { id-pkix-ocsp 3 } id-pkix-ocsp-crl OBJECT IDENTIFIER ::= { id-pkix-ocsp 4 } id-pkix-ocsp-signature OBJECT IDENTIFIER ::= { id-pkix-ocsp 5 } Myers, Ankney, Malpani, Galperin, Adams [Page 13]