idnits 2.17.1 draft-ietf-curdle-ssh-ext-info-07.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 : ---------------------------------------------------------------------------- -- The draft header indicates that this document updates RFC4254, but the abstract doesn't seem to directly say this. It does mention RFC4254 though, so this could be OK. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == Line 129 has weird spacing: '... string exte...' == Line 130 has weird spacing: '... string exte...' == Line 187 has weird spacing: '...me-list publ...' == Line 223 has weird spacing: '...me-list com...' == Line 224 has weird spacing: '...me-list com...' (Using the creation date from RFC4252, updated by this document, for RFC5378 checks: 1997-03-26) -- The document seems to lack a disclaimer for pre-RFC5378 work, but may have content which was first submitted before 10 November 2008. If you have contacted all the original authors and they are all willing to grant the BCP78 rights to the IETF Trust, then this is fine, and you can ignore this comment. If not, you may need to add the pre-RFC5378 disclaimer. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (May 7, 2017) is 2538 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) ** Obsolete normative reference: RFC 5226 (Obsoleted by RFC 8126) == Outdated reference: A later version (-12) exists of draft-ietf-curdle-rsa-sha2-07 Summary: 1 error (**), 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, 4254 (if approved) Bitvise Limited 4 Intended status: Standards Track May 7, 2017 5 Expires: November 7, 2017 7 Extension Negotiation in Secure Shell (SSH) 8 draft-ietf-curdle-ssh-ext-info-07.txt 10 Abstract 12 This memo updates RFC 4252, RFC 4253, and RFC 4254 to define a 13 mechanism for SSH clients and servers to exchange information about 14 supported protocol extensions confidentially after SSH key exchange. 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 1. Overview and Rationale 53 Secure Shell (SSH) is a common protocol for secure communication on 54 the Internet. The original design of the SSH transport layer [RFC4253] 55 lacks proper extension negotiation. Meanwhile, diverse implementations 56 take steps to ensure that known message types contain no unrecognized 57 information. This makes it difficult for implementations to signal 58 capabilities and negotiate extensions without risking disconnection. 60 This obstacle has been recognized in relationship with [SSH-RSA-SHA2], 61 where the need arises for a client to discover public key algorithms a 62 server accepts, to avoid authentication penalties and trial-and-error. 64 1.1. Requirements Terminology 66 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 67 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 68 document are to be interpreted as described in [RFC2119]. 70 1.2. Wire Encoding Terminology 72 The wire encoding types in this document - "byte", "uint32", "string", 73 "boolean", "name-list" - have meanings as described in [RFC4251]. 75 2. Extension Negotiation Mechanism 77 2.1. Signaling of Extension Negotiation in KEXINIT 79 Applications implementing this mechanism MUST add to the field 80 "kex_algorithms", in their KEXINIT packet sent for the first key 81 exchange, one of the following indicator names: 83 - When acting as server: "ext-info-s" 84 - When acting as client: "ext-info-c" 86 The indicator name is added without quotes, and MAY be added at any 87 position in the name-list, subject to proper separation from other 88 names as per name-list conventions. 90 The names are added to the "kex_algorithms" field because this is one 91 of two name-list fields in KEXINIT that do not have a separate copy 92 for each data direction. 94 The indicator names inserted by the client and server are different to 95 ensure that these names will not produce a match, and will be neutral 96 with respect to key exchange algorithm negotiation. 98 The inclusion of textual indicator names is intended to provide a clue 99 for implementers to discover this mechanism. 101 2.2. Enabling Criteria 103 If a client or server offers "ext-info-c" or "ext-info-s" 104 respectively, it MUST be prepared to accept an SSH_MSG_EXT_INFO 105 message from the peer. 107 Thus a server only needs to send "ext-info-s" if it intends to process 108 SSH_MSG_EXT_INFO from the client. 110 If a server receives an "ext-info-c", it MAY send an SSH_MSG_EXT_INFO 111 message, but is not required to do so. 113 If an SSH_MSG_EXT_INFO message is sent, then it MUST be the first 114 message after the initial SSH_MSG_NEWKEYS. 116 Implementations MUST NOT send an incorrect indicator name for their 117 role. Implementations MAY disconnect if the counter-party sends an 118 incorrect indicator. If "ext-info-c" or "ext-info-s" ends up being 119 negotiated as a key exchange method, the parties MUST disconnect. 121 2.3. SSH_MSG_EXT_INFO Message 123 A party that received the "ext-info-c" or "ext-info-s" indicator 124 MAY send the following message: 126 byte SSH_MSG_EXT_INFO (value 7) 127 uint32 nr-extensions 128 repeat the following 2 fields "nr-extensions" times: 129 string extension-name 130 string extension-value 132 This message is sent immediately after SSH_MSG_NEWKEYS, without delay. 133 This allows a client to pipeline an authentication request after its 134 SSH_MSG_SERVICE_REQUEST, even when this needs extension information. 136 2.4. Server's Secondary SSH_MSG_EXT_INFO 138 If the client sent "ext-info-c", the server MAY send zero, one, or two 139 EXT_INFO messages. The first opportunity for the server's EXT_INFO is 140 after the server's NEWKEYS, as above. The second opportunity is just 141 before (*) SSH_MSG_USERAUTH_SUCCESS, as defined in [RFC4252]. The 142 server MAY send EXT_INFO at the second opportunity, whether or not it 143 sent it at the first. A client that sent "ext-info-c" MUST accept a 144 server's EXT_INFO at both opportunities, but MUST NOT require it. 146 This allows a server to reveal support for additional extensions that 147 it was unwilling to reveal to an unauthenticated client. If a server 148 sends a subsequent SSH_MSG_EXT_INFO, this replaces any initial one, 149 and both the client and the server re-evaluate extensions in effect. 150 The server's last EXT_INFO is matched against the client's original. 152 (*) The message MUST be sent at this point for the following reasons: 153 if it was sent earlier, it would not allow the server to withhold 154 information until the client has authenticated; if it was sent later, 155 a client that needs information from the second EXT_INFO immediately 156 after successful authentication would have no way of reliably knowing 157 whether there will be a second EXT_INFO or not. 159 2.5. Interpretation of Extension Names and Values 161 Each extension is identified by its extension-name, and defines the 162 conditions under which the extension is considered to be in effect. 163 Applications MUST ignore unrecognized extension-names. 165 If an extension requires both the client and the server to include it 166 in order for the extension to take effect, the relative position of 167 the extension-name in each EXT_INFO message is irrelevant. 169 Extension-value fields are interpreted as defined by their respective 170 extension. An extension-value field MAY be empty if so permitted by 171 the extension. Applications that do not implement or recognize a 172 particular extension MUST ignore the associated extension-value field, 173 regardless of its size or content. 175 The cumulative size of an SSH_MSG_EXT_INFO message is limited only by 176 the maximum packet length that an implementation may apply in 177 accordance with [RFC4253]. Implementations MUST accept well-formed 178 SSH_MSG_EXT_INFO messages up to the maximum packet length they accept. 180 3. Initially Defined Extensions 182 3.1. "server-sig-algs" 184 This extension is sent with the following extension name and value: 186 string "server-sig-algs" 187 name-list public-key-algorithms-accepted 189 The name-list type is a strict subset of the string type, and is thus 190 permissible as an extension-value. See [RFC4251] for more information. 192 This extension is sent by the server, and contains a list of public 193 key algorithms that the server is able to process as part of a 194 "publickey" authentication request. If a client sends this extension, 195 the server MAY ignore it, and MAY disconnect. 197 In this extension, a server SHOULD enumerate ALL public key algorithms 198 it might accept during user authentication. However, there exist early 199 server implementations which do not enumerate all accepted algorithms. 200 For this reason, a client MAY send a user authentication request using 201 a public key algorithm not included in "server-sig-algs". 203 A client that wishes to proceed with public key authentication MAY 204 wait for the server's SSH_MSG_EXT_INFO so it can send a "publickey" 205 authentication request with an appropriate public key algorithm, 206 rather than resorting to trial and error. 208 Servers that implement public key authentication SHOULD implement this 209 extension. 211 If a server does not send this extension, a client MUST NOT make any 212 assumptions about the server's public key algorithm support, and MAY 213 proceed with authentication requests using trial and error. Note that 214 implementations are known to exist that apply authentication penalties 215 if the client attempts to use an unexpected public key algorithm. 217 3.2. "delay-compression" 219 This extension MAY be sent by both parties as follows: 221 string "delay-compression" 222 string: 223 name-list compression_algorithms_client_to_server 224 name-list compression_algorithms_server_to_client 226 This extension allows the server and client to renegotiate compression 227 algorithm support without having to conduct a key re-exchange, putting 228 new algorithms into effect immediately upon successful authentication. 230 This extension takes effect only if both parties send it. Name-lists 231 MAY include any compression algorithm that could have been negotiated 232 in SSH_MSG_KEXINIT, except algorithms that define their own delayed 233 compression semantics. This means "zlib,none" is a valid algorithm 234 list in this context; but "zlib@openssh.com" is not. 236 If both parties send this extension, but the name-lists do not contain 237 a common algorithm in either direction, the parties MUST disconnect in 238 the same way as if negotiation failed as part of SSH_MSG_KEXINIT. 240 If this extension takes effect, the renegotiated compression algorithm 241 is activated for the very next SSH message after the trigger message: 243 - Sent by the server, the trigger message is SSH_MSG_USERAUTH_SUCCESS. 244 - Sent by the client, the trigger message is SSH_MSG_NEWCOMPRESS. 246 If this extension takes effect, the client MUST send the following 247 message shortly after receiving SSH_MSG_USERAUTH_SUCCESS: 249 byte SSH_MSG_NEWCOMPRESS (value 8) 251 The purpose of NEWCOMPRESS is to avoid a race condition where the 252 server cannot reliably know whether a message sent by the client was 253 sent before or after receiving the server's USERAUTH_SUCCESS. 255 As with all extensions, the server MAY delay including this extension 256 until its secondary SSH_MSG_EXT_INFO, sent before USERAUTH_SUCCESS. 257 This allows the server to avoid advertising compression support until 258 the client has been authenticated. 260 If the parties re-negotiate compression using this extension in a 261 session where compression is already enabled; and the re-negotiated 262 algorithm is the same in one or both directions; then the internal 263 compression state MUST be reset for each direction at the time the 264 re-negotiated algorithm takes effect. 266 3.2.1. Awkwardly Timed Key Re-Exchange 268 A party that has signaled, or intends to signal, support for this 269 extension in an SSH session, MUST NOT initiate key re-exchange in that 270 session until either of the following occurs: 272 - This extension was negotiated, and the party that's about to start 273 key re-exchange already sent its trigger message for compression. 275 - The party has sent (if server) or received (if client) the message 276 SSH_MSG_USERAUTH_SUCCESS, and this extension was not negotiated. 278 If a party violates this rule, the other party MAY disconnect. 280 In general, parties SHOULD NOT start key re-exchange before successful 281 user authentication, but MAY tolerate it if not using this extension. 283 3.2.2. Subsequent Re-Exchange 285 In subsequent key re-exchanges that unambiguously begin after the 286 compression trigger messages, the compression algorithms negotiated in 287 re-exchange override the algorithms negotiated with this extension. 289 3.3. "no-flow-control" 291 This extension is sent with the following extension name and value: 293 string "no-flow-control" 294 string choice of: "p" for preferred | "s" for supported 296 A party SHOULD send "s" if it supports "no-flow-control", but does not 297 prefer to enable it. A party SHOULD send "p" if it prefers to enable 298 the extension if the other party supports it. Parties MAY disconnect 299 if they receive a different extension value. 301 To take effect, this extension MUST be: 303 - Sent by both parties. 304 - At least one party MUST have sent the value "p" (preferred). 306 If this extension takes effect, the "initial window size" fields in 307 SSH_MSG_CHANNEL_OPEN and SSH_MSG_CHANNEL_OPEN_CONFIRMATION, as defined 308 in [RFC4254], become meaningless. The values of these fields MUST be 309 ignored, and a channel behaves as if all window sizes are infinite. 310 Neither side is required to send any SSH_MSG_CHANNEL_WINDOW_ADJUST 311 messages, and if received, such messages MUST be ignored. 313 This extension is intended, but not limited to, use by file transfer 314 applications that are only going to use one channel, and for which the 315 flow control provided by SSH is an impediment, rather than a feature. 317 Implementations MUST refuse to open more than one simultaneous channel 318 when this extension is in effect. Nevertheless, server implementations 319 SHOULD support clients opening more than one non-simultaneous channel. 321 3.3.1. Implementation Note: Prior "No Flow Control" Practice 323 Before this extension, some applications would simply not implement 324 SSH flow control, sending an initial channel window size of 2^32 - 1. 325 Applications SHOULD NOT do this for the following reasons: 327 - It is entirely within the realm of possibility to transfer more than 328 2^32 bytes over a channel. The channel will then hang if the other 329 party implements SSH flow control according to [RFC4254]. 331 - There exist implementations which cannot handle such large channel 332 window sizes, and will exhibit non-graceful behaviors, including 333 disconnection. 335 3.4. "elevation" 337 This extension MAY be sent by the client as follows: 339 string "elevation" 340 string choice of: "y" | "n" | "d" 342 A client sends "y" to indicate its preference that the session should 343 be elevated (as used by Windows); "n" to not be elevated; and "d" for 344 the server to use its default behavior. The server MAY disconnect if 345 it receives a different extension value. If a client does not send the 346 "elevation" extension, the server SHOULD act as if "d" was sent. 348 If a client has included this extension, then after authentication, a 349 server that supports this extension SHOULD indicate to the client 350 whether elevation was done by sending the following global request: 352 byte SSH_MSG_GLOBAL_REQUEST 353 string "elevation" 354 boolean want reply = false 355 boolean elevation performed 357 4. IANA Considerations 359 4.1. Additions to existing tables 361 IANA is requested to insert the following entries into the table 362 Message Numbers [IANA-M] under Secure Shell (SSH) Protocol Parameters 363 [RFC4250]: 365 Value Message ID Reference 366 7 SSH_MSG_EXT_INFO [this document] 367 8 SSH_MSG_NEWCOMPRESS [this document] 369 IANA is requested to insert the following entries into the table Key 370 Exchange Method Names [IANA-KE]: 372 Method Name Reference Note 373 ext-info-s [this document] Section 2.2 374 ext-info-c [this document] Section 2.2 376 4.2. New table: Extension Names 378 Also under Secure Shell (SSH) Protocol Parameters, IANA is requested 379 to create a new table, Extension Names, with initial content: 381 Extension Name Reference Note 382 server-sig-algs [this document] Section 3.1 383 delay-compression [this document] Section 3.2 384 no-flow-control [this document] Section 3.3 385 elevation [this document] Section 3.4 387 4.2.1. Future Assignments to Extension Names 389 Names in the Extension Names table MUST follow the Conventions for 390 Names defined in [RFC4250], Section 4.6.1. 392 Requests for assignments of new non-local names in the Extension Names 393 table (i.e. names not including the '@' character) MUST be done 394 through the IETF CONSENSUS method, as described in [RFC5226]. 396 5. Security Considerations 398 Security considerations are discussed throughout this document. This 399 document updates the SSH protocol as defined in [RFC4251] and related 400 documents. The security considerations of [RFC4251] apply. 402 6. References 404 6.1. Normative References 406 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 407 Requirement Levels", BCP 14, RFC 2119, March 1997. 409 [RFC4250] Lehtinen, S. and C. Lonvick, Ed., "The Secure Shell (SSH) 410 Protocol Assigned Numbers", RFC 4250, January 2006. 412 [RFC4251] Lehtinen, S. and C. Lonvick, Ed., "The Secure Shell (SSH) 413 Protocol Architecture", RFC 4251, January 2006. 415 [RFC4252] Ylonen, T. and C. Lonvick, Ed., "The Secure Shell (SSH) 416 Authentication Protocol", RFC 4252, January 2006. 418 [RFC4253] Ylonen, T. and C. Lonvick, Ed., "The Secure Shell (SSH) 419 Transport Layer Protocol", RFC 4253, January 2006. 421 [RFC4254] Ylonen, T. and C. Lonvick, Ed., "The Secure Shell (SSH) 422 Connection Protocol", RFC 4254, January 2006. 424 [RFC5226] Narten, T. and Alvestrand, H., "Guidelines for Writing an 425 IANA Considerations Section in RFCs", BCP 26, RFC 5226, 426 May 2008. 428 6.2. Informative References 430 [SSH-RSA-SHA2] 431 Bider, D., "Use of RSA Keys with SHA-2 256 and 512 in 432 Secure Shell (SSH)", draft-ietf-curdle-rsa-sha2-07.txt, 433 May 2017, . 436 [IANA-M] "Secure Shell (SSH) Protocol Parameters", 437 . 440 [IANA-KE] "Secure Shell (SSH) Protocol Parameters", 441 . 444 Author's Address 446 Denis Bider 447 Bitvise Limited 448 Suites 41/42, Victoria House 449 26 Main Street 450 GI 452 Phone: +506 8315 6519 453 EMail: ietf-ssh3@denisbider.com 454 URI: https://www.bitvise.com/ 456 Acknowledgments 458 Thanks to Markus Friedl and Damien Miller for comments and initial 459 implementation. Thanks to Peter Gutmann, Roumen Petrov, and Daniel 460 Migault for review and feedback.