idnits 2.17.1 draft-ietf-curdle-rsa-sha2-08.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 138 has weird spacing: '... string rsa...' == Line 172 has weird spacing: '... string use...' == Line 173 has weird spacing: '... string ser...' == Line 177 has weird spacing: '... string pub...' == Line 181 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 (May 30, 2017) is 2516 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' == Outdated reference: A later version (-15) exists of draft-ietf-curdle-ssh-ext-info-08 Summary: 0 errors (**), 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 May 30, 2017 5 Expires: November 30, 2017 7 Use of RSA Keys with SHA-2 256 and 512 in Secure Shell (SSH) 8 draft-ietf-curdle-rsa-sha2-08.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; 130 MGF1 as mask function; and salt length equal to hash size. 132 For the algorithm "rsa-sha2-256", the hash used is SHA-2 256. 133 For the algorithm "rsa-sha2-512", the hash used is SHA-2 512. 135 The resulting signature is encoded as follows: 137 string "rsa-sha2-256" / "rsa-sha2-512" 138 string rsa_signature_blob 140 The value for 'rsa_signature_blob' is encoded as a string containing 141 S - an octet string which is the output of RSASSA-PKCS1-v1_5, of 142 length equal to the length in octets of the RSA modulus. 144 3.1. Use for server authentication 146 To express support and preference for one or both of these algorithms 147 for server authentication, the SSH client or server includes one or 148 both algorithm names, "rsa-sha2-256" and/or "rsa-sha2-512", in the 149 name-list field "server_host_key_algorithms" in the SSH_MSG_KEXINIT 150 packet [RFC4253]. If one of the two host key algorithms is negotiated, 151 the server sends an "ssh-rsa" public key as part of the negotiated key 152 exchange method (e.g. in SSH_MSG_KEXDH_REPLY), and encodes a signature 153 with the appropriate signature algorithm name - either "rsa-sha2-256", 154 or "rsa-sha2-512". 156 3.2. Use for client authentication 158 To use this algorithm for client authentication, the SSH client sends 159 an SSH_MSG_USERAUTH_REQUEST message [RFC4252] encoding the "publickey" 160 method, and encoding the string field "public key algorithm name" with 161 the value "rsa-sha2-256" or "rsa-sha2-512". The "public key blob" 162 field encodes the RSA public key using the "ssh-rsa" public key 163 format. The signature field, if present, encodes a signature using an 164 algorithm name that MUST match the SSH authentication request - either 165 "rsa-sha2-256", or "rsa-sha2-512". 167 For example, as defined in [RFC4252] and [RFC4253], an SSH "publickey" 168 authentication request using an "rsa-sha2-512" signature would be 169 properly encoded as follows: 171 byte SSH_MSG_USERAUTH_REQUEST 172 string user name 173 string service name 174 string "publickey" 175 boolean TRUE 176 string "rsa-sha2-512" 177 string public key blob: 178 string "ssh-rsa" 179 mpint e 180 mpint n 181 string signature: 182 string "rsa-sha2-512" 183 string rsa_signature_blob 185 3.3. Discovery of public key algorithms supported by servers 187 Implementation experience has shown that there are servers which apply 188 authentication penalties to clients attempting public key algorithms 189 which the SSH server does not support. 191 Servers that accept rsa-sha2-* signatures for client authentication 192 SHOULD implement the extension negotiation mechanism defined in 193 [EXT-INFO], including especially the "server-sig-algs" extension. 195 When authenticating with an RSA key against a server that does not 196 implement the "server-sig-algs" extension, clients MAY default to an 197 "ssh-rsa" signature to avoid authentication penalties. When the new 198 rsa-sha2-* algorithms have been sufficiently widely adopted to warrant 199 disabling "ssh-rsa", clients MAY default to one of the new algorithms. 201 4. IANA Considerations 203 IANA is requested to update the "Secure Shell (SSH) Protocol 204 Parameters" registry established with [RFC4250], to extend the table 205 Public Key Algorithm Names [IANA-PKA]: 207 - To the immediate right of the column Public Key Algorithm Name, 208 a new column is to be added, titled Public Key Format. For existing 209 entries, the column Public Key Format should be assigned the same 210 value found under Public Key Algorithm Name. 212 - Immediately following the existing entry for "ssh-rsa", two sibling 213 entries are to be added: 215 P. K. Alg. Name P. K. Format Reference Note 216 rsa-sha2-256 ssh-rsa [this document] Section 3 217 rsa-sha2-512 ssh-rsa [this document] Section 3 219 5. Security Considerations 221 The security considerations of [RFC4251] apply to this document. 223 5.1. Key Size and Signature Hash 225 The National Institute of Standards and Technology (NIST) Special 226 Publication 800-131A [800-131A] disallows the use of RSA and DSA keys 227 shorter than 2048 bits for US government use after 2013. The same 228 document disallows the SHA-1 hash function, as used in the "ssh-rsa" 229 and "ssh-dss" algorithms, for digital signature generation after 2013. 231 5.2. Transition 233 This document is based on the premise that RSA is used in environments 234 where a gradual, compatible transition to improved algorithms will be 235 better received than one that is abrupt and incompatible. It advises 236 that SSH implementations add support for new RSA public key algorithms 237 along with SSH_MSG_EXT_INFO and the "server-sig-algs" extension to 238 allow coexistence of new deployments with older versions that support 239 only "ssh-rsa". Nevertheless, implementations SHOULD start to disable 240 "ssh-rsa" in their default configurations as soon as they have reason 241 to believe that new RSA signature algorithms have been widely adopted. 243 5.3. PKCS#1 v1.5 Padding and Signature Verification 245 This document prescribes RSASSA-PKCS1-v1_5 signature padding because: 247 (1) RSASSA-PSS is not universally available to all implementations; 248 (2) PKCS#1 v1.5 is widely supported in existing SSH implementations; 249 (3) PKCS#1 v1.5 is not known to be insecure for use in this scheme. 251 Implementers are advised that a signature with PKCS#1 v1.5 padding 252 MUST NOT be verified by applying the RSA key to the signature, and 253 then parsing the output to extract the hash. This may give an attacker 254 opportunities to exploit flaws in the parsing and vary the encoding. 255 Implementations SHOULD apply PKCS#1 v1.5 padding to the expected hash, 256 THEN compare the encoded bytes with the output of the RSA operation. 258 6. Why no DSA? 260 A draft version of this memo also defined an algorithm name for use of 261 2048-bit and 3072-bit DSA keys with a 256-bit subgroup and SHA-2 256 262 hashing. It is possible to implement DSA securely by generating "k" 263 deterministically as per [RFC6979]. However, a plurality of reviewers 264 were concerned that implementers would continue to use libraries that 265 generate "k" randomly. This is vulnerable to biased "k" generation, 266 and extremely vulnerable to "k" reuse. This document therefore 267 disrecommends DSA, in favor of RSA and elliptic curve cryptography. 269 7. References 271 7.1. Normative References 273 [SHS] National Institute of Standards and Technology (NIST), 274 United States of America, "Secure Hash Standard (SHS)", 275 FIPS Publication 180-4, August 2015, 276 . 278 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 279 Requirement Levels", BCP 14, RFC 2119, March 1997. 281 [RFC4251] Lehtinen, S. and C. Lonvick, Ed., "The Secure Shell (SSH) 282 Protocol Architecture", RFC 4251, January 2006. 284 [RFC4252] Ylonen, T. and C. Lonvick, Ed., "The Secure Shell (SSH) 285 Authentication Protocol", RFC 4252, January 2006. 287 [RFC4253] Ylonen, T. and C. Lonvick, Ed., "The Secure Shell (SSH) 288 Transport Layer Protocol", RFC 4253, January 2006. 290 7.2. Informative References 292 [800-131A] National Institute of Standards and Technology (NIST), 293 "Transitions: Recommendation for Transitioning the Use of 294 Cryptographic Algorithms and Key Lengths", NIST Special 295 Publication 800-131A, January 2011, . 298 [RFC4250] Lehtinen, S. and C. Lonvick, Ed., "The Secure Shell (SSH) 299 Protocol Assigned Numbers", RFC 4250, January 2006. 301 [RFC6979] Pornin, T., "Deterministic Usage of the Digital 302 Signature Algorithm (DSA) and Elliptic Curve Digital 303 Signature Algorithm (ECDSA)", RFC 6979, August 2013. 305 [RFC8017] Moriarty, K., Kaliski, B., Jonsson, J. and Rusch, A., 306 "PKCS #1: RSA Cryptography Specifications Version 2.2", 307 RFC 8017, November 2016. 309 [EXT-INFO] Bider, D., "Extension Negotiation in Secure Shell (SSH)", 310 draft-ietf-curdle-ssh-ext-info-08.txt, May 2017, 311 . 314 [IANA-PKA] "Secure Shell (SSH) Protocol Parameters", 315 . 318 Author's Address 320 Denis Bider 321 Bitvise Limited 322 Suites 41/42, Victoria House 323 26 Main Street 324 GI 326 Phone: +506 8315 6519 327 EMail: ietf-ssh3@denisbider.com 328 URI: https://www.bitvise.com/ 330 Acknowledgments 332 Thanks to Jon Bright, Niels Moeller, Stephen Farrell, Mark D. Baushke, 333 Jeffrey Hutzelman, Hanno Boeck, Peter Gutmann, Damien Miller, Mat 334 Berchtold, and Roumen Petrov for reviews, comments, and suggestions.