Network Working Group P. Hallam-Baker Internet-Draft Default Deny Security Intended status: Proposed Standard S. Santesson Updates: 2560 (once approved) 3xA Security Expires: June 5, 2010 December 2, 2009 OCSP Algorithm Agility draft-ietf-pkix-ocspagility-05 Status of this Memo This Internet-Draft is submitted to IETF in full conformance with the provisions of BCP 78 and BCP 79. 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." The list of current Internet-Drafts can be accessed at http://www.ietf.org/ietf/1id-abstracts.txt. The list of Internet-Draft Shadow Directories can be accessed at http://www.ietf.org/shadow.html. Copyright and License Notice Copyright (c) 2009 IETF Trust and the persons identified as the document authors. All rights reserved. This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the BSD License. Hallam-Baker, et al. Expires June 5, 2010 [Page 1] Internet-Draft OCSP Algorithm Agility December 2, 2009 Abstract The OSCP specification defined in RFC 2560 requires server responses to be signed but does not specify a mechanism for selecting the signature algorithm to be used leading to possible interoperability failures in contexts where multiple signature algorithms are in use. This document specifies an algorithm for server signature algorithm selection and an extension that allows a client to advise a server that specific signature algorithms are supported. Table of Contents 1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.1 Requirements Language . . . . . . . . . . . . . . . . . . . 3 2 OCSP Algorithm Agility Requirements . . . . . . . . . . . . . . 3 3 Updates to Mandatory and Optional Cryptographic Algorithms . . . 4 4 Client Indication of Preferred Signature Algorithms . . . . . . 5 5 Responder Signature Algorithm Selection . . . . . . . . . . . . 6 5.1 Dynamic Response . . . . . . . . . . . . . . . . . . . . . 6 5.2 Static Response . . . . . . . . . . . . . . . . . . . . . . 6 6 Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 7 7 IANA Considerations . . . . . . . . . . . . . . . . . . . . . . 7 8 Security Considerations . . . . . . . . . . . . . . . . . . . . 7 8.1 Use of insecure algorithms . . . . . . . . . . . . . . . . 7 8.2 Man in the Middle Downgrade Attack . . . . . . . . . . . . 8 8.3. Denial of Service Attack . . . . . . . . . . . . . . . . . 8 9 References . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 9.1 Normative References . . . . . . . . . . . . . . . . . . . 9 9.2 Informative References . . . . . . . . . . . . . . . . . . 9 Appendix A - ASN.1 Modules . . . . . . . . . . . . . . . . . . . 10 A.1 ASN.1 Module . . . . . . . . . . . . . . . . . . . . . . 10 A.2 1988 ASN.1 Module . . . . . . . . . . . . . . . . . . . . 11 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 12 Hallam-Baker, et al. Expires June 5, 2010 [Page 2] Internet-Draft OCSP Algorithm Agility December 2, 2009 1 Introduction 1.1 Requirements Language The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 [RFC2119]. 2 OCSP Algorithm Agility Requirements OCSP RFC 2560 [RFC2560] defines a protocol for obtaining certificate status information from an online service. An OCSP Responder may or may not be issued an OCSP Responder certificate by the CA that issued the certificate whose status is being queried. An OCSP Responder may provide pre-signed OCSP responses or may sign responses when queried. RFC 2560 [RFC2560] specifies a means for an OCSP responder to indicate the signature and digest algorithms used in a response but not how those algorithms are specified. The only algorithm mandated by the protocol specification is that the OCSP client SHALL support the DSA sig-alg-oid specified in section 7.2.2 of [RFC2459] and SHOULD be capable of processing RSA signatures as specified in section 7.2.1 of [RFC2459]. The only requirement placed on responders is that they SHALL support the SHA1 hashing algorithm. Since algorithms other than the mandatory to implement algorithms are allowed and since the client currently has no mechanism to indicate it's algorithm preferences, there is always a risk that a server choosing a non mandatory algorithm, generates a response that the client may not support. While an OCSP Responder may apply rules such as using the signature algorithm employed by the CA for signing CRLs and certificates, such rules may fail in common situations such as: o Algorithm used to sign the CRLs and certificates may not be consistent with key pair being used by the OCSP Responder to sign responses. o A responder cannot draw any conclusions from a request for an unknown certificate. The last criterion cannot be resolved through the information available from in-band signaling using the RFC 2560 [RFC2560] protocol without modification. In addition, an OCSP Responder may wish to employ different signature Hallam-Baker, et al. Expires June 5, 2010 [Page 3] Internet-Draft OCSP Algorithm Agility December 2, 2009 algorithms than the the one used by the CA to sign certificates and CRLs for several reasons: o The responder may intentionally employ an algorithm for certificate status response that is less computationally demanding than for signing the certificate itself. o An implementation may intentionally wish to guard against the possibility of a compromise resulting from a signature algorithm compromise by employing two separate signature algorithms. This document describes: o A mechanism that allows a client to indicate the set of preferred signature algorithms. o An algorithm for signature algorithm selection that maximizes the probability of successful operation in the case that no supported preferred algorithm(s) are specified. 3 Updates to Mandatory and Optional Cryptographic Algorithms Section 4.3 "Mandatory and Optional Cryptographic Algorithms" of RFC 2560 [RFC2560] is updated as follows: OLD: 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 [RFC2459]. Clients SHOULD also be capable of processing RSA signatures as specified in section 7.2.1 of [RFC2459]. OCSP responders SHALL support the SHA1 hashing algorithm. NEW: Clients that request OCSP services SHALL be capable of processing responses signed using RSA with SHA-1 (identified by sha1WithRSAEncryption OID specified in [RFC3279]) and RSA with SHA-256 (identified by sha256WithRSAEncryption OID specified in [RFC4055]). Clients SHOULD also be capable of processing responses signed using DSA keys (identified by the id-dsa-with- sha1 OID specified in [RFC3279]). Clients MAY support other algorithms. Hallam-Baker, et al. Expires June 5, 2010 [Page 4] Internet-Draft OCSP Algorithm Agility December 2, 2009 4 Client Indication of Preferred Signature Algorithms A client MAY declare a preferred set of algorithms in a request by including a preferred signature algorithms extension in requestExtensions of the OCSPRequest [RFC2560]. id-pkix-ocsp-preferred-signature-algorithms OBJECT IDENTIFIER ::= { id-pkix-ocsp x } PreferredSignatureAlgorithms ::= SEQUENCE OF PreferredSignatureAlgorithm PreferredSignatureAlgorithm ::= SEQUENCE { sigIdentifier AlgorithmIdentifier, certIdentifier AlgorithmIdentifier OPTIONAL } The syntax of AlgorithmIdentifier is defined in section 4.1.1.2 of RFC 5280 [RFC5280] sigIdentifier specifies the signature algorithm the client prefers, e.g. algorithm=ecdsa-with-sha256. Parameters are absent for most common signature algorithms. certIdentifier specifies the subject public key algorithm identifier the client prefers in the server's certificate used to validate the OCSP response. e.g. algorithm=id-ecPublicKey and parameters= secp256r1. certIdentifier is OPTIONAL and provides means to specify parameters necessary to distinguish among different usages of a particular algorithm, e.g. it may be used by the client to specify what curve it supports for a given elliptic curve algorithm. The client MUST support each of the specified preferred signature algorithms and the client MUST specify the algorithms in the order of preference. The server SHOULD use one of the preferred signature algorithms for signing OCSP responses to the requesting client. Hallam-Baker, et al. Expires June 5, 2010 [Page 5] Internet-Draft OCSP Algorithm Agility December 2, 2009 5 Responder Signature Algorithm Selection RFC 2560 [RFC2560] does not specify a mechanism for deciding the signature algorithm to be used in an OCSP response. As previously noted this does not provide a sufficient degree of certainty as to the algorithm selected to guarantee interoperability. 5.1 Dynamic Response A responder MAY maximize the potential for ensuring interoperability by selecting a supported signature algorithm using the following order of precedence, as long as the selected algorithm meets all security requirements of the OCSP responder, where the first method has the highest precedence: 1. Using an algorithm specified as a preferred signing algorithm in the client request 2. Using the signing algorithm used to sign a CRL issued by the certificate issuer providing status information for the certificate specified by CertID 3. Using the signing algorithm used to sign the OCSPRequest 4. Using a signature algorithm that has been advertised as being the default signature algorithm for the signing service using an out of band mechanism 5. Using a mandatory or recommended signing algorithm specified for the version of the OCSP protocol in use A responder SHOULD always apply the lowest numbered selection mechanism that is known, supported and meets the responder's criteria for cryptographic algorithm strength. 5.2 Static Response For purposes of efficiency, an OCSP responder is permitted to generate static responses in advance of a request. The case may not permit the responder to make use of the client request data during the response generation, however the responder still uses the client request data during the selection of the pre-generated response to be returned. Responders may use the historical client requests as part of the input to the decisions of what different algorithms should be used to sign the pre-generated responses. Hallam-Baker, et al. Expires June 5, 2010 [Page 6] Internet-Draft OCSP Algorithm Agility December 2, 2009 6 Acknowledgements The authors acknowledges Santosh Chokhani for the helpful comments made on earlier drafts, Sean Turner for proposing the syntax for algorithm identifiers and Jim Schaad for providing and testing the ASN.1 module in Annex A. 7 IANA Considerations This document requires no actions by IANA. 8 Security Considerations The mechanism used to choose the response signing algorithm MUST be considered to be sufficiently secure against cryptanalytic attack for the intended application. In most applications it is sufficient for the signing algorithm to be at least as secure as the signing algorithm used to sign the original certificate whose status is being queried. This criteria may not hold in long term archival applications however in which the status of a certificate is being queried for a date in the distant past, long after the signing algorithm has ceased being considered trustworthy. 8.1 Use of insecure algorithms It is not always possible for a responder to generate a response that the client is expected to understand and meets contemporary standards for cryptographic security. In such cases an application MUST balance the risk of employing a compromised security solution and the cost of mandating an upgrade, including the risk that the alternative chosen by end users will offer even less security or no security. In archival applications it is quite possible that an OCSP responder might be asked to report the validity of a certificate on a date in the distant past. Such a certificate might employ a signing method that is no longer considered acceptably secure. In such circumstances the responder MUST NOT generate a signature for a signing mechanism that is considered unacceptably insecure. A client MUST accept any signing algorithm in a response that it specified as a preferred signing algorithm in the request. It follows therefore that a client MUST NOT specify as a preferred signing algorithm any signing algorithm that is either not supported or not considered acceptably secure. Hallam-Baker, et al. Expires June 5, 2010 [Page 7] Internet-Draft OCSP Algorithm Agility December 2, 2009 8.2 Man in the Middle Downgrade Attack The mechanism to support client indication of preferred signature algorithms is not protected against a man in the middle downgrade attack. This constraint is not considered to be a significant security concern since the OCSP Responder MUST NOT sign OCSP Responses using weak algorithms even if requested by the client. In addition, the client can reject OCSP responses that do not meet its own criteria for acceptable cryptographic security no matter what mechanism is used to determine the signing algorithm of the response. 8.3. Denial of Service Attack Algorithm agility mechanisms defined in this document introduces a slightly increased attack surface for Denial of Service attacks where the client request is altered to require algorithms that are not supported by the server, alternatively does not match pre-generated responses. Hallam-Baker, et al. Expires June 5, 2010 [Page 8] Internet-Draft OCSP Algorithm Agility December 2, 2009 9 References 9.1 Normative References [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997. [RFC2560] Myers, M., Ankney, R., Malpani, A., Galperin, S., and C. Adams, "X.509 Internet Public Key Infrastructure Online Certificate Status Protocol - OCSP", RFC 2560, June 1999. [RFC3279] W. Polk, R. Housley, L. Bassham, "Algorithms and Identifiers for the Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile", RFC 3279, April 2002. [RFC4055] J. Schaad, B. Kaliski, R. Housley, "Additional Algorithms and Identifiers for RSA Cryptography for use in the Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile", RFC 4055, June 2005. [RFC5280] D. Cooper, S. Santesson, S. Farrell, S. Boeyen, R. Housley and W. Polk, "Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile", RFC 5280, May 2008. 9.2 Informative References [RFC2459] R. Housley, W. Ford, W. Polk, D. Solo, "Internet X.509 Public Key Infrastructure - Certificate and CRL Profile", January 1999 Hallam-Baker, et al. Expires June 5, 2010 [Page 9] Internet-Draft OCSP Algorithm Agility December 2, 2009 Appendix A - ASN.1 Modules A.1 ASN.1 Module OCSP-AGILITY-2009 { TBD } DEFINITIONS EXPLICIT TAGS ::= BEGIN EXPORTS ALL; -- export all items from this module IMPORTS id-pkix-ocsp FROM OCSP-2009 -- From OCSP [RFC2560] { iso(1) identified-organization(3) dod(6) internet(1) security(5) mechanisms(5) pkix(7) id-mod(0) id-mod-ocsp-02(48) } AlgorithmIdentifier{}, SIGNATURE-ALGORITHM FROM AlgorithmInformation-2009 -- From [NEWASN] { iso(1) identified-organization(3) dod(6) internet(1) security(5) mechanisms(5) pkix(7) id-mod(0) id-mod-algorithmInformation-02(58) } EXTENSION FROM PKIX-CommonTypes-2009 -- From [NEWASN] { iso(1) identified-organization(3) dod(6) internet(1) security(5) mechanisms(5) pkix(7) id-mod(0) id-mod-pkixCommon-02(57)} ; -- -- Add re-preferred-signature-algorithms to the set of extensions -- for TBSRequest.requestExtensions -- re-preferred-signature-algorithms EXTENSION ::= { SYNTAX PreferredSignatureAlgorithm IDENTIFIED BY id-pkix-ocsp-preferred-signature-algorithms } id-pkix-ocsp-preferred-signature-algorithms OBJECT IDENTIFIER ::= { id-pkix-ocsp TBD } PreferredSignatureAlgorithms ::= SEQUENCE OF PreferredSignatureAlgorithm PreferredSignatureAlgorithm ::= SEQUENCE { sigIdentifier AlgorithmIdentifier{SIGNATURE-ALGORITHM, {...}}, certIdentifier AlgorithmIdentifier{SIGNATURE-ALGORITHM, {...}} OPTIONAL } END Hallam-Baker, et al. Expires June 5, 2010 [Page 10] Internet-Draft OCSP Algorithm Agility December 2, 2009 A.2 1988 ASN.1 Module OCSP-AGILITY-88 { TBD } DEFINITIONS EXPLICIT TAGS ::= BEGIN -- EXPORTS ALL; IMPORTS id-pkix-ocsp FROM OCSP {iso(1) identified-organization(3) dod(6) internet(1) security(5) mechanisms(5) pkix(7) id-mod(0) id-mod-ocsp(14)} AlgorithmIdentifier FROM PKIX1Explicit88 { iso(1) identified-organization(3) dod(6) internet(1) security(5) mechanisms(5) pkix(7) id-mod(0) id-pkix1-explicit(18) }; id-pkix-ocsp-preferred-signature-algorithms OBJECT IDENTIFIER ::= { id-pkix-ocsp 999 } PreferredSignatureAlgorithms ::= SEQUENCE OF PreferredSignatureAlgorithm PreferredSignatureAlgorithm ::= SEQUENCE { sigIdentifier AlgorithmIdentifier, certIdentifier AlgorithmIdentifier OPTIONAL } END Hallam-Baker, et al. Expires June 5, 2010 [Page 11] Internet-Draft OCSP Algorithm Agility December 2, 2009 Author's Address Phillip Hallam-Baker Default Deny Security Email: phill@hallambaker.com Stefan Santesson 3xA Security AB Sweden Email: sts@aaa-sec.com Hallam-Baker, et al. Expires June 5, 2010 [Page 12]