IP Security Maintenance and Extensions T. Kivinen (ipsecme) INSIDE Secure Internet-DraftMarch 28, 2014J. Snyder Updates: RFC 5996 (if approved) Opus One Intended status: Standards Track May 7, 2014 Expires:September 29,November 8, 2014 Signature Authentication in IKEv2draft-kivinen-ipsecme-signature-auth-05.txtdraft-kivinen-ipsecme-signature-auth-06.txt Abstract The Internet Key Exchange Version 2 (IKEv2) protocol has limited support for the Elliptic Curve Digital Signature Algorithm (ECDSA). The current version only includes support for three Elliptic Curve groups, and there is a fixed hash algorithm tied to eachcurve.group. This document generalizestheIKEv2 signature supportso it can supportto allow any signature method supported by the PKIX and also adds signature hash algorithm negotiation. This is a generic mechanism, and is not limited to ECDSA, but can also be used with other signature algorithms. Status of this Memo This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79. Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet- Drafts is at http://datatracker.ietf.org/drafts/current/. 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." This Internet-Draft will expire onSeptember 29,November 8, 2014. Copyright Notice Copyright (c) 2014 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 Simplified BSD License. Table of Contents 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 4 3. Authentication Payload . . . . . . . . . . . . . . . . . . . . 4 4. Hash Algorithm Notification . . . . . . . . . . . . . . . . .67 5. Selecting the Public Key Algorithm . . . . . . . . . . . . . .. . 78 6. Security Considerations . . . . . . . . . . . . . . . . . . . 8 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 9 8. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . .910 9. References . . . . . . . . . . . . . . . . . . . . . . . . . .910 9.1. Normative References . . . . . . . . . . . . . . . . . . .910 9.2. Informative References . . . . . . . . . . . . . . . . . . 10 Appendix A. Commonly used ASN.1 objects . . . . . . . . . . . . . 11 A.1. PKCS#1 1.5 RSA Encryption . . . . . . . . . . . . . . . .1112 A.1.1. sha1WithRSAEncryption . . . . . . . . . . . . . . . .1112 A.1.2. sha256WithRSAEncryption . . . . . . . . . . . . . . . 12 A.1.3. sha384WithRSAEncryption . . . . . . . . . . . . . . . 12 A.1.4. sha512WithRSAEncryption . . . . . . . . . . . . . . .1213 A.2. DSA . . . . . . . . . . . . . . . . . . . . . . . . . . .1213 A.2.1. dsa-with-sha1 . . . . . . . . . . . . . . . . . . . .1213 A.2.2. dsa-with-sha256 . . . . . . . . . . . . . . . . . . . 13 A.3. ECDSA . . . . . . . . . . . . . . . . . . . . . . . . . . 13 A.3.1. ecdsa-with-sha1 . . . . . . . . . . . . . . . . . . .1314 A.3.2. ecdsa-with-sha256 . . . . . . . . . . . . . . . . . .1314 A.3.3. ecdsa-with-sha384 . . . . . . . . . . . . . . . . . . 14 A.3.4. ecdsa-with-sha512 . . . . . . . . . . . . . . . . . . 14 A.4. RSASSA-PSS . . . . . . . . . . . . . . . . . . . . . . . .1415 A.4.1. RSASSA-PSS with empty parameters . . . . . . . . . . .1415 A.4.2. RSASSA-PSS with default parameters . . . . . . . . . . 15 A.4.3. RSASSA-PSS with SHA-256 . . . . . . . . . . . . . . .1516 Appendix B. IKEv2 Payload Example . . . . . . . . . . . . . . . . 16 B.1. sha1WithRSAEncryption . . . . . . . . . . . . . . . . . .16 Author's Address .17 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 17 1. Introduction This document adds a new IKEv2 ([RFC5996]) authentication method to supportall kinds ofsignaturemethods.methods in a more general way. The currentsignature basedsignature-based authentication methods intheIKEv2 areper algorithm,per-algorithm, i.e. there is one for RSADigitaldigital signatures, one for DSSDigital Signaturesdigital signatures (using SHA-1) and three for different ECDSAcurvescurves, each tied to exactly one hash algorithm. This designstarts to beis cumbersome when more signature algorithms, hash algorithms and elliptic curvesareneed to be supported: o The RSADigital Signaturesdigital signature format intheIKEv2 is specified to use RSASSA-PKCS1-v1_5 padding, butAdditional RSA"Additional Algorithms and Identifiers forX.509 documentRSA Cryptography for use in PKIX Profile" ([RFC4055])) recommends the use of the newer RSASSA_PSS (See section 5 of [RFC4055]) instead. o With ECDSA and DSS there is no way to extract the hash algorithm from thesignature, thus,signature. Thus, for each new hash function to be supported with ECDSA orDSADSA, new authentication methods would be needed. Support for new hash functions is particularly needed for DSS because the current restriction to SHA-1 limits its security, meaning there is no point of using long keys withit.SHA-1. o The tying of ECDSA authentication methods to particular elliptic curve groups requires definition of additional methods for each new group.ByThe combination of new ECDSA groupswith variousand hash functions will cause the number of required authentication methodsmay growto become unmanageable. Furthermore, the restriction of ECDSA authentication to a specific group is inconsistent with the approach taken with DSS. With the selection of SHA-3, itis seen that itmight be possible thatin the future thea signaturemethods aremethod can be used with either SHA-3also, not onlyor SHA-2. This means that a new mechanism for negotiating the hash algorithm forthea signaturealgorithmsalgorithm is needed. Thisdocumentsdocument specifies twothings, one is onethings: 1. A new authenticationmethod,method which includes enough information inside the Authentication payload data so that the signature hash algorithm can be extractedfrom there(see Section 3).The another thing is2. A method toadd indication ofindicate supported signature hash algorithmsby the peer(see Section 4). This allows the peer to know which hash algorithms are supported by the other end and use one of them (provided one is allowed by policy). There is noneedrequirement to actually negotiate one common hash algorithm, as different hash algorithms can be used in different directions if needed. The new digital signature methodneeds to beis flexible enough to include all current signature methods (RSA, DSA, ECDSA, RSASSA-PSS,etc),etc.), andalso allow addingadd newthingsmethods (ECGDSA, ElGamal, etc.) in thefuture (ECGDSA, ElGamal etc). Forfuture. To support this flexibility, the signature algorithm is specified in the same wayas thethat PKIX ([RFC5280]) specifies the signature of the Digital Certificate,i.e. there isby placing a simple ASN.1 object before the actual signature data. This ASN.1 object containsthean OID specifying thealgorithm,algorithm and associatedparameters to it. In normal case theparameters. When an IKEv2implementationsimplementation supports a fixedamountset of signaturemethods,methods with commonly used parameters,soit is acceptable for the implementation tojusttreatthisthe ASN.1 object as a binary blob whichiscan be compared against the fixed set of knownvalues, or the implementationvalues. IKEv2 implementations can also parse the ASN.1 and extractinformation from there.the signature algorithm and associated parameters. 2. Terminology 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 [RFC2119]. 3. Authentication Payload This document specifies a new "Digital Signature" authentication method. This method can be used with anytypestype ofsignatures.signature. As the authentication methods are not negotiated intheIKEv2, the peer is only allowed to use this authentication method if theSIGNATURE_HASH_ALGORITHMSNotifyPayloadpayload of type SIGNATURE_HASH_ALGORITHMS has been sent andreceived.received by each peer. In thisnewly definedauthentication method, the Authentication Data field inside the Authentication Payload does not just includeonlythe signature value,but insteadas do other existing IKEv2 Authentication Payloads. Instead, the signature value is prefixed withthean ASN.1 objectcontainingindicating the algorithm used to generate the signature. The ASN.1 object contains the algorithm identification OID,and this OIDwhich identifies both the signature algorithm and the hash used when calculating the signature. In addition to theOID there isOID, the ASN.1 object can contain optional parameters which might be needed for algorithmslike RSASSA-PSS.such as RSASSA-PSS (Section 8.1 of [RFC3447]). To make implementations easier, the ASN.1 object is prefixed by the 8-bit length field. This length field allows simple implementations tobe able toknow the length of the ASN.1 object without the need to parse it, so they can use it as a binary blobwhich isto be compared againsttheknown signature algorithm ASN.1objects, i.e. they doobjects. Thus, simple implementations may not need to be able to parse or generate ASN.1 objects. See Appendix A for commonly used ASN.1 objects. The ASN.1 used here is the same ASN.1which isused in the AlgorithmIdentifier ofthePKIX (Section 4.1.1.2 of[RFC5280])[RFC5280]), encoded using distinguished encoding rules (DER) [CCITT.X690.2002]. The algorithm OID inside the ASN.1 specifies the signature algorithm and the hash function, both of which are needed for signature verification.The EC curve is always known by the peer because it needs to have the certificate or the public key of the other end before it can do signature verification and public key specifies the curve. CurrentlyCurrently, only the RSASSA-PSS signature algorithm uses theparameters, for all othersoptional parameters. For other signature algorithms, the parametersisare either NULL or missing. Note, that for some algorithms thereisare two possible ASN.1encoding possible,encodings, one with optional parametersbeingincluded but set to NULL andothersthe other where thewholeoptional parametersisare omitted.This isThese dual encodings exist becausesomeof the way those algorithms arespecified that way.specified. When encoding theASN.1ASN.1, implementationsshouldSHOULD use the preferredway, i.e. ifformat called for by the algorithm specification. If the algorithm specification says "preferredPresent" thenparameterthe parameters object needs to bethere (i.e.present, although it will be NULL if no parametersis specified), and if itare specified. If the algorithm specification says "preferredAbsent", then thewholeentire optional parameters object is missing. The Authentication payload is defined in IKEv2 as follows: 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Next Payload |C| RESERVED | Payload Length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Auth Method | RESERVED | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | ~ Authentication Data ~ | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Figure 1: Authentication Payload Format. o Auth Method (1 octet) - Specifies the method of authentication used. Mechanism Value ----------------------------------------------------------------- Digital Signature <TBD> Computed as specified in Section 2.15 of RFC5996 using a private key associated with the public key sent incertificatethe Certificate payload, and using one of the hash algorithms sent by the other end in theSIGNATURE_HASH_ALGORITHMS notify payload.Notify payload of type SIGNATURE_HASH_ALGORITHMS. If both ends send and receive SIGNATURE_HASH_ALGORITHMS Notify payloads and signature authentication is to be used, thenthisthe authentication method specified in this Authentication payload MUST be used. The format of the Authentication Data fieldhas bitis differentformat than infrom other Authentication methods(see below).and is specified below. o Authentication Data (variable length) - see Section 2.15 of RFC5996. For "Digital Signature"formatformat, the Authentication datacontains special formatis formatted as follows: 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ASN.1 Length | AlgorithmIdentifier ASN.1 object | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | ~ AlgorithmIdentifier ASN.1 object continuing ~ | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | ~ Signature Value ~ | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Figure 2: Authentication Data Format.Where the* ASN.1 Lengthis(1 octet) - This field contains the length of the ASN.1 encoded AlgorithmIdentifierobject, and after that isobject. * Algorithm Identifier (variable length) - This field contains theactualAlgorithmIdentifier ASN.1object, followed byobject. * Signature Value (variable length) - This field contains the actual signature value. There is no padding between ASN.1 object and signature value. Forthehashtruncationtruncation, the methodof X9.62specified in ANSI X9.62:2005 ([X9.62]) MUST be used. 4. Hash Algorithm Notification The supported hash algorithms that can be used for the signature algorithms arenowindicated withnewa Notify payload of type SIGNATURE_HASH_ALGORITHMSNotification Payloadsent inside the IKE_SA_INIT exchange. This notification also implicitly indicatesthesupport of the newsignature algorithm method, i.e. sending this notification tells that new"Digital Signature"authentication method is supported and that followingalgorithm method, as well as the list of hash functionsaresupported by the sending peer. Both endssendssend their list of supportedhash-algorithms and whenhash algorithms. When calculatingsignaturethe digital signature, a peer MUST pick one algorithm sent by the other peer.Note,Note that different algorithms can be used in different directions. The algorithm OIDmatchingindicating the selected hash algorithm (and signature algorithm) used when calculating the signature is sent inside the Authentication Data field of the AuthenticationPayload.payload (with Auth Method of "Digital Signature" as defined above). 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Next Payload |C| RESERVED | Payload Length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Protocol ID | SPI Size | Notify Message Type | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | ~ Security Parameter Index (SPI) ~ | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | ~ Notification Data ~ | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Figure 3: Notify Payload Format. The Notify payload format is defined in RFC5996 section 3.10. When a Notify payload of type SIGNATURE_HASH_ALGORITHMS is sent, the Protocol ID field is set to 0, the SPI Size is set to 0, and the Notify Message Type is set to <TBD from status types>. The Notification Datavaluefield contains the list of 16-bit hash algorithm identifiers from thenewly createdHash Algorithm Identifiers for the IKEv2 IANA registry. There is no padding between the hash algorithm identifiers. 5. Selecting the Public Key Algorithm This specification does not provide a way for the peers to indicate the public / private key pair types they have.I.e.This raises the question of howcanthe responderselectselects a public / private key pair type that the initiator supports.There is already several ways thisThis information can be foundin common cases.by several methods. Oneof the waysmethod tofind out whichsignal the key the initiator wants the responder to use is to indicate that in the IDr payload of the IKE_AUTH requestofsent by the initiator.I.eIn this case, the initiator indicates that it wants the responder to usecertaina particular public / private key pair by sending an IDr payload which indicates that information.This meansIn this case, the responderneeds to havehas different identitiesconfigured andconfigured, with each of those identitiesneeds to be tied upassociated tocertaina public / private key(oror keytype).type. Anotherwaymethod toget this information is fromascertain the key the initiator wants the responder to use is through a Certificate Request payload sent by the initiator. Forexample ifexample, the initiatorindicatescould indicate inhisthe Certificate Request payload that ittrusttrusts a CAwhich issigned bythean ECDSAkey,key. This indication implies thatwill also indicate itthe initiator canbeprocess ECDSA signatures,thuswhich means that the responder can safely use ECDSA keys whenauthenticating himself. Responder can alsoauthenticating. A third method is for the responder to check the key type used by the initiator, and use same key typethanthat the initiator used. This method does not workin caseif the initiator is using shared secret or EAPauthentication, as in that case itauthentication (i.e., is not using publickey.keys). If the initiator is using public keyauthentication himselfauthentication, this method ismost likelythe best way for the responder tofindascertain the type of key the initiator supports.In caseIf the initiator uses a public key type that the responderwilldoes not support, the responderwill replyreplies with a Notify message withAUTHENTICATION_FAILED error.error type AUTHENTICATION_FAILED. If the initiator has multiple differentkeyskeys, itcanmay try a different key (and perhaps a different key type) until it finds a key that the other end accepts.InitiatorThe initiator can also use the Certificate Request payload sent by the responder to helpdecidingdecide which public key should be tried. In normalcase ifcases, when the initiator has multiple public keys,there isout-of-band configurationthat willis used to selectone of thosea public key for eachconnection, so the proper key is know by configuration.connection. 6. Security Considerations The "Recommendations for Key Management" ([NIST800-57]) table 2 combined with table 3 gives recommendations for how to select suitable hash functions for the signature. This new digital signature method does not tie theEC curveElliptic Curve tothea specific hash function, which was done in the old IKEv2 ECDSA methods. This means it is possible touse 512-bit EC curve with SHA1, i.e. this allows mixingmix different security levels. For example, it is possible to use 512-bit Elliptic Curve with SHA1. This means that the security of the authentication method is the security of the weakestof componentscomponent (signature algorithm, hash algorithm, or curve). Thismight makecomplicates the security analysis of thesystem bit more complex. Note,system. Note that this kind of mixing ofthesecurity levels can be disallowed bythepolicy. The hash algorithm registry does not include MD5 as a supported hash algorithm, as it is not considered safe enough for signature use ([WY05]). The current IKEv2 protocol uses RSASSA-PKCS1-v1_5, whichdo have some problemshas known security vulnerabilities ([KA08], [ME01]) and does not allow using newer padding methodslikesuch as RSASSA-PSS.ThisThe new method described in this RFC allows using other padding methods. The current IKEv2 protocol only allowsusinguse of normal DSA with SHA-1, which means the security of theregular DSAauthentication is limited to the security of SHA-1. This newmethodsmethod allows using longer keys and longer hashes with DSA. 7. IANA Considerations This document creates a new IANA registry for IKEv2 Hash Algorithms. Changes and additions to this registryisare by expert review. The initial values of this registryis:are: Hash Algorithm Value -------------- ----- RESERVED 0 SHA1 1 SHA2-256 2 SHA2-384 3 SHA2-512 4 MD5 is not includedtoin the hash algorithm list as it is not considered safe enough for signature hash uses. Values 5-1023 are reserved to IANA. Values 1024-65535 are for private use among mutually consenting parties. This specification alsoallocatesadds one newIKEv2"IKEv2 Notify Message Types - StatusTypesTypes" value fortheSIGNATURE_HASH_ALGORITHMS, and adds one new "IKEv2 Authentication Method" value for "DigitalSignature" to the IKEv2 Authentication Method registry.Signature". 8. Acknowledgements Most of this work was based on the work done in the IPsecME design team for the ECDSA. The design team members were: DanHarking,Harkins, Johannes Merkle, Tero Kivinen, David McGrew, and Yoav Nir. 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. [RFC5280] Cooper, D., Santesson, S., Farrell, S., Boeyen, S., Housley, R., and W. Polk, "Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile", RFC 5280, May 2008. [RFC5996] Kaufman, C., Hoffman, P., Nir, Y., and P. Eronen, "Internet Key Exchange Protocol Version 2 (IKEv2)", RFC 5996, September 2010. 9.2. Informative References [CCITT.X690.2002] International Telephone and Telegraph Consultative Committee, "ASN.1 encoding rules: Specification of basic encoding Rules (BER), Canonical encoding rules (CER) and Distinguished encoding rules (DER)", CCITT Recommendation X.690, July 2002. [KA08] Kuehn, U., Pyshkin, A., Tews, E., and R. Weinmann, "Variants of Bleichenbacher's Low-Exponent Attack on PKCS#1 RSA Signatures", Proc. Sicherheit 2008 pp.97-109. [ME01] Menezes, A., "Evaluation of Security Level of Cryptography: RSA-OAEP, RSA-PSS, RSA Signature", December 2001. [NIST800-57] Barker, E., Barker, W., Burr, W., Polk, W., and M. Smid, "Recommendations for Key Management", NIST SP 800-57, March 2007. [RFC3279] Bassham, L., Polk, W., and R. Housley, "Algorithms and Identifiers for the Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile", RFC 3279, April 2002. [RFC3447] Jonsson, J. and B. Kaliski, "Public-Key Cryptography Standards (PKCS) #1: RSA Cryptography Specifications Version 2.1", RFC 3447, February 2003. [RFC4055] Schaad, J., Kaliski, B., and 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. [RFC5480] Turner, S., Brown, D., Yiu, K., Housley, R., and T. Polk, "Elliptic Curve Cryptography Subject Public Key Information", RFC 5480, March 2009. [RFC5758] Dang, Q., Santesson, S., Moriarty, K., Brown, D., and T. Polk, "Internet X.509 Public Key Infrastructure: Additional Algorithms and Identifiers for DSA and ECDSA", RFC 5758, January 2010. [RFC5912] Hoffman, P. and J. Schaad, "New ASN.1 Modules for the Public Key Infrastructure Using X.509 (PKIX)", RFC 5912, June 2010. [WY05] Wang, X. and H. Yu, "How to break MD5 and other hash functions", Proceedings of EuroCrypt 2005, Lecture Notes in Computer Science Vol. 3494, 2005. [X9.62] American National Standards Institute, "Public Key Cryptography for the Financial Services Industry: The Elliptic Curve Digital Signature Algorithm (ECDSA)", ANSI X9.62, November 2005. Appendix A. Commonly used ASN.1 objects This section lists commonly used ASN.1 objects in binary form. This section isnot-normative,not normative, and these values should only be used asexamples, i.e. if this and the actual specification ofexamples. If thealgorithmASN.1 objectis differentlisted in Appendix A and theactual formatASN.1 object specifiedinby theactualalgorithm differ, then the algorithm specificationneeds tomust be used. These values are taken fromthe New"New ASN.1 Modules for the Public Key Infrastructure Using X.509 (PKIX)" ([RFC5912]). A.1. PKCS#1 1.5 RSA EncryptionTheseThe algorithm identifiers here include several different ASN.1 objects with different hash algorithms.In thisThis documentweonlyincludeincludes the commonly usedonesones, i.e. theoneones usingSHA-1,SHA-1 or SHA-2 as hash function. Someof thoseother algorithms(MD2,(such as MD2 and MD5)specified for thisare not safe enough to be used as signature hashalgorithm,algorithms, andsomeareomitted as there is no hash algorithm specified in the ouromitted. The IANA registry does not have code points forthem. Note,these other algorithms with RSA Encryption. Note that thereisare no optional parameters in any ofthese,these algorithm identifiers, but allspecifiedincluded hereneeds to haveneed NULL optional parameters present in the ASN.1. SeeAlgorithms"Algorithms and Identifiers for PKIXProfileProfile" ([RFC3279]) andAdditional"Additional Algorithms and Identifiers for RSA Cryptography for use in PKIXProfileProfile" ([RFC4055]) for more information. A.1.1. sha1WithRSAEncryption sha1WithRSAEncryption OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-1(1) 5 } Parameters are required, and they must be NULL. Name = sha1WithRSAEncryption, oid = 1.2.840.113549.1.1.5 Length = 15 0000: 300d 0609 2a86 4886 f70d 0101 0505 00 A.1.2. sha256WithRSAEncryption sha256WithRSAEncryption OBJECT IDENTIFIER ::= { pkcs-1 11 } Parameters are required, and they must be NULL. Name = sha256WithRSAEncryption, oid = 1.2.840.113549.1.1.11 Length = 15 0000: 300d 0609 2a86 4886 f70d 0101 0b05 00 A.1.3. sha384WithRSAEncryption sha384WithRSAEncryption OBJECT IDENTIFIER ::= { pkcs-1 12 } Parameters are required, and they must be NULL. Name = sha384WithRSAEncryption, oid = 1.2.840.113549.1.1.12 Length = 15 0000: 300d 0609 2a86 4886 f70d 0101 0c05 00 A.1.4. sha512WithRSAEncryption sha512WithRSAEncryption OBJECT IDENTIFIER ::= { pkcs-1 13 } Parameters are required, and they must be NULL. Name = sha512WithRSAEncryption, oid = 1.2.840.113549.1.1.13 Length = 15 0000: 300d 0609 2a86 4886 f70d 0101 0d05 00 A.2. DSA WithdifferentDSAalgorithms thealgorithms, optional parameters are always omitted.Again we omit dsa-with-sha224 as there is no hashOnly algorithm combinations for DSA listed inourthe IANA registryfor it.are included. SeeAlgorithms"Algorithms and Identifiers for PKIXProfileProfile" ([RFC3279]) andPKIX"PKIX Additional Algorithms and Identifiers for DSA andECDSAECDSA" ([RFC5758] for more information. A.2.1. dsa-with-sha1 dsa-with-sha1 OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) x9-57(10040) x9algorithm(4) 3 } Parameters are absent. Name = dsa-with-sha1, oid = 1.2.840.10040.4.3 Length = 11 0000: 3009 0607 2a86 48ce 3804 03 A.2.2. dsa-with-sha256 dsa-with-sha256 OBJECT IDENTIFIER ::= { joint-iso-ccitt(2) country(16) us(840) organization(1) gov(101) csor(3) algorithms(4) id-dsa-with-sha2(3) 2 } Parameters are absent. Name = dsa-with-sha256, oid = 2.16.840.1.101.3.4.3.2 Length = 13 0000: 300b 0609 6086 4801 6503 0403 02 A.3. ECDSA WithdifferentECDSAalgorithmsalgorithms, the optional parameters are always omitted.Again we omit ecdsa-with-sha224 as there is no hashOnly algorithm combinations for ECDSA listed inourthe IANA registryfor it.are included. SeeElliptic"Elliptic Curve Cryptography Subject Public KeyInformationInformation" ([RFC5480]),Algorithms"Algorithms and Identifiers for PKIXProfileProfile" ([RFC3279]) andPKIX"PKIX Additional Algorithms and Identifiers for DSA andECDSAECDSA" ([RFC5758] for more information. A.3.1. ecdsa-with-sha1 ecdsa-with-SHA1 OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) ansi-X9-62(10045) signatures(4) 1 } Parameters are absent. Name = ecdsa-with-sha1, oid = 1.2.840.10045.4.1 Length = 11 0000: 3009 0607 2a86 48ce 3d04 01 A.3.2. ecdsa-with-sha256 ecdsa-with-SHA256 OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) ansi-X9-62(10045) signatures(4) ecdsa-with-SHA2(3) 2 } Parameters are absent. Name = ecdsa-with-sha256, oid = 1.2.840.10045.4.3.2 Length = 12 0000: 300a 0608 2a86 48ce 3d04 0302 A.3.3. ecdsa-with-sha384 ecdsa-with-SHA384 OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) ansi-X9-62(10045) signatures(4) ecdsa-with-SHA2(3) 3 } Parameters are absent. Name = ecdsa-with-sha384, oid = 1.2.840.10045.4.3.3 Length = 12 0000: 300a 0608 2a86 48ce 3d04 0303 A.3.4. ecdsa-with-sha512 ecdsa-with-SHA512 OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) ansi-X9-62(10045) signatures(4) ecdsa-with-SHA2(3) 4 } Parameters are absent. Name = ecdsa-with-sha512, oid = 1.2.840.10045.4.3.4 Length = 12 0000: 300a 0608 2a86 48ce 3d04 0304 A.4. RSASSA-PSS Withthe RSASSA-PSSRSASSA-PSS, the algorithm object identifier is alwaysid- RSASSA-PSS,id-RSASSA- PSS, but the hash function is taken from the optional parameters, anditis required. See [RFC4055] for more information. A.4.1. RSASSA-PSS with empty parameters id-RSASSA-PSS OBJECT IDENTIFIER ::= { pkcs-1 10 } Parameters are empty, but the ASN.1 part of the sequence must be there. This means default parameters are used (same as the next example). 0000 : SEQUENCE 0002 : OBJECT IDENTIFIER RSASSA-PSS (1.2.840.113549.1.1.10) 000d : SEQUENCE Length = 15 0000: 300d 0609 2a86 4886 f70d 0101 0a30 00 A.4.2. RSASSA-PSS with default parameters id-RSASSA-PSS OBJECT IDENTIFIER ::= { pkcs-1 10 } Here the parameters are present, andcontainscontain the default parameters, i.e. hashAlgorithm of SHA-1, maskGenAlgorithm of mgf1SHA1,saltlengthsaltLength of 20,trailerfieldtrailerField of 1. 0000 : SEQUENCE 0002 : OBJECT IDENTIFIER RSASSA-PSS (1.2.840.113549.1.1.10) 000d : SEQUENCE 000f : CONTEXT 0 0011 : SEQUENCE 0013 : OBJECT IDENTIFIERSha-1id-sha1 (1.3.14.3.2.26) 001a : NULL 001c : CONTEXT 1 001e : SEQUENCE 0020 : OBJECT IDENTIFIER 1.2.840.113549.1.1.8 002b : SEQUENCE 002d : OBJECT IDENTIFIERSha-1id-sha1 (1.3.14.3.2.26) 0034 : NULL 0036 : CONTEXT 2 0038 : INTEGER 0x14 (5 bits) 003b : CONTEXT 3 003d : INTEGER 0x1 (1 bits) Name = RSASSA-PSS with default parameters, oid = 1.2.840.113549.1.1.10 Length = 64 0000: 303e 0609 2a86 4886 f70d 0101 0a30 31a0 0010: 0b30 0906 052b 0e03 021a 0500 a118 3016 0020: 0609 2a86 4886 f70d 0101 0830 0906 052b 0030: 0e03 021a 0500 a203 0201 14a3 0302 0101 A.4.3. RSASSA-PSS with SHA-256 id-RSASSA-PSS OBJECT IDENTIFIER ::= { pkcs-1 10 } Here the parameters are present, andcontains the SHA-256 for both the hash and mgf, saltlengthcontain hashAlgorithm of SHA- 256, maskGenAlgorithm of SHA-256, saltLength of 32,and trailerfieldtrailerField of 1. 0000 : SEQUENCE 0002 : OBJECT IDENTIFIER RSASSA-PSS (1.2.840.113549.1.1.10) 000d : SEQUENCE 000f : CONTEXT 0 0011 : SEQUENCE 0013 : OBJECT IDENTIFIERSha-256id-sha256 (2.16.840.1.101.3.4.2.1) 001e : NULL 0020 : CONTEXT 1 0022 : SEQUENCE 0024 : OBJECT IDENTIFIER 1.2.840.113549.1.1.8 002f : SEQUENCE 0031 : OBJECT IDENTIFIERSha-256id-sha256 (2.16.840.1.101.3.4.2.1) 003c : NULL 003e : CONTEXT 2 0040 : INTEGER 0x20 (6 bits) 0043 : CONTEXT 3 0045 : INTEGER 0x1 (1 bits) Name = RSASSA-PSS with sha-256, oid = 1.2.840.113549.1.1.10 Length = 72 0000: 3046 0609 2a86 4886 f70d 0101 0a30 39a0 0010: 0f30 0d06 0960 8648 0165 0304 0201 0500 0020: a11c 301a 0609 2a86 4886 f70d 0101 0830 0030: 0d06 0960 8648 0165 0304 0201 0500 a203 0040: 0201 20a3 0302 0101 Appendix B. IKEv2 Payload Example B.1. sha1WithRSAEncryption The IKEv2 AUTH payload would start like this: 00000000: NN00 00LL XX00 0000 0f30 0d06 092a 8648 00000010: 86f7 0d01 0105 0500 .... Where the NN will be the next payload type (i.e.thatthe value depends onwhat isthe next payload after this Authentication payload), the LL will be the length of this payload, and after the sha1WithRSAEncryption ASN.1 block (15 bytes) there will be the actual signature, which is omitted here. Note to the RFC editor / IANA, replace the XX above with the newly allocated authentication method type for Digital Signature, and remove this note.Author's AddressAuthors' Addresses Tero Kivinen INSIDE Secure Eerikinkatu 28 HELSINKI FI-00180 FI Email: kivinen@iki.fi Joel Snyder Opus One 1404 East Lind Road Tucson, AZ 85719 Phone: +1 520 324 0494 Email: jms@opus1.com