idnits 2.17.1 draft-ietf-curdle-rsa-sha2-11.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** There is 1 instance of too long lines in the document, the longest one being 2 characters in excess of 72. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == Line 137 has weird spacing: '... string rsa...' == Line 171 has weird spacing: '... string use...' == Line 172 has weird spacing: '... string ser...' == Line 176 has weird spacing: '... string pub...' == Line 180 has weird spacing: '... string sig...' == (1 more instance...) (Using the creation date from RFC4252, updated by this document, for RFC5378 checks: 1997-03-26) -- The document seems to contain a disclaimer for pre-RFC5378 work, and may have content which was first submitted before 10 November 2008. The disclaimer is necessary when there are original authors that you have been unable to contact, or if some do not wish to grant the BCP78 rights to the IETF Trust. If you are able to get all authors (current and original) to grant those rights, you can and should remove the disclaimer; otherwise, the disclaimer is needed and you can ignore this comment. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (October 6, 2017) is 2393 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Unused Reference: 'RFC6979' is defined on line 290, but no explicit reference was found in the text -- Possible downref: Non-RFC (?) normative reference: ref. 'SHS' Summary: 1 error (**), 0 flaws (~~), 8 warnings (==), 3 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Internet-Draft D. Bider 3 Updates: 4252, 4253 (if approved) Bitvise Limited 4 Intended status: Standards Track October 6, 2017 5 Expires: April 6, 2018 7 Use of RSA Keys with SHA-2 256 and 512 in Secure Shell (SSH) 8 draft-ietf-curdle-rsa-sha2-11.txt 10 Abstract 12 This memo updates RFC 4252 and RFC 4253 to define new public key 13 algorithms for use of RSA keys with SHA-2 hashing for server and 14 client authentication in SSH connections. 16 Status 18 This Internet-Draft is submitted in full conformance with the 19 provisions of BCP 78 and BCP 79. 21 Internet-Drafts are working documents of the Internet Engineering Task 22 Force (IETF), its areas, and its working groups. Note that other 23 groups may also distribute working documents as Internet-Drafts. 25 Internet-Drafts are draft documents valid for a maximum of six months 26 and may be updated, replaced, or obsoleted by other documents at any 27 time. It is inappropriate to use Internet-Drafts as reference material 28 or to cite them other than as "work in progress." 30 The list of current Internet-Drafts can be accessed at 31 http://www.ietf.org/1id-abstracts.html 33 The list of Internet-Draft Shadow Directories can be accessed at 34 http://www.ietf.org/shadow.html 36 Copyright 38 Copyright (c) 2017 IETF Trust and the persons identified as the 39 document authors. All rights reserved. 41 This document is subject to BCP 78 and the IETF Trust's Legal 42 Provisions Relating to IETF Documents 43 (http://trustee.ietf.org/license-info) in effect on the date of 44 publication of this document. Please review these documents 45 carefully, as they describe your rights and restrictions with respect 46 to this document. Code Components extracted from this document must 47 include Simplified BSD License text as described in Section 4.e of 48 the Trust Legal Provisions and are provided without warranty as 49 described in the Simplified BSD License. 51 This document may contain material from IETF Documents or IETF 52 Contributions published or made publicly available before November 10, 53 2008. The person(s) controlling the copyright in some of this material 54 may not have granted the IETF Trust the right to allow modifications 55 of such material outside the IETF Standards Process. Without obtaining 56 an adequate license from the person(s) controlling the copyright in 57 such materials, this document may not be modified outside the IETF 58 Standards Process, and derivative works of it may not be created 59 outside the IETF Standards Process, except to format it for 60 publication as an RFC or to translate it into languages other than 61 English. 63 1. Overview and Rationale 65 Secure Shell (SSH) is a common protocol for secure communication on 66 the Internet. In [RFC4253], SSH originally defined the public key 67 algorithms "ssh-rsa" for server and client authentication using RSA 68 with SHA-1, and "ssh-dss" using 1024-bit DSA and SHA-1. These 69 algorithms are now considered deficient. For US government use, NIST 70 has disallowed 1024-bit RSA and DSA, and use of SHA-1 for signing 71 [800-131A]. 73 This memo updates RFC 4252 and RFC 4253 to define new public key 74 algorithms allowing for interoperable use of existing and new RSA keys 75 with SHA-2 hashing. 77 1.1. Requirements Terminology 79 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 80 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 81 document are to be interpreted as described in [RFC2119]. 83 1.2. Wire Encoding Terminology 85 The wire encoding types in this document - "boolean", "byte", 86 "string", "mpint" - have meanings as described in [RFC4251]. 88 2. Public Key Format vs. Public Key Algorithm 90 In [RFC4252], the concept "public key algorithm" is used to establish 91 a relationship between one algorithm name, and: 93 A. Procedures used to generate and validate a private/public keypair. 94 B. A format used to encode a public key. 95 C. Procedures used to calculate, encode, and verify a signature. 97 This document uses the term "public key format" to identify only A and 98 B in isolation. The term "public key algorithm" continues to identify 99 all three aspects A, B, and C. 101 3. New RSA Public Key Algorithms 103 This memo adopts the style and conventions of [RFC4253] in specifying 104 how use of a public key algorithm is indicated in SSH. 106 The following new public key algorithms are defined: 108 rsa-sha2-256 RECOMMENDED sign Raw RSA key 109 rsa-sha2-512 OPTIONAL sign Raw RSA key 111 These algorithms are suitable for use both in the SSH transport layer 112 [RFC4253] for server authentication, and in the authentication layer 113 [RFC4252] for client authentication. 115 Since RSA keys are not dependent on the choice of hash function, the 116 new public key algorithms reuse the "ssh-rsa" public key format as 117 defined in [RFC4253]: 119 string "ssh-rsa" 120 mpint e 121 mpint n 123 All aspects of the "ssh-rsa" format are kept, including the encoded 124 string "ssh-rsa". This allows existing RSA keys to be used with the 125 new public key algorithms, without requiring re-encoding, or affecting 126 already trusted key fingerprints. 128 Signing and verifying using these algorithms is performed according to 129 the RSASSA-PKCS1-v1_5 scheme in [RFC8017] using SHA-2 [SHS] as hash. 131 For the algorithm "rsa-sha2-256", the hash used is SHA-2 256. 132 For the algorithm "rsa-sha2-512", the hash used is SHA-2 512. 134 The resulting signature is encoded as follows: 136 string "rsa-sha2-256" / "rsa-sha2-512" 137 string rsa_signature_blob 139 The value for 'rsa_signature_blob' is encoded as a string containing 140 S - an octet string which is the output of RSASSA-PKCS1-v1_5, of 141 length equal to the length in octets of the RSA modulus. 143 3.1. Use for server authentication 145 To express support and preference for one or both of these algorithms 146 for server authentication, the SSH client or server includes one or 147 both algorithm names, "rsa-sha2-256" and/or "rsa-sha2-512", in the 148 name-list field "server_host_key_algorithms" in the SSH_MSG_KEXINIT 149 packet [RFC4253]. If one of the two host key algorithms is negotiated, 150 the server sends an "ssh-rsa" public key as part of the negotiated key 151 exchange method (e.g. in SSH_MSG_KEXDH_REPLY), and encodes a signature 152 with the appropriate signature algorithm name - either "rsa-sha2-256", 153 or "rsa-sha2-512". 155 3.2. Use for client authentication 157 To use this algorithm for client authentication, the SSH client sends 158 an SSH_MSG_USERAUTH_REQUEST message [RFC4252] encoding the "publickey" 159 method, and encoding the string field "public key algorithm name" with 160 the value "rsa-sha2-256" or "rsa-sha2-512". The "public key blob" 161 field encodes the RSA public key using the "ssh-rsa" public key 162 format. The signature field, if present, encodes a signature using an 163 algorithm name that MUST match the SSH authentication request - either 164 "rsa-sha2-256", or "rsa-sha2-512". 166 For example, as defined in [RFC4252] and [RFC4253], an SSH "publickey" 167 authentication request using an "rsa-sha2-512" signature would be 168 properly encoded as follows: 170 byte SSH_MSG_USERAUTH_REQUEST 171 string user name 172 string service name 173 string "publickey" 174 boolean TRUE 175 string "rsa-sha2-512" 176 string public key blob: 177 string "ssh-rsa" 178 mpint e 179 mpint n 180 string signature: 181 string "rsa-sha2-512" 182 string rsa_signature_blob 184 3.3. Discovery of public key algorithms supported by servers 186 Implementation experience has shown that there are servers which apply 187 authentication penalties to clients attempting public key algorithms 188 which the SSH server does not support. 190 Servers that accept rsa-sha2-* signatures for client authentication 191 SHOULD implement the extension negotiation mechanism defined in 192 [EXT-INFO], including especially the "server-sig-algs" extension. 194 When authenticating with an RSA key against a server that does not 195 implement the "server-sig-algs" extension, clients MAY default to an 196 "ssh-rsa" signature to avoid authentication penalties. When the new 197 rsa-sha2-* algorithms have been sufficiently widely adopted to warrant 198 disabling "ssh-rsa", clients MAY default to one of the new algorithms. 200 4. IANA Considerations 202 IANA is requested to update the "Secure Shell (SSH) Protocol 203 Parameters" registry established with [RFC4250], to extend the table 204 Public Key Algorithm Names [IANA-PKA]: 206 - To the immediate right of the column Public Key Algorithm Name, 207 a new column is to be added, titled Public Key Format. For existing 208 entries, the column Public Key Format should be assigned the same 209 value found under Public Key Algorithm Name. 211 - Immediately following the existing entry for "ssh-rsa", two sibling 212 entries are to be added: 214 P. K. Alg. Name P. K. Format Reference Note 215 rsa-sha2-256 ssh-rsa [this document] Section 3 216 rsa-sha2-512 ssh-rsa [this document] Section 3 218 5. Security Considerations 220 The security considerations of [RFC4251] apply to this document. 222 5.1. Key Size and Signature Hash 224 The National Institute of Standards and Technology (NIST) Special 225 Publication 800-131A, Revision 1 [800-131A], disallows the use of RSA 226 and DSA keys shorter than 2048 bits for US government use. The same 227 document disallows the SHA-1 hash function for digital signature 228 generation, except under NIST's protocol-specific guidance. 230 5.2. Transition 232 This document is based on the premise that RSA is used in environments 233 where a gradual, compatible transition to improved algorithms will be 234 better received than one that is abrupt and incompatible. It advises 235 that SSH implementations add support for new RSA public key algorithms 236 along with SSH_MSG_EXT_INFO and the "server-sig-algs" extension to 237 allow coexistence of new deployments with older versions that support 238 only "ssh-rsa". Nevertheless, implementations SHOULD start to disable 239 "ssh-rsa" in their default configurations as soon as they have reason 240 to believe that new RSA signature algorithms have been widely adopted. 242 5.3. PKCS#1 v1.5 Padding and Signature Verification 244 This document prescribes RSASSA-PKCS1-v1_5 signature padding because: 246 (1) RSASSA-PSS is not universally available to all implementations; 247 (2) PKCS#1 v1.5 is widely supported in existing SSH implementations; 248 (3) PKCS#1 v1.5 is not known to be insecure for use in this scheme. 250 Implementers are advised that a signature with PKCS#1 v1.5 padding 251 MUST NOT be verified by applying the RSA key to the signature, and 252 then parsing the output to extract the hash. This may give an attacker 253 opportunities to exploit flaws in the parsing and vary the encoding. 254 Verifiers MUST instead apply PKCS#1 v1.5 padding to the expected hash, 255 then compare the encoded bytes with the output of the RSA operation. 257 6. References 259 6.1. Normative References 261 [SHS] National Institute of Standards and Technology (NIST), 262 United States of America, "Secure Hash Standard (SHS)", 263 FIPS Publication 180-4, August 2015, 264 . 266 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 267 Requirement Levels", BCP 14, RFC 2119, March 1997. 269 [RFC4251] Lehtinen, S. and C. Lonvick, Ed., "The Secure Shell (SSH) 270 Protocol Architecture", RFC 4251, January 2006. 272 [RFC4252] Ylonen, T. and C. Lonvick, Ed., "The Secure Shell (SSH) 273 Authentication Protocol", RFC 4252, January 2006. 275 [RFC4253] Ylonen, T. and C. Lonvick, Ed., "The Secure Shell (SSH) 276 Transport Layer Protocol", RFC 4253, January 2006. 278 6.2. Informative References 280 [800-131A] National Institute of Standards and Technology (NIST), 281 "Transitions: Recommendation for Transitioning the Use of 282 Cryptographic Algorithms and Key Lengths", NIST Special 283 Publication 800-131A, Revision 1, November 2015, 284 . 287 [RFC4250] Lehtinen, S. and C. Lonvick, Ed., "The Secure Shell (SSH) 288 Protocol Assigned Numbers", RFC 4250, January 2006. 290 [RFC6979] Pornin, T., "Deterministic Usage of the Digital 291 Signature Algorithm (DSA) and Elliptic Curve Digital 292 Signature Algorithm (ECDSA)", RFC 6979, August 2013. 294 [RFC8017] Moriarty, K., Kaliski, B., Jonsson, J. and Rusch, A., 295 "PKCS #1: RSA Cryptography Specifications Version 2.2", 296 RFC 8017, November 2016. 298 [EXT-INFO] Bider, D., "Extension Negotiation in Secure Shell (SSH)", 299 draft-ietf-curdle-ssh-ext-info-15.txt, September 2017, 300 . 303 [IANA-PKA] "Secure Shell (SSH) Protocol Parameters", 304 . 307 Author's Address 309 Denis Bider 310 Bitvise Limited 311 4105 Lombardy Court 312 Colleyville, Texas 76034 313 United States of America 315 Email: ietf-ssh3@denisbider.com 316 URI: https://www.bitvise.com/ 318 Acknowledgments 320 Thanks to Jon Bright, Niels Moeller, Stephen Farrell, Mark D. Baushke, 321 Jeffrey Hutzelman, Hanno Boeck, Peter Gutmann, Damien Miller, Mat 322 Berchtold, Roumen Petrov, Daniel Migault, and Eric Rescorla for reviews, 323 comments, and suggestions.