idnits 2.17.1 draft-ietf-curdle-rsa-sha2-12.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 : ---------------------------------------------------------------------------- No issues found here. 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 169 has weird spacing: '... string use...' == Line 170 has weird spacing: '... string ser...' == Line 174 has weird spacing: '... string pub...' == Line 178 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 12, 2017) is 2350 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) -- Possible downref: Non-RFC (?) normative reference: ref. 'SHS' Summary: 0 errors (**), 0 flaws (~~), 7 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 12, 2017 5 Expires: April 12, 2018 7 Use of RSA Keys with SHA-256 and SHA-512 in Secure Shell (SSH) 8 draft-ietf-curdle-rsa-sha2-12.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-256 and SHA-512 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-256 and SHA-512. 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-256. 132 For the algorithm "rsa-sha2-512", the hash used is SHA-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. 164 For example, as defined in [RFC4252] and [RFC4253], an SSH "publickey" 165 authentication request using an "rsa-sha2-512" signature would be 166 properly encoded as follows: 168 byte SSH_MSG_USERAUTH_REQUEST 169 string user name 170 string service name 171 string "publickey" 172 boolean TRUE 173 string "rsa-sha2-512" 174 string public key blob: 175 string "ssh-rsa" 176 mpint e 177 mpint n 178 string signature: 179 string "rsa-sha2-512" 180 string rsa_signature_blob 182 If the client includes the signature field, the client MUST encode the 183 same algorithm name in the signature as in SSH_MSG_USERAUTH_REQUEST - 184 either "rsa-sha2-256", or "rsa-sha2-512". If a server receives a 185 mismatching request, it MAY apply arbitrary authentication penalties, 186 including but not limited to authentication failure or disconnect. 188 OpenSSH 7.2 (but not 7.2p2) incorrectly encodes the algorithm in the 189 signature as "ssh-rsa" when the algorithm in SSH_MSG_USERAUTH_REQUEST 190 is "rsa-sha2-256" or "rsa-sha2-512". In this case, the signature does 191 actually use either SHA-256 or SHA-512. A server MAY, but is not 192 required to, accept this variant, or another variant that corresponds 193 to a good-faith implementation, and is decided to be safe to accept. 195 3.3. Discovery of public key algorithms supported by servers 197 Implementation experience has shown that there are servers which apply 198 authentication penalties to clients attempting public key algorithms 199 which the SSH server does not support. 201 Servers that accept rsa-sha2-* signatures for client authentication 202 SHOULD implement the extension negotiation mechanism defined in 203 [EXT-INFO], including especially the "server-sig-algs" extension. 205 When authenticating with an RSA key against a server that does not 206 implement the "server-sig-algs" extension, clients MAY default to an 207 "ssh-rsa" signature to avoid authentication penalties. When the new 208 rsa-sha2-* algorithms have been sufficiently widely adopted to warrant 209 disabling "ssh-rsa", clients MAY default to one of the new algorithms. 211 4. IANA Considerations 213 IANA is requested to update the "Secure Shell (SSH) Protocol 214 Parameters" registry established with [RFC4250], to extend the table 215 Public Key Algorithm Names [IANA-PKA]: 217 - To the immediate right of the column Public Key Algorithm Name, 218 a new column is to be added, titled Public Key Format. For existing 219 entries, the column Public Key Format should be assigned the same 220 value found under Public Key Algorithm Name. 222 - Immediately following the existing entry for "ssh-rsa", two sibling 223 entries are to be added: 225 P. K. Alg. Name P. K. Format Reference Note 226 rsa-sha2-256 ssh-rsa [this document] Section 3 227 rsa-sha2-512 ssh-rsa [this document] Section 3 229 5. Security Considerations 231 The security considerations of [RFC4251] apply to this document. 233 5.1. Key Size and Signature Hash 235 The National Institute of Standards and Technology (NIST) Special 236 Publication 800-131A, Revision 1 [800-131A], disallows the use of RSA 237 and DSA keys shorter than 2048 bits for US government use. The same 238 document disallows the SHA-1 hash function for digital signature 239 generation, except under NIST's protocol-specific guidance. 241 It is prudent to follow this advice also outside of US government use. 243 5.2. Transition 245 This document is based on the premise that RSA is used in environments 246 where a gradual, compatible transition to improved algorithms will be 247 better received than one that is abrupt and incompatible. It advises 248 that SSH implementations add support for new RSA public key algorithms 249 along with SSH_MSG_EXT_INFO and the "server-sig-algs" extension to 250 allow coexistence of new deployments with older versions that support 251 only "ssh-rsa". Nevertheless, implementations SHOULD start to disable 252 "ssh-rsa" in their default configurations as soon as they have reason 253 to believe that new RSA signature algorithms have been widely adopted. 255 5.3. PKCS#1 v1.5 Padding and Signature Verification 257 This document prescribes RSASSA-PKCS1-v1_5 signature padding because: 259 (1) RSASSA-PSS is not universally available to all implementations; 260 (2) PKCS#1 v1.5 is widely supported in existing SSH implementations; 261 (3) PKCS#1 v1.5 is not known to be insecure for use in this scheme. 263 Implementers are advised that a signature with PKCS#1 v1.5 padding 264 MUST NOT be verified by applying the RSA key to the signature, and 265 then parsing the output to extract the hash. This may give an attacker 266 opportunities to exploit flaws in the parsing and vary the encoding. 267 Verifiers MUST instead apply PKCS#1 v1.5 padding to the expected hash, 268 then compare the encoded bytes with the output of the RSA operation. 270 6. References 272 6.1. Normative References 274 [SHS] National Institute of Standards and Technology (NIST), 275 United States of America, "Secure Hash Standard (SHS)", 276 FIPS Publication 180-4, August 2015, 277 . 279 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 280 Requirement Levels", BCP 14, RFC 2119, March 1997. 282 [RFC4251] Lehtinen, S. and C. Lonvick, Ed., "The Secure Shell (SSH) 283 Protocol Architecture", RFC 4251, January 2006. 285 [RFC4252] Ylonen, T. and C. Lonvick, Ed., "The Secure Shell (SSH) 286 Authentication Protocol", RFC 4252, January 2006. 288 [RFC4253] Ylonen, T. and C. Lonvick, Ed., "The Secure Shell (SSH) 289 Transport Layer Protocol", RFC 4253, January 2006. 291 [EXT-INFO] Bider, D., "Extension Negotiation in Secure Shell (SSH)", 292 draft-ietf-curdle-ssh-ext-info-15.txt, September 2017, 293 . 296 6.2. Informative References 298 [800-131A] National Institute of Standards and Technology (NIST), 299 "Transitions: Recommendation for Transitioning the Use of 300 Cryptographic Algorithms and Key Lengths", NIST Special 301 Publication 800-131A, Revision 1, November 2015, 302 . 305 [RFC4250] Lehtinen, S. and C. Lonvick, Ed., "The Secure Shell (SSH) 306 Protocol Assigned Numbers", RFC 4250, January 2006. 308 [RFC8017] Moriarty, K., Kaliski, B., Jonsson, J. and Rusch, A., 309 "PKCS #1: RSA Cryptography Specifications Version 2.2", 310 RFC 8017, November 2016. 312 [IANA-PKA] "Secure Shell (SSH) Protocol Parameters", 313 . 316 Author's Address 318 Denis Bider 319 Bitvise Limited 320 4105 Lombardy Court 321 Colleyville, Texas 76034 322 United States of America 324 Email: ietf-ssh3@denisbider.com 325 URI: https://www.bitvise.com/ 327 Acknowledgments 329 Thanks to Jon Bright, Niels Moeller, Stephen Farrell, Mark D. Baushke, 330 Jeffrey Hutzelman, Hanno Boeck, Peter Gutmann, Damien Miller, Mat 331 Berchtold, Roumen Petrov, Daniel Migault, Eric Rescorla, Russ Housley, 332 Alissa Cooper, Adam Roach, and Ben Campbell for reviews, comments, and 333 suggestions.