idnits 2.17.1 draft-ietf-quic-tls-24.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 abstract seems to contain references ([2], [3], [1]), which it shouldn't. Please replace those with straight textual mentions of the documents in question. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == Using lowercase 'not' together with uppercase 'MUST', 'SHALL', 'SHOULD', or 'RECOMMENDED' is not an accepted usage according to RFC 2119. Please use uppercase 'NOT' together with RFC 2119 keywords (if that is what you mean). Found 'MUST not' in this paragraph: o If the packet is from a previously installed encryption level, it MUST not contain data which extends past the end of previously received data in that flow. Implementations MUST treat any violations of this requirement as a connection error of type PROTOCOL_VIOLATION. -- The document date (November 04, 2019) is 1634 days in the past. Is this intentional? -- Found something which looks like a code comment -- if you have code sections in the document, please surround them with '' and '' lines. Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) -- Looks like a reference, but probably isn't: '1' on line 1899 -- Looks like a reference, but probably isn't: '2' on line 1901 -- Looks like a reference, but probably isn't: '3' on line 1903 -- Looks like a reference, but probably isn't: '0' on line 1993 -- Possible downref: Non-RFC (?) normative reference: ref. 'AES' ** Downref: Normative reference to an Informational RFC: RFC 8439 (ref. 'CHACHA') == Outdated reference: A later version (-34) exists of draft-ietf-quic-recovery-24 == Outdated reference: A later version (-34) exists of draft-ietf-quic-transport-24 -- Possible downref: Non-RFC (?) normative reference: ref. 'SHA' == Outdated reference: A later version (-34) exists of draft-ietf-quic-http-24 -- Obsolete informational reference (is this intentional?): RFC 2818 (Obsoleted by RFC 9110) Summary: 2 errors (**), 0 flaws (~~), 5 warnings (==), 9 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 QUIC M. Thomson, Ed. 3 Internet-Draft Mozilla 4 Intended status: Standards Track S. Turner, Ed. 5 Expires: May 7, 2020 sn3rd 6 November 04, 2019 8 Using TLS to Secure QUIC 9 draft-ietf-quic-tls-24 11 Abstract 13 This document describes how Transport Layer Security (TLS) is used to 14 secure QUIC. 16 Note to Readers 18 Discussion of this draft takes place on the QUIC working group 19 mailing list (quic@ietf.org), which is archived at 20 https://mailarchive.ietf.org/arch/search/?email_list=quic [1]. 22 Working Group information can be found at https://github.com/quicwg 23 [2]; source code and issues list for this draft can be found at 24 https://github.com/quicwg/base-drafts/labels/-tls [3]. 26 Status of This Memo 28 This Internet-Draft is submitted in full conformance with the 29 provisions of BCP 78 and BCP 79. 31 Internet-Drafts are working documents of the Internet Engineering 32 Task Force (IETF). Note that other groups may also distribute 33 working documents as Internet-Drafts. The list of current Internet- 34 Drafts is at https://datatracker.ietf.org/drafts/current/. 36 Internet-Drafts are draft documents valid for a maximum of six months 37 and may be updated, replaced, or obsoleted by other documents at any 38 time. It is inappropriate to use Internet-Drafts as reference 39 material or to cite them other than as "work in progress." 41 This Internet-Draft will expire on May 7, 2020. 43 Copyright Notice 45 Copyright (c) 2019 IETF Trust and the persons identified as the 46 document authors. All rights reserved. 48 This document is subject to BCP 78 and the IETF Trust's Legal 49 Provisions Relating to IETF Documents 50 (https://trustee.ietf.org/license-info) in effect on the date of 51 publication of this document. Please review these documents 52 carefully, as they describe your rights and restrictions with respect 53 to this document. Code Components extracted from this document must 54 include Simplified BSD License text as described in Section 4.e of 55 the Trust Legal Provisions and are provided without warranty as 56 described in the Simplified BSD License. 58 Table of Contents 60 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 4 61 2. Notational Conventions . . . . . . . . . . . . . . . . . . . 4 62 2.1. TLS Overview . . . . . . . . . . . . . . . . . . . . . . 4 63 3. Protocol Overview . . . . . . . . . . . . . . . . . . . . . . 7 64 4. Carrying TLS Messages . . . . . . . . . . . . . . . . . . . . 8 65 4.1. Interface to TLS . . . . . . . . . . . . . . . . . . . . 10 66 4.1.1. Handshake Complete . . . . . . . . . . . . . . . . . 10 67 4.1.2. Handshake Confirmed . . . . . . . . . . . . . . . . . 10 68 4.1.3. Sending and Receiving Handshake Messages . . . . . . 10 69 4.1.4. Encryption Level Changes . . . . . . . . . . . . . . 12 70 4.1.5. TLS Interface Summary . . . . . . . . . . . . . . . . 13 71 4.2. TLS Version . . . . . . . . . . . . . . . . . . . . . . . 14 72 4.3. ClientHello Size . . . . . . . . . . . . . . . . . . . . 15 73 4.4. Peer Authentication . . . . . . . . . . . . . . . . . . . 15 74 4.5. Enabling 0-RTT . . . . . . . . . . . . . . . . . . . . . 16 75 4.6. Accepting and Rejecting 0-RTT . . . . . . . . . . . . . . 16 76 4.7. Validating 0-RTT Configuration . . . . . . . . . . . . . 17 77 4.8. HelloRetryRequest . . . . . . . . . . . . . . . . . . . . 17 78 4.9. TLS Errors . . . . . . . . . . . . . . . . . . . . . . . 18 79 4.10. Discarding Unused Keys . . . . . . . . . . . . . . . . . 18 80 4.10.1. Discarding Initial Keys . . . . . . . . . . . . . . 18 81 4.10.2. Discarding Handshake Keys . . . . . . . . . . . . . 19 82 4.10.3. Discarding 0-RTT Keys . . . . . . . . . . . . . . . 19 83 5. Packet Protection . . . . . . . . . . . . . . . . . . . . . . 20 84 5.1. Packet Protection Keys . . . . . . . . . . . . . . . . . 20 85 5.2. Initial Secrets . . . . . . . . . . . . . . . . . . . . . 20 86 5.3. AEAD Usage . . . . . . . . . . . . . . . . . . . . . . . 21 87 5.4. Header Protection . . . . . . . . . . . . . . . . . . . . 23 88 5.4.1. Header Protection Application . . . . . . . . . . . . 23 89 5.4.2. Header Protection Sample . . . . . . . . . . . . . . 25 90 5.4.3. AES-Based Header Protection . . . . . . . . . . . . . 26 91 5.4.4. ChaCha20-Based Header Protection . . . . . . . . . . 26 92 5.5. Receiving Protected Packets . . . . . . . . . . . . . . . 27 93 5.6. Use of 0-RTT Keys . . . . . . . . . . . . . . . . . . . . 27 94 5.7. Receiving Out-of-Order Protected Frames . . . . . . . . . 28 95 6. Key Update . . . . . . . . . . . . . . . . . . . . . . . . . 28 96 6.1. Initiating a Key Update . . . . . . . . . . . . . . . . . 29 97 6.2. Responding to a Key Update . . . . . . . . . . . . . . . 30 98 6.3. Timing of Receive Key Generation . . . . . . . . . . . . 31 99 6.4. Sending with Updated Keys . . . . . . . . . . . . . . . . 32 100 6.5. Receiving with Different Keys . . . . . . . . . . . . . . 32 101 6.6. Key Update Frequency . . . . . . . . . . . . . . . . . . 33 102 6.7. Key Update Error Code . . . . . . . . . . . . . . . . . . 33 103 7. Security of Initial Messages . . . . . . . . . . . . . . . . 33 104 8. QUIC-Specific Additions to the TLS Handshake . . . . . . . . 34 105 8.1. Protocol Negotiation . . . . . . . . . . . . . . . . . . 34 106 8.2. QUIC Transport Parameters Extension . . . . . . . . . . . 34 107 8.3. Removing the EndOfEarlyData Message . . . . . . . . . . . 35 108 9. Security Considerations . . . . . . . . . . . . . . . . . . . 36 109 9.1. Replay Attacks with 0-RTT . . . . . . . . . . . . . . . . 36 110 9.2. Packet Reflection Attack Mitigation . . . . . . . . . . . 37 111 9.3. Header Protection Analysis . . . . . . . . . . . . . . . 37 112 9.4. Header Protection Timing Side-Channels . . . . . . . . . 38 113 9.5. Key Diversity . . . . . . . . . . . . . . . . . . . . . . 39 114 10. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 39 115 11. References . . . . . . . . . . . . . . . . . . . . . . . . . 39 116 11.1. Normative References . . . . . . . . . . . . . . . . . . 39 117 11.2. Informative References . . . . . . . . . . . . . . . . . 40 118 11.3. URIs . . . . . . . . . . . . . . . . . . . . . . . . . . 41 119 Appendix A. Sample Initial Packet Protection . . . . . . . . . . 41 120 A.1. Keys . . . . . . . . . . . . . . . . . . . . . . . . . . 41 121 A.2. Client Initial . . . . . . . . . . . . . . . . . . . . . 43 122 A.3. Server Initial . . . . . . . . . . . . . . . . . . . . . 44 123 Appendix B. Change Log . . . . . . . . . . . . . . . . . . . . . 45 124 B.1. Since draft-ietf-quic-tls-23 . . . . . . . . . . . . . . 45 125 B.2. Since draft-ietf-quic-tls-22 . . . . . . . . . . . . . . 45 126 B.3. Since draft-ietf-quic-tls-21 . . . . . . . . . . . . . . 46 127 B.4. Since draft-ietf-quic-tls-20 . . . . . . . . . . . . . . 46 128 B.5. Since draft-ietf-quic-tls-18 . . . . . . . . . . . . . . 46 129 B.6. Since draft-ietf-quic-tls-17 . . . . . . . . . . . . . . 46 130 B.7. Since draft-ietf-quic-tls-14 . . . . . . . . . . . . . . 46 131 B.8. Since draft-ietf-quic-tls-13 . . . . . . . . . . . . . . 47 132 B.9. Since draft-ietf-quic-tls-12 . . . . . . . . . . . . . . 47 133 B.10. Since draft-ietf-quic-tls-11 . . . . . . . . . . . . . . 47 134 B.11. Since draft-ietf-quic-tls-10 . . . . . . . . . . . . . . 47 135 B.12. Since draft-ietf-quic-tls-09 . . . . . . . . . . . . . . 47 136 B.13. Since draft-ietf-quic-tls-08 . . . . . . . . . . . . . . 47 137 B.14. Since draft-ietf-quic-tls-07 . . . . . . . . . . . . . . 47 138 B.15. Since draft-ietf-quic-tls-05 . . . . . . . . . . . . . . 48 139 B.16. Since draft-ietf-quic-tls-04 . . . . . . . . . . . . . . 48 140 B.17. Since draft-ietf-quic-tls-03 . . . . . . . . . . . . . . 48 141 B.18. Since draft-ietf-quic-tls-02 . . . . . . . . . . . . . . 48 142 B.19. Since draft-ietf-quic-tls-01 . . . . . . . . . . . . . . 48 143 B.20. Since draft-ietf-quic-tls-00 . . . . . . . . . . . . . . 48 144 B.21. Since draft-thomson-quic-tls-01 . . . . . . . . . . . . . 49 145 Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . 49 146 Contributors . . . . . . . . . . . . . . . . . . . . . . . . . . 49 147 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 49 149 1. Introduction 151 This document describes how QUIC [QUIC-TRANSPORT] is secured using 152 TLS [TLS13]. 154 TLS 1.3 provides critical latency improvements for connection 155 establishment over previous versions. Absent packet loss, most new 156 connections can be established and secured within a single round 157 trip; on subsequent connections between the same client and server, 158 the client can often send application data immediately, that is, 159 using a zero round trip setup. 161 This document describes how TLS acts as a security component of QUIC. 163 2. Notational Conventions 165 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 166 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 167 "OPTIONAL" in this document are to be interpreted as described in BCP 168 14 [RFC2119] [RFC8174] when, and only when, they appear in all 169 capitals, as shown here. 171 This document uses the terminology established in [QUIC-TRANSPORT]. 173 For brevity, the acronym TLS is used to refer to TLS 1.3, though a 174 newer version could be used (see Section 4.2). 176 2.1. TLS Overview 178 TLS provides two endpoints with a way to establish a means of 179 communication over an untrusted medium (that is, the Internet) that 180 ensures that messages they exchange cannot be observed, modified, or 181 forged. 183 Internally, TLS is a layered protocol, with the structure shown in 184 Figure 1. 186 +-------------+------------+--------------+---------+ 187 Handshake | | | Application | | 188 Layer | Handshake | Alerts | Data | ... | 189 | | | | | 190 +-------------+------------+--------------+---------+ 191 Record | | 192 Layer | Records | 193 | | 194 +---------------------------------------------------+ 196 Figure 1: TLS Layers 198 Each Handshake layer message (e.g., Handshake, Alerts, and 199 Application Data) is carried as a series of typed TLS records by the 200 Record layer. Records are individually cryptographically protected 201 and then transmitted over a reliable transport (typically TCP) which 202 provides sequencing and guaranteed delivery. 204 The TLS authenticated key exchange occurs between two endpoints: 205 client and server. The client initiates the exchange and the server 206 responds. If the key exchange completes successfully, both client 207 and server will agree on a secret. TLS supports both pre-shared key 208 (PSK) and Diffie-Hellman over either finite fields or elliptic curves 209 ((EC)DHE) key exchanges. PSK is the basis for 0-RTT; the latter 210 provides perfect forward secrecy (PFS) when the (EC)DHE keys are 211 destroyed. 213 After completing the TLS handshake, the client will have learned and 214 authenticated an identity for the server and the server is optionally 215 able to learn and authenticate an identity for the client. TLS 216 supports X.509 [RFC5280] certificate-based authentication for both 217 server and client. 219 The TLS key exchange is resistant to tampering by attackers and it 220 produces shared secrets that cannot be controlled by either 221 participating peer. 223 TLS provides two basic handshake modes of interest to QUIC: 225 o A full 1-RTT handshake in which the client is able to send 226 Application Data after one round trip and the server immediately 227 responds after receiving the first handshake message from the 228 client. 230 o A 0-RTT handshake in which the client uses information it has 231 previously learned about the server to send Application Data 232 immediately. This Application Data can be replayed by an attacker 233 so it MUST NOT carry a self-contained trigger for any non- 234 idempotent action. 236 A simplified TLS handshake with 0-RTT application data is shown in 237 Figure 2. Note that this omits the EndOfEarlyData message, which is 238 not used in QUIC (see Section 8.3). Likewise, neither 239 ChangeCipherSpec nor KeyUpdate messages are used by QUIC; 240 ChangeCipherSpec is redundant in TLS 1.3 and QUIC has defined its own 241 key update mechanism Section 6. 243 Client Server 245 ClientHello 246 (0-RTT Application Data) --------> 247 ServerHello 248 {EncryptedExtensions} 249 {Finished} 250 <-------- [Application Data] 251 {Finished} --------> 253 [Application Data] <-------> [Application Data] 255 () Indicates messages protected by Early Data (0-RTT) Keys 256 {} Indicates messages protected using Handshake Keys 257 [] Indicates messages protected using Application Data 258 (1-RTT) Keys 260 Figure 2: TLS Handshake with 0-RTT 262 Data is protected using a number of encryption levels: 264 o Initial Keys 266 o Early Data (0-RTT) Keys 268 o Handshake Keys 270 o Application Data (1-RTT) Keys 272 Application Data may appear only in the Early Data and Application 273 Data levels. Handshake and Alert messages may appear in any level. 275 The 0-RTT handshake is only possible if the client and server have 276 previously communicated. In the 1-RTT handshake, the client is 277 unable to send protected Application Data until it has received all 278 of the Handshake messages sent by the server. 280 3. Protocol Overview 282 QUIC [QUIC-TRANSPORT] assumes responsibility for the confidentiality 283 and integrity protection of packets. For this it uses keys derived 284 from a TLS handshake [TLS13], but instead of carrying TLS records 285 over QUIC (as with TCP), TLS Handshake and Alert messages are carried 286 directly over the QUIC transport, which takes over the 287 responsibilities of the TLS record layer, as shown in Figure 3. 289 +--------------+--------------+ +-------------+ 290 | TLS | TLS | | QUIC | 291 | Handshake | Alerts | | Applications| 292 | | | | (h3, etc.) | 293 +--------------+--------------+-+-------------+ 294 | | 295 | QUIC Transport | 296 | (streams, reliability, congestion, etc.) | 297 | | 298 +---------------------------------------------+ 299 | | 300 | QUIC Packet Protection | 301 | | 302 +---------------------------------------------+ 304 Figure 3: QUIC Layers 306 QUIC also relies on TLS for authentication and negotiation of 307 parameters that are critical to security and performance. 309 Rather than a strict layering, these two protocols cooperate: QUIC 310 uses the TLS handshake; TLS uses the reliability, ordered delivery, 311 and record layer provided by QUIC. 313 At a high level, there are two main interactions between the TLS and 314 QUIC components: 316 o The TLS component sends and receives messages via the QUIC 317 component, with QUIC providing a reliable stream abstraction to 318 TLS. 320 o The TLS component provides a series of updates to the QUIC 321 component, including (a) new packet protection keys to install (b) 322 state changes such as handshake completion, the server 323 certificate, etc. 325 Figure 4 shows these interactions in more detail, with the QUIC 326 packet protection being called out specially. 328 +------------+ +------------+ 329 | |<---- Handshake Messages ----->| | 330 | |<- Validate 0-RTT parameters ->| | 331 | |<--------- 0-RTT Keys ---------| | 332 | QUIC |<------- Handshake Keys -------| TLS | 333 | |<--------- 1-RTT Keys ---------| | 334 | |<------- Handshake Done -------| | 335 +------------+ +------------+ 336 | ^ 337 | Protect | Protected 338 v | Packet 339 +------------+ 340 | QUIC | 341 | Packet | 342 | Protection | 343 +------------+ 345 Figure 4: QUIC and TLS Interactions 347 Unlike TLS over TCP, QUIC applications which want to send data do not 348 send it through TLS "application_data" records. Rather, they send it 349 as QUIC STREAM frames or other frame types which are then carried in 350 QUIC packets. 352 4. Carrying TLS Messages 354 QUIC carries TLS handshake data in CRYPTO frames, each of which 355 consists of a contiguous block of handshake data identified by an 356 offset and length. Those frames are packaged into QUIC packets and 357 encrypted under the current TLS encryption level. As with TLS over 358 TCP, once TLS handshake data has been delivered to QUIC, it is QUIC's 359 responsibility to deliver it reliably. Each chunk of data that is 360 produced by TLS is associated with the set of keys that TLS is 361 currently using. If QUIC needs to retransmit that data, it MUST use 362 the same keys even if TLS has already updated to newer keys. 364 One important difference between TLS records (used with TCP) and QUIC 365 CRYPTO frames is that in QUIC multiple frames may appear in the same 366 QUIC packet as long as they are associated with the same encryption 367 level. For instance, an implementation might bundle a Handshake 368 message and an ACK for some Handshake data into the same packet. 370 Some frames are prohibited in different encryption levels, others 371 cannot be sent. The rules here generalize those of TLS, in that 372 frames associated with establishing the connection can usually appear 373 at any encryption level, whereas those associated with transferring 374 data can only appear in the 0-RTT and 1-RTT encryption levels: 376 o PADDING and PING frames MAY appear in packets of any encryption 377 level. 379 o CRYPTO and CONNECTION_CLOSE frames MAY appear in packets of any 380 encryption level except 0-RTT. 382 o ACK frames MAY appear in packets of any encryption level other 383 than 0-RTT, but can only acknowledge packets which appeared in 384 that packet number space. 386 o All other frame types MUST only be sent in the 0-RTT and 1-RTT 387 levels. 389 Note that it is not possible to send the following frames in 0-RTT 390 for various reasons: ACK, CRYPTO, NEW_TOKEN, PATH_RESPONSE, and 391 RETIRE_CONNECTION_ID. 393 Because packets could be reordered on the wire, QUIC uses the packet 394 type to indicate which level a given packet was encrypted under, as 395 shown in Table 1. When multiple packets of different encryption 396 levels need to be sent, endpoints SHOULD use coalesced packets to 397 send them in the same UDP datagram. 399 +---------------------+------------------+-----------+ 400 | Packet Type | Encryption Level | PN Space | 401 +---------------------+------------------+-----------+ 402 | Initial | Initial secrets | Initial | 403 | | | | 404 | 0-RTT Protected | 0-RTT | 0/1-RTT | 405 | | | | 406 | Handshake | Handshake | Handshake | 407 | | | | 408 | Retry | N/A | N/A | 409 | | | | 410 | Version Negotiation | N/A | N/A | 411 | | | | 412 | Short Header | 1-RTT | 0/1-RTT | 413 +---------------------+------------------+-----------+ 415 Table 1: Encryption Levels by Packet Type 417 Section 17 of [QUIC-TRANSPORT] shows how packets at the various 418 encryption levels fit into the handshake process. 420 4.1. Interface to TLS 422 As shown in Figure 4, the interface from QUIC to TLS consists of four 423 primary functions: 425 o Sending and receiving handshake messages 427 o Processing stored transport and application state from a resumed 428 session and determining if it is valid to accept early data 430 o Rekeying (both transmit and receive) 432 o Handshake state updates 434 Additional functions might be needed to configure TLS. 436 4.1.1. Handshake Complete 438 In this document, the TLS handshake is considered complete when the 439 TLS stack has reported that the handshake is complete. This happens 440 when the TLS stack has both sent a Finished message and verified the 441 peer's Finished message. Verifying the peer's Finished provides the 442 endpoints with an assurance that previous handshake messages have not 443 been modified. Note that the handshake does not complete at both 444 endpoints simultaneously. Consequently, any requirement that is 445 based on the completion of the handshake depends on the perspective 446 of the endpoint in question. 448 4.1.2. Handshake Confirmed 450 In this document, the TLS handshake is considered confirmed at an 451 endpoint when the following two conditions are met: the handshake is 452 complete, and the endpoint has received an acknowledgment for a 453 packet sent with 1-RTT keys. This second condition can be 454 implemented by recording the lowest packet number sent with 1-RTT 455 keys, and the highest value of the Largest Acknowledged field in any 456 received 1-RTT ACK frame: once the latter is higher than or equal to 457 the former, the handshake is confirmed. 459 4.1.3. Sending and Receiving Handshake Messages 461 In order to drive the handshake, TLS depends on being able to send 462 and receive handshake messages. There are two basic functions on 463 this interface: one where QUIC requests handshake messages and one 464 where QUIC provides handshake packets. 466 Before starting the handshake QUIC provides TLS with the transport 467 parameters (see Section 8.2) that it wishes to carry. 469 A QUIC client starts TLS by requesting TLS handshake bytes from TLS. 470 The client acquires handshake bytes before sending its first packet. 471 A QUIC server starts the process by providing TLS with the client's 472 handshake bytes. 474 At any time, the TLS stack at an endpoint will have a current sending 475 encryption level and receiving encryption level. Each encryption 476 level is associated with a different flow of bytes, which is reliably 477 transmitted to the peer in CRYPTO frames. When TLS provides 478 handshake bytes to be sent, they are appended to the current flow and 479 any packet that includes the CRYPTO frame is protected using keys 480 from the corresponding encryption level. 482 QUIC takes the unprotected content of TLS handshake records as the 483 content of CRYPTO frames. TLS record protection is not used by QUIC. 484 QUIC assembles CRYPTO frames into QUIC packets, which are protected 485 using QUIC packet protection. 487 QUIC is only capable of conveying TLS handshake records in CRYPTO 488 frames. TLS alerts are turned into QUIC CONNECTION_CLOSE error 489 codes; see Section 4.9. TLS application data and other message types 490 cannot be carried by QUIC at any encryption level and is an error if 491 they are received from the TLS stack. 493 When an endpoint receives a QUIC packet containing a CRYPTO frame 494 from the network, it proceeds as follows: 496 o If the packet was in the TLS receiving encryption level, sequence 497 the data into the input flow as usual. As with STREAM frames, the 498 offset is used to find the proper location in the data sequence. 499 If the result of this process is that new data is available, then 500 it is delivered to TLS in order. 502 o If the packet is from a previously installed encryption level, it 503 MUST not contain data which extends past the end of previously 504 received data in that flow. Implementations MUST treat any 505 violations of this requirement as a connection error of type 506 PROTOCOL_VIOLATION. 508 o If the packet is from a new encryption level, it is saved for 509 later processing by TLS. Once TLS moves to receiving from this 510 encryption level, saved data can be provided. When providing data 511 from any new encryption level to TLS, if there is data from a 512 previous encryption level that TLS has not consumed, this MUST be 513 treated as a connection error of type PROTOCOL_VIOLATION. 515 Each time that TLS is provided with new data, new handshake bytes are 516 requested from TLS. TLS might not provide any bytes if the handshake 517 messages it has received are incomplete or it has no data to send. 519 Once the TLS handshake is complete, this is indicated to QUIC along 520 with any final handshake bytes that TLS needs to send. TLS also 521 provides QUIC with the transport parameters that the peer advertised 522 during the handshake. 524 Once the handshake is complete, TLS becomes passive. TLS can still 525 receive data from its peer and respond in kind, but it will not need 526 to send more data unless specifically requested - either by an 527 application or QUIC. One reason to send data is that the server 528 might wish to provide additional or updated session tickets to a 529 client. 531 When the handshake is complete, QUIC only needs to provide TLS with 532 any data that arrives in CRYPTO streams. In the same way that is 533 done during the handshake, new data is requested from TLS after 534 providing received data. 536 4.1.4. Encryption Level Changes 538 As keys for new encryption levels become available, TLS provides QUIC 539 with those keys. Separately, as keys at a given encryption level 540 become available to TLS, TLS indicates to QUIC that reading or 541 writing keys at that encryption level are available. These events 542 are not asynchronous; they always occur immediately after TLS is 543 provided with new handshake bytes, or after TLS produces handshake 544 bytes. 546 TLS provides QUIC with three items as a new encryption level becomes 547 available: 549 o A secret 551 o An Authenticated Encryption with Associated Data (AEAD) function 553 o A Key Derivation Function (KDF) 555 These values are based on the values that TLS negotiates and are used 556 by QUIC to generate packet and header protection keys (see Section 5 557 and Section 5.4). 559 If 0-RTT is possible, it is ready after the client sends a TLS 560 ClientHello message or the server receives that message. After 561 providing a QUIC client with the first handshake bytes, the TLS stack 562 might signal the change to 0-RTT keys. On the server, after 563 receiving handshake bytes that contain a ClientHello message, a TLS 564 server might signal that 0-RTT keys are available. 566 Although TLS only uses one encryption level at a time, QUIC may use 567 more than one level. For instance, after sending its Finished 568 message (using a CRYPTO frame at the Handshake encryption level) an 569 endpoint can send STREAM data (in 1-RTT encryption). If the Finished 570 message is lost, the endpoint uses the Handshake encryption level to 571 retransmit the lost message. Reordering or loss of packets can mean 572 that QUIC will need to handle packets at multiple encryption levels. 573 During the handshake, this means potentially handling packets at 574 higher and lower encryption levels than the current encryption level 575 used by TLS. 577 In particular, server implementations need to be able to read packets 578 at the Handshake encryption level at the same time as the 0-RTT 579 encryption level. A client could interleave ACK frames that are 580 protected with Handshake keys with 0-RTT data and the server needs to 581 process those acknowledgments in order to detect lost Handshake 582 packets. 584 QUIC also needs access to keys that might not ordinarily be available 585 to a TLS implementation. For instance, a client might need to 586 acknowledge Handshake packets before it is ready to send CRYPTO 587 frames at that encryption level. TLS therefore needs to provide keys 588 to QUIC before it might produce them for its own use. 590 4.1.5. TLS Interface Summary 592 Figure 5 summarizes the exchange between QUIC and TLS for both client 593 and server. Each arrow is tagged with the encryption level used for 594 that transmission. 596 Client Server 598 Get Handshake 599 Initial -------------> 600 Handshake Received 601 Install tx 0-RTT Keys 602 0-RTT ---------------> 603 Get Handshake 604 <------------- Initial 605 Handshake Received 606 Install Handshake keys 607 Install rx 0-RTT keys 608 Install Handshake keys 609 Get Handshake 610 <----------- Handshake 611 Handshake Received 612 Install tx 1-RTT keys 613 <--------------- 1-RTT 614 Get Handshake 615 Handshake Complete 616 Handshake -----------> 617 Handshake Received 618 Install rx 1-RTT keys 619 Handshake Complete 620 Install 1-RTT keys 621 1-RTT ---------------> 622 Get Handshake 623 <--------------- 1-RTT 624 Handshake Received 626 Figure 5: Interaction Summary between QUIC and TLS 628 Figure 5 shows the multiple packets that form a single "flight" of 629 messages being processed individually, to show what incoming messages 630 trigger different actions. New handshake messages are requested 631 after all incoming packets have been processed. This process might 632 vary depending on how QUIC implementations and the packets they 633 receive are structured. 635 4.2. TLS Version 637 This document describes how TLS 1.3 [TLS13] is used with QUIC. 639 In practice, the TLS handshake will negotiate a version of TLS to 640 use. This could result in a newer version of TLS than 1.3 being 641 negotiated if both endpoints support that version. This is 642 acceptable provided that the features of TLS 1.3 that are used by 643 QUIC are supported by the newer version. 645 A badly configured TLS implementation could negotiate TLS 1.2 or 646 another older version of TLS. An endpoint MUST terminate the 647 connection if a version of TLS older than 1.3 is negotiated. 649 4.3. ClientHello Size 651 The first Initial packet from a client contains the start or all of 652 its first cryptographic handshake message, which for TLS is the 653 ClientHello. Servers might need to parse the entire ClientHello 654 (e.g., to access extensions such as Server Name Identification (SNI) 655 or Application Layer Protocol Negotiation (ALPN)) in order to decide 656 whether to accept the new incoming QUIC connection. If the 657 ClientHello spans multiple Initial packets, such servers would need 658 to buffer the first received fragments, which could consume excessive 659 resources if the client's address has not yet been validated. To 660 avoid this, servers MAY use the Retry feature (see Section 8.1 of 661 [QUIC-TRANSPORT]) to only buffer partial ClientHello messages from 662 clients with a validated address. 664 QUIC packet and framing add at least 36 bytes of overhead to the 665 ClientHello message. That overhead increases if the client chooses a 666 connection ID without zero length. Overheads also do not include the 667 token or a connection ID longer than 8 bytes, both of which might be 668 required if a server sends a Retry packet. 670 A typical TLS ClientHello can easily fit into a 1200 byte packet. 671 However, in addition to the overheads added by QUIC, there are 672 several variables that could cause this limit to be exceeded. Large 673 session tickets, multiple or large key shares, and long lists of 674 supported ciphers, signature algorithms, versions, QUIC transport 675 parameters, and other negotiable parameters and extensions could 676 cause this message to grow. 678 For servers, in addition to connection IDs and tokens, the size of 679 TLS session tickets can have an effect on a client's ability to 680 connect efficiently. Minimizing the size of these values increases 681 the probability that clients can use them and still fit their 682 ClientHello message in their first Initial packet. 684 The TLS implementation does not need to ensure that the ClientHello 685 is sufficiently large. QUIC PADDING frames are added to increase the 686 size of the packet as necessary. 688 4.4. Peer Authentication 690 The requirements for authentication depend on the application 691 protocol that is in use. TLS provides server authentication and 692 permits the server to request client authentication. 694 A client MUST authenticate the identity of the server. This 695 typically involves verification that the identity of the server is 696 included in a certificate and that the certificate is issued by a 697 trusted entity (see for example [RFC2818]). 699 A server MAY request that the client authenticate during the 700 handshake. A server MAY refuse a connection if the client is unable 701 to authenticate when requested. The requirements for client 702 authentication vary based on application protocol and deployment. 704 A server MUST NOT use post-handshake client authentication (as 705 defined in Section 4.6.2 of [TLS13]), because the multiplexing 706 offered by QUIC prevents clients from correlating the certificate 707 request with the application-level event that triggered it (see 708 [HTTP2-TLS13]). More specifically, servers MUST NOT send post- 709 handshake TLS CertificateRequest messages and clients MUST treat 710 receipt of such messages as a connection error of type 711 PROTOCOL_VIOLATION. 713 4.5. Enabling 0-RTT 715 To communicate their willingness to process 0-RTT data, servers send 716 a NewSessionTicket message that contains the "early_data" extension 717 with a max_early_data_size of 0xffffffff; the amount of data which 718 the client can send in 0-RTT is controlled by the "initial_max_data" 719 transport parameter supplied by the server. Servers MUST NOT send 720 the "early_data" extension with a max_early_data_size set to any 721 value other than 0xffffffff. A client MUST treat receipt of a 722 NewSessionTicket that contains an "early_data" extension with any 723 other value as a connection error of type PROTOCOL_VIOLATION. 725 A client that wishes to send 0-RTT packets uses the "early_data" 726 extension in the ClientHello message of a subsequent handshake (see 727 Section 4.2.10 of [TLS13]). It then sends the application data in 728 0-RTT packets. 730 4.6. Accepting and Rejecting 0-RTT 732 A server accepts 0-RTT by sending an early_data extension in the 733 EncryptedExtensions (see Section 4.2.10 of [TLS13]). The server then 734 processes and acknowledges the 0-RTT packets that it receives. 736 A server rejects 0-RTT by sending the EncryptedExtensions without an 737 early_data extension. A server will always reject 0-RTT if it sends 738 a TLS HelloRetryRequest. When rejecting 0-RTT, a server MUST NOT 739 process any 0-RTT packets, even if it could. When 0-RTT was 740 rejected, a client SHOULD treat receipt of an acknowledgement for a 741 0-RTT packet as a connection error of type PROTOCOL_VIOLATION, if it 742 is able to detect the condition. 744 When 0-RTT is rejected, all connection characteristics that the 745 client assumed might be incorrect. This includes the choice of 746 application protocol, transport parameters, and any application 747 configuration. The client therefore MUST reset the state of all 748 streams, including application state bound to those streams. 750 A client MAY attempt to send 0-RTT again if it receives a Retry or 751 Version Negotiation packet. These packets do not signify rejection 752 of 0-RTT. 754 4.7. Validating 0-RTT Configuration 756 When a server receives a ClientHello with the "early_data" extension, 757 it has to decide whether to accept or reject early data from the 758 client. Some of this decision is made by the TLS stack (e.g., 759 checking that the cipher suite being resumed was included in the 760 ClientHello; see Section 4.2.10 of [TLS13]). Even when the TLS stack 761 has no reason to reject early data, the QUIC stack or the application 762 protocol using QUIC might reject early data because the configuration 763 of the transport or application associated with the resumed session 764 is not compatible with the server's current configuration. 766 QUIC requires additional transport state to be associated with a 767 0-RTT session ticket. One common way to implement this is using 768 stateless session tickets and storing this state in the session 769 ticket. Application protocols that use QUIC might have similar 770 requirements regarding associating or storing state. This associated 771 state is used for deciding whether early data must be rejected. For 772 example, HTTP/3 ([QUIC-HTTP]) settings determine how early data from 773 the client is interpreted. Other applications using QUIC could have 774 different requirements for determining whether to accept or reject 775 early data. 777 4.8. HelloRetryRequest 779 In TLS over TCP, the HelloRetryRequest feature (see Section 4.1.4 of 780 [TLS13]) can be used to correct a client's incorrect KeyShare 781 extension as well as for a stateless round-trip check. From the 782 perspective of QUIC, this just looks like additional messages carried 783 in the Initial encryption level. Although it is in principle 784 possible to use this feature for address verification in QUIC, QUIC 785 implementations SHOULD instead use the Retry feature (see Section 8.1 786 of [QUIC-TRANSPORT]). HelloRetryRequest is still used to request key 787 shares. 789 4.9. TLS Errors 791 If TLS experiences an error, it generates an appropriate alert as 792 defined in Section 6 of [TLS13]. 794 A TLS alert is turned into a QUIC connection error by converting the 795 one-byte alert description into a QUIC error code. The alert 796 description is added to 0x100 to produce a QUIC error code from the 797 range reserved for CRYPTO_ERROR. The resulting value is sent in a 798 QUIC CONNECTION_CLOSE frame. 800 The alert level of all TLS alerts is "fatal"; a TLS stack MUST NOT 801 generate alerts at the "warning" level. 803 4.10. Discarding Unused Keys 805 After QUIC moves to a new encryption level, packet protection keys 806 for previous encryption levels can be discarded. This occurs several 807 times during the handshake, as well as when keys are updated; see 808 Section 6. 810 Packet protection keys are not discarded immediately when new keys 811 are available. If packets from a lower encryption level contain 812 CRYPTO frames, frames that retransmit that data MUST be sent at the 813 same encryption level. Similarly, an endpoint generates 814 acknowledgements for packets at the same encryption level as the 815 packet being acknowledged. Thus, it is possible that keys for a 816 lower encryption level are needed for a short time after keys for a 817 newer encryption level are available. 819 An endpoint cannot discard keys for a given encryption level unless 820 it has both received and acknowledged all CRYPTO frames for that 821 encryption level and when all CRYPTO frames for that encryption level 822 have been acknowledged by its peer. However, this does not guarantee 823 that no further packets will need to be received or sent at that 824 encryption level because a peer might not have received all the 825 acknowledgements necessary to reach the same state. 827 Though an endpoint might retain older keys, new data MUST be sent at 828 the highest currently-available encryption level. Only ACK frames 829 and retransmissions of data in CRYPTO frames are sent at a previous 830 encryption level. These packets MAY also include PADDING frames. 832 4.10.1. Discarding Initial Keys 834 Packets protected with Initial secrets (Section 5.2) are not 835 authenticated, meaning that an attacker could spoof packets with the 836 intent to disrupt a connection. To limit these attacks, Initial 837 packet protection keys can be discarded more aggressively than other 838 keys. 840 The successful use of Handshake packets indicates that no more 841 Initial packets need to be exchanged, as these keys can only be 842 produced after receiving all CRYPTO frames from Initial packets. 843 Thus, a client MUST discard Initial keys when it first sends a 844 Handshake packet and a server MUST discard Initial keys when it first 845 successfully processes a Handshake packet. Endpoints MUST NOT send 846 Initial packets after this point. 848 This results in abandoning loss recovery state for the Initial 849 encryption level and ignoring any outstanding Initial packets. 851 4.10.2. Discarding Handshake Keys 853 An endpoint MUST NOT discard its handshake keys until the TLS 854 handshake is confirmed (Section 4.1.2). An endpoint SHOULD discard 855 its handshake keys as soon as it has confirmed the handshake. Most 856 application protocols will send data after the handshake, resulting 857 in acknowledgements that allow both endpoints to discard their 858 handshake keys promptly. Endpoints that do not have reason to send 859 immediately after completing the handshake MAY send ack-eliciting 860 frames, such as PING, which will cause the handshake to be confirmed 861 when they are acknowledged. 863 4.10.3. Discarding 0-RTT Keys 865 0-RTT and 1-RTT packets share the same packet number space, and 866 clients do not send 0-RTT packets after sending a 1-RTT packet 867 (Section 5.6). 869 Therefore, a client SHOULD discard 0-RTT keys as soon as it installs 870 1-RTT keys, since they have no use after that moment. 872 Additionally, a server MAY discard 0-RTT keys as soon as it receives 873 a 1-RTT packet. However, due to packet reordering, a 0-RTT packet 874 could arrive after a 1-RTT packet. Servers MAY temporarily retain 875 0-RTT keys to allow decrypting reordered packets without requiring 876 their contents to be retransmitted with 1-RTT keys. After receiving 877 a 1-RTT packet, servers MUST discard 0-RTT keys within a short time; 878 the RECOMMENDED time period is three times the Probe Timeout (PTO, 879 see [QUIC-RECOVERY]). A server MAY discard 0-RTT keys earlier if it 880 determines that it has received all 0-RTT packets, which can be done 881 by keeping track of missing packet numbers. 883 5. Packet Protection 885 As with TLS over TCP, QUIC protects packets with keys derived from 886 the TLS handshake, using the AEAD algorithm negotiated by TLS. 888 5.1. Packet Protection Keys 890 QUIC derives packet protection keys in the same way that TLS derives 891 record protection keys. 893 Each encryption level has separate secret values for protection of 894 packets sent in each direction. These traffic secrets are derived by 895 TLS (see Section 7.1 of [TLS13]) and are used by QUIC for all 896 encryption levels except the Initial encryption level. The secrets 897 for the Initial encryption level are computed based on the client's 898 initial Destination Connection ID, as described in Section 5.2. 900 The keys used for packet protection are computed from the TLS secrets 901 using the KDF provided by TLS. In TLS 1.3, the HKDF-Expand-Label 902 function described in Section 7.1 of [TLS13] is used, using the hash 903 function from the negotiated cipher suite. Other versions of TLS 904 MUST provide a similar function in order to be used with QUIC. 906 The current encryption level secret and the label "quic key" are 907 input to the KDF to produce the AEAD key; the label "quic iv" is used 908 to derive the IV; see Section 5.3. The header protection key uses 909 the "quic hp" label; see Section 5.4. Using these labels provides 910 key separation between QUIC and TLS; see Section 9.5. 912 The KDF used for initial secrets is always the HKDF-Expand-Label 913 function from TLS 1.3 (see Section 5.2). 915 5.2. Initial Secrets 917 Initial packets are protected with a secret derived from the 918 Destination Connection ID field from the client's Initial packet. 919 Specifically: 921 initial_salt = 0xc3eef712c72ebb5a11a7d2432bb46365bef9f502 922 initial_secret = HKDF-Extract(initial_salt, 923 client_dst_connection_id) 925 client_initial_secret = HKDF-Expand-Label(initial_secret, 926 "client in", "", 927 Hash.length) 928 server_initial_secret = HKDF-Expand-Label(initial_secret, 929 "server in", "", 930 Hash.length) 932 The hash function for HKDF when deriving initial secrets and keys is 933 SHA-256 [SHA]. 935 The connection ID used with HKDF-Expand-Label is the Destination 936 Connection ID in the Initial packet sent by the client. This will be 937 a randomly-selected value unless the client creates the Initial 938 packet after receiving a Retry packet, where the Destination 939 Connection ID is selected by the server. 941 The value of initial_salt is a 20 byte sequence shown in the figure 942 in hexadecimal notation. Future versions of QUIC SHOULD generate a 943 new salt value, thus ensuring that the keys are different for each 944 version of QUIC. This prevents a middlebox that only recognizes one 945 version of QUIC from seeing or modifying the contents of packets from 946 future versions. 948 The HKDF-Expand-Label function defined in TLS 1.3 MUST be used for 949 Initial packets even where the TLS versions offered do not include 950 TLS 1.3. 952 The secrets used for protecting Initial packets change when a server 953 sends a Retry packet to use the connection ID value selected by the 954 server. The secrets do not change when a client changes the 955 Destination Connection ID it uses in response to an Initial packet 956 from the server. 958 Note: The Destination Connection ID is of arbitrary length, and it 959 could be zero length if the server sends a Retry packet with a 960 zero-length Source Connection ID field. In this case, the Initial 961 keys provide no assurance to the client that the server received 962 its packet; the client has to rely on the exchange that included 963 the Retry packet for that property. 965 Appendix A contains test vectors for the initial packet encryption. 967 5.3. AEAD Usage 969 The Authentication Encryption with Associated Data (AEAD) [AEAD] 970 function used for QUIC packet protection is the AEAD that is 971 negotiated for use with the TLS connection. For example, if TLS is 972 using the TLS_AES_128_GCM_SHA256, the AEAD_AES_128_GCM function is 973 used. 975 Packets are protected prior to applying header protection 976 (Section 5.4). The unprotected packet header is part of the 977 associated data (A). When removing packet protection, an endpoint 978 first removes the header protection. 980 All QUIC packets other than Version Negotiation and Retry packets are 981 protected with an AEAD algorithm [AEAD]. Prior to establishing a 982 shared secret, packets are protected with AEAD_AES_128_GCM and a key 983 derived from the Destination Connection ID in the client's first 984 Initial packet (see Section 5.2). This provides protection against 985 off-path attackers and robustness against QUIC version unaware 986 middleboxes, but not against on-path attackers. 988 QUIC can use any of the ciphersuites defined in [TLS13] with the 989 exception of TLS_AES_128_CCM_8_SHA256. A ciphersuite MUST NOT be 990 negotiated unless a header protection scheme is defined for the 991 ciphersuite. This document defines a header protection scheme for 992 all ciphersuites defined in [TLS13] aside from 993 TLS_AES_128_CCM_8_SHA256. These ciphersuites have a 16-byte 994 authentication tag and produce an output 16 bytes larger than their 995 input. 997 Note: An endpoint MUST NOT reject a ClientHello that offers a 998 ciphersuite that it does not support, or it would be impossible to 999 deploy a new ciphersuite. This also applies to 1000 TLS_AES_128_CCM_8_SHA256. 1002 The key and IV for the packet are computed as described in 1003 Section 5.1. The nonce, N, is formed by combining the packet 1004 protection IV with the packet number. The 62 bits of the 1005 reconstructed QUIC packet number in network byte order are left- 1006 padded with zeros to the size of the IV. The exclusive OR of the 1007 padded packet number and the IV forms the AEAD nonce. 1009 The associated data, A, for the AEAD is the contents of the QUIC 1010 header, starting from the flags byte in either the short or long 1011 header, up to and including the unprotected packet number. 1013 The input plaintext, P, for the AEAD is the payload of the QUIC 1014 packet, as described in [QUIC-TRANSPORT]. 1016 The output ciphertext, C, of the AEAD is transmitted in place of P. 1018 Some AEAD functions have limits for how many packets can be encrypted 1019 under the same key and IV (see for example [AEBounds]). This might 1020 be lower than the packet number limit. An endpoint MUST initiate a 1021 key update (Section 6) prior to exceeding any limit set for the AEAD 1022 that is in use. 1024 5.4. Header Protection 1026 Parts of QUIC packet headers, in particular the Packet Number field, 1027 are protected using a key that is derived separate to the packet 1028 protection key and IV. The key derived using the "quic hp" label is 1029 used to provide confidentiality protection for those fields that are 1030 not exposed to on-path elements. 1032 This protection applies to the least-significant bits of the first 1033 byte, plus the Packet Number field. The four least-significant bits 1034 of the first byte are protected for packets with long headers; the 1035 five least significant bits of the first byte are protected for 1036 packets with short headers. For both header forms, this covers the 1037 reserved bits and the Packet Number Length field; the Key Phase bit 1038 is also protected for packets with a short header. 1040 The same header protection key is used for the duration of the 1041 connection, with the value not changing after a key update (see 1042 Section 6). This allows header protection to be used to protect the 1043 key phase. 1045 This process does not apply to Retry or Version Negotiation packets, 1046 which do not contain a protected payload or any of the fields that 1047 are protected by this process. 1049 5.4.1. Header Protection Application 1051 Header protection is applied after packet protection is applied (see 1052 Section 5.3). The ciphertext of the packet is sampled and used as 1053 input to an encryption algorithm. The algorithm used depends on the 1054 negotiated AEAD. 1056 The output of this algorithm is a 5 byte mask which is applied to the 1057 protected header fields using exclusive OR. The least significant 1058 bits of the first byte of the packet are masked by the least 1059 significant bits of the first mask byte, and the packet number is 1060 masked with the remaining bytes. Any unused bytes of mask that might 1061 result from a shorter packet number encoding are unused. 1063 Figure 6 shows a sample algorithm for applying header protection. 1064 Removing header protection only differs in the order in which the 1065 packet number length (pn_length) is determined. 1067 mask = header_protection(hp_key, sample) 1069 pn_length = (packet[0] & 0x03) + 1 1070 if (packet[0] & 0x80) == 0x80: 1071 # Long header: 4 bits masked 1072 packet[0] ^= mask[0] & 0x0f 1073 else: 1074 # Short header: 5 bits masked 1075 packet[0] ^= mask[0] & 0x1f 1077 # pn_offset is the start of the Packet Number field. 1078 packet[pn_offset:pn_offset+pn_length] ^= mask[1:1+pn_length] 1080 Figure 6: Header Protection Pseudocode 1082 Figure 7 shows the protected fields of long and short headers marked 1083 with an E. Figure 7 also shows the sampled fields. 1085 Long Header: 1086 +-+-+-+-+-+-+-+-+ 1087 |1|1|T T|E E E E| 1088 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1089 | Version -> Length Fields ... 1090 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1092 Short Header: 1093 +-+-+-+-+-+-+-+-+ 1094 |0|1|S|E E E E E| 1095 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1096 | Destination Connection ID (0/32..144) ... 1097 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1099 Common Fields: 1100 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1101 |E E E E E E E E E Packet Number (8/16/24/32) E E E E E E E E... 1102 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1103 | [Protected Payload (8/16/24)] ... 1104 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1105 | Sampled part of Protected Payload (128) ... 1106 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1107 | Protected Payload Remainder (*) ... 1108 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1110 Figure 7: Header Protection and Ciphertext Sample 1112 Before a TLS ciphersuite can be used with QUIC, a header protection 1113 algorithm MUST be specified for the AEAD used with that ciphersuite. 1114 This document defines algorithms for AEAD_AES_128_GCM, 1115 AEAD_AES_128_CCM, AEAD_AES_256_GCM (all AES AEADs are defined in 1116 [AEAD]), and AEAD_CHACHA20_POLY1305 [CHACHA]. Prior to TLS selecting 1117 a ciphersuite, AES header protection is used (Section 5.4.3), 1118 matching the AEAD_AES_128_GCM packet protection. 1120 5.4.2. Header Protection Sample 1122 The header protection algorithm uses both the header protection key 1123 and a sample of the ciphertext from the packet Payload field. 1125 The same number of bytes are always sampled, but an allowance needs 1126 to be made for the endpoint removing protection, which will not know 1127 the length of the Packet Number field. In sampling the packet 1128 ciphertext, the Packet Number field is assumed to be 4 bytes long 1129 (its maximum possible encoded length). 1131 An endpoint MUST discard packets that are not long enough to contain 1132 a complete sample. 1134 To ensure that sufficient data is available for sampling, packets are 1135 padded so that the combined lengths of the encoded packet number and 1136 protected payload is at least 4 bytes longer than the sample required 1137 for header protection. The ciphersuites defined in [TLS13] - other 1138 than TLS_AES_128_CCM_8_SHA256, for which a header protection scheme 1139 is not defined in this document - have 16-byte expansions and 16-byte 1140 header protection samples. This results in needing at least 3 bytes 1141 of frames in the unprotected payload if the packet number is encoded 1142 on a single byte, or 2 bytes of frames for a 2-byte packet number 1143 encoding. 1145 The sampled ciphertext for a packet with a short header can be 1146 determined by the following pseudocode: 1148 sample_offset = 1 + len(connection_id) + 4 1150 sample = packet[sample_offset..sample_offset+sample_length] 1152 For example, for a packet with a short header, an 8 byte connection 1153 ID, and protected with AEAD_AES_128_GCM, the sample takes bytes 13 to 1154 28 inclusive (using zero-based indexing). 1156 A packet with a long header is sampled in the same way, noting that 1157 multiple QUIC packets might be included in the same UDP datagram and 1158 that each one is handled separately. 1160 sample_offset = 7 + len(destination_connection_id) + 1161 len(source_connection_id) + 1162 len(payload_length) + 4 1163 if packet_type == Initial: 1164 sample_offset += len(token_length) + 1165 len(token) 1167 sample = packet[sample_offset..sample_offset+sample_length] 1169 5.4.3. AES-Based Header Protection 1171 This section defines the packet protection algorithm for 1172 AEAD_AES_128_GCM, AEAD_AES_128_CCM, and AEAD_AES_256_GCM. 1173 AEAD_AES_128_GCM and AEAD_AES_128_CCM use 128-bit AES [AES] in 1174 electronic code-book (ECB) mode. AEAD_AES_256_GCM uses 256-bit AES 1175 in ECB mode. 1177 This algorithm samples 16 bytes from the packet ciphertext. This 1178 value is used as the input to AES-ECB. In pseudocode: 1180 mask = AES-ECB(hp_key, sample) 1182 5.4.4. ChaCha20-Based Header Protection 1184 When AEAD_CHACHA20_POLY1305 is in use, header protection uses the raw 1185 ChaCha20 function as defined in Section 2.4 of [CHACHA]. This uses a 1186 256-bit key and 16 bytes sampled from the packet protection output. 1188 The first 4 bytes of the sampled ciphertext are the block counter. A 1189 ChaCha20 implementation could take a 32-bit integer in place of a 1190 byte sequence, in which case the byte sequence is interpreted as a 1191 little-endian value. 1193 The remaining 12 bytes are used as the nonce. A ChaCha20 1194 implementation might take an array of three 32-bit integers in place 1195 of a byte sequence, in which case the nonce bytes are interpreted as 1196 a sequence of 32-bit little-endian integers. 1198 The encryption mask is produced by invoking ChaCha20 to protect 5 1199 zero bytes. In pseudocode: 1201 counter = sample[0..3] 1202 nonce = sample[4..15] 1203 mask = ChaCha20(hp_key, counter, nonce, {0,0,0,0,0}) 1205 5.5. Receiving Protected Packets 1207 Once an endpoint successfully receives a packet with a given packet 1208 number, it MUST discard all packets in the same packet number space 1209 with higher packet numbers if they cannot be successfully unprotected 1210 with either the same key, or - if there is a key update - the next 1211 packet protection key (see Section 6). Similarly, a packet that 1212 appears to trigger a key update, but cannot be unprotected 1213 successfully MUST be discarded. 1215 Failure to unprotect a packet does not necessarily indicate the 1216 existence of a protocol error in a peer or an attack. The truncated 1217 packet number encoding used in QUIC can cause packet numbers to be 1218 decoded incorrectly if they are delayed significantly. 1220 5.6. Use of 0-RTT Keys 1222 If 0-RTT keys are available (see Section 4.5), the lack of replay 1223 protection means that restrictions on their use are necessary to 1224 avoid replay attacks on the protocol. 1226 A client MUST only use 0-RTT keys to protect data that is idempotent. 1227 A client MAY wish to apply additional restrictions on what data it 1228 sends prior to the completion of the TLS handshake. A client 1229 otherwise treats 0-RTT keys as equivalent to 1-RTT keys, except that 1230 it MUST NOT send ACKs with 0-RTT keys. 1232 A client that receives an indication that its 0-RTT data has been 1233 accepted by a server can send 0-RTT data until it receives all of the 1234 server's handshake messages. A client SHOULD stop sending 0-RTT data 1235 if it receives an indication that 0-RTT data has been rejected. 1237 A server MUST NOT use 0-RTT keys to protect packets; it uses 1-RTT 1238 keys to protect acknowledgements of 0-RTT packets. A client MUST NOT 1239 attempt to decrypt 0-RTT packets it receives and instead MUST discard 1240 them. 1242 Once a client has installed 1-RTT keys, it MUST NOT send any more 1243 0-RTT packets. 1245 Note: 0-RTT data can be acknowledged by the server as it receives 1246 it, but any packets containing acknowledgments of 0-RTT data 1247 cannot have packet protection removed by the client until the TLS 1248 handshake is complete. The 1-RTT keys necessary to remove packet 1249 protection cannot be derived until the client receives all server 1250 handshake messages. 1252 5.7. Receiving Out-of-Order Protected Frames 1254 Due to reordering and loss, protected packets might be received by an 1255 endpoint before the final TLS handshake messages are received. A 1256 client will be unable to decrypt 1-RTT packets from the server, 1257 whereas a server will be able to decrypt 1-RTT packets from the 1258 client. 1260 Even though 1-RTT keys are available to a server after receiving the 1261 first handshake messages from a client, it is missing assurances on 1262 the client state: 1264 o The client is not authenticated, unless the server has chosen to 1265 use a pre-shared key and validated the client's pre-shared key 1266 binder; see Section 4.2.11 of [TLS13]. 1268 o The client has not demonstrated liveness, unless a RETRY packet 1269 was used. 1271 o Any received 0-RTT data that the server responds to might be due 1272 to a replay attack. 1274 Therefore, the server's use of 1-RTT keys is limited before the 1275 handshake is complete. A server MUST NOT process data from incoming 1276 1-RTT protected packets before the TLS handshake is complete. 1277 Because sending acknowledgments indicates that all frames in a packet 1278 have been processed, a server cannot send acknowledgments for 1-RTT 1279 packets until the TLS handshake is complete. Received packets 1280 protected with 1-RTT keys MAY be stored and later decrypted and used 1281 once the handshake is complete. 1283 The requirement for the server to wait for the client Finished 1284 message creates a dependency on that message being delivered. A 1285 client can avoid the potential for head-of-line blocking that this 1286 implies by sending its 1-RTT packets coalesced with a handshake 1287 packet containing a copy of the CRYPTO frame that carries the 1288 Finished message, until one of the handshake packets is acknowledged. 1289 This enables immediate server processing for those packets. 1291 A server could receive packets protected with 0-RTT keys prior to 1292 receiving a TLS ClientHello. The server MAY retain these packets for 1293 later decryption in anticipation of receiving a ClientHello. 1295 6. Key Update 1297 Once the handshake is confirmed (see Section 4.1.2), an endpoint MAY 1298 initiate a key update. 1300 The Key Phase bit indicates which packet protection keys are used to 1301 protect the packet. The Key Phase bit is initially set to 0 for the 1302 first set of 1-RTT packets and toggled to signal each subsequent key 1303 update. 1305 The Key Phase bit allows a recipient to detect a change in keying 1306 material without needing to receive the first packet that triggered 1307 the change. An endpoint that notices a changed Key Phase bit updates 1308 keys and decrypts the packet that contains the changed value. 1310 This mechanism replaces the TLS KeyUpdate message. Endpoints MUST 1311 NOT send a TLS KeyUpdate message. Endpoints MUST treat the receipt 1312 of a TLS KeyUpdate message as a connection error of type 0x10a, 1313 equivalent to a fatal TLS alert of unexpected_message (see 1314 Section 4.9). 1316 Figure 8 shows a key update process, where the initial set of keys 1317 used (identified with @M) are replaced by updated keys (identified 1318 with @N). The value of the Key Phase bit is indicated in brackets 1319 []. 1321 Initiating Peer Responding Peer 1323 @M [0] QUIC Packets 1325 ... Update to @N 1326 @N [1] QUIC Packets 1327 --------> 1328 Update to @N ... 1329 QUIC Packets [1] @N 1330 <-------- 1331 QUIC Packets [1] @N 1332 containing ACK 1333 <-------- 1334 ... Key Update Permitted 1336 @N [1] QUIC Packets 1337 containing ACK for @N packets 1338 --------> 1339 Key Update Permitted ... 1341 Figure 8: Key Update 1343 6.1. Initiating a Key Update 1345 Endpoints maintain separate read and write secrets for packet 1346 protection. An endpoint initiates a key update by updating its 1347 packet protection write secret and using that to protect new packets. 1349 The endpoint creates a new write secret from the existing write 1350 secret as performed in Section 7.2 of [TLS13]. This uses the KDF 1351 function provided by TLS with a label of "quic ku". The 1352 corresponding key and IV are created from that secret as defined in 1353 Section 5.1. The header protection key is not updated. 1355 For example, to update write keys with TLS 1.3, HKDF-Expand-Label is 1356 used as: 1358 secret_ = HKDF-Expand-Label(secret_, "quic ku", 1359 "", Hash.length) 1361 The endpoint toggles the value of the Key Phase bit and uses the 1362 updated key and IV to protect all subsequent packets. 1364 An endpoint MUST NOT initiate a key update prior to having confirmed 1365 the handshake (Section 4.1.2). An endpoint MUST NOT initiate a 1366 subsequent key update prior unless it has received an acknowledgment 1367 for a packet that was sent protected with keys from the current key 1368 phase. This ensures that keys are available to both peers before 1369 another key update can be initiated. This can be implemented by 1370 tracking the lowest packet number sent with each key phase, and the 1371 highest acknowledged packet number in the 1-RTT space: once the 1372 latter is higher than or equal to the former, another key update can 1373 be initiated. 1375 Note: Keys of packets other than the 1-RTT packets are never 1376 updated; their keys are derived solely from the TLS handshake 1377 state. 1379 The endpoint that initiates a key update also updates the keys that 1380 it uses for receiving packets. These keys will be needed to process 1381 packets the peer sends after updating. 1383 An endpoint SHOULD retain old keys so that packets sent by its peer 1384 prior to receiving the key update can be processed. Discarding old 1385 keys too early can cause delayed packets to be discarded. Discarding 1386 packets will be interpreted as packet loss by the peer and could 1387 adversely affect performance. 1389 6.2. Responding to a Key Update 1391 A peer is permitted to initiate a key update after receiving an 1392 acknowledgement of a packet in the current key phase. An endpoint 1393 detects a key update when processing a packet with a key phase that 1394 differs from the value last used to protect the last packet it sent. 1395 To process this packet, the endpoint uses the next packet protection 1396 key and IV. See Section 6.3 for considerations about generating 1397 these keys. 1399 If a packet is successfully processed using the next key and IV, then 1400 the peer has initiated a key update. The endpoint MUST update its 1401 send keys to the corresponding key phase in response, as described in 1402 Section 6.1. Sending keys MUST be updated before sending an 1403 acknowledgement for the packet that was received with updated keys. 1404 By acknowledging the packet that triggered the key update in a packet 1405 protected with the updated keys, the endpoint signals that the key 1406 update is complete. 1408 An endpoint can defer sending the packet or acknowledgement according 1409 to its normal packet sending behaviour; it is not necessary to 1410 immediately generate a packet in response to a key update. The next 1411 packet sent by the endpoint will use the updated keys. The next 1412 packet that contains an acknowledgement will cause the key update to 1413 be completed. If an endpoint detects a second update before it has 1414 sent any packets with updated keys containing an acknowledgement for 1415 the packet that initiated the key update, it indicates that its peer 1416 has updated keys twice without awaiting confirmation. An endpoint 1417 MAY treat consecutive key updates as a connection error of type 1418 KEY_UPDATE_ERROR. 1420 An endpoint that receives an acknowledgement that is carried in a 1421 packet protected with old keys where any acknowledged packet was 1422 protected with newer keys MAY treat that as a connection error of 1423 type KEY_UPDATE_ERROR. This indicates that a peer has received and 1424 acknowledged a packet that initiates a key update, but has not 1425 updated keys in response. 1427 6.3. Timing of Receive Key Generation 1429 Endpoints responding to an apparent key update MUST NOT generate a 1430 timing side-channel signal that might indicate that the Key Phase bit 1431 was invalid (see Section 9.3). Endpoints can use dummy packet 1432 protection keys in place of discarded keys when key updates are not 1433 yet permitted. Using dummy keys will generate no variation in the 1434 timing signal produced by attempting to remove packet protection, and 1435 results in all packets with an invalid Key Phase bit being rejected. 1437 The process of creating new packet protection keys for receiving 1438 packets could reveal that a key update has occurred. An endpoint MAY 1439 perform this process as part of packet processing, but this creates a 1440 timing signal that can be used by an attacker to learn when key 1441 updates happen and thus the value of the Key Phase bit in certain 1442 packets. Endpoints SHOULD instead defer the creation of the next set 1443 of receive packet protection keys until some time after a key update 1444 completes, up to three times the PTO; see Section 6.5. 1446 Once generated, the next set of packet protection keys SHOULD be 1447 retained, even if the packet that was received was subsequently 1448 discarded. Packets containing apparent key updates are easy to forge 1449 and - while the process of key update does not require significant 1450 effort - triggering this process could be used by an attacker for 1451 DoS. 1453 For this reason, endpoints MUST be able to retain two sets of packet 1454 protection keys for receiving packets: the current and the next. 1455 Retaining the previous keys in addition to these might improve 1456 performance, but this is not essential. 1458 6.4. Sending with Updated Keys 1460 An endpoint always sends packets that are protected with the newest 1461 keys. Keys used for packet protection can be discarded immediately 1462 after switching to newer keys. 1464 Packets with higher packet numbers MUST be protected with either the 1465 same or newer packet protection keys than packets with lower packet 1466 numbers. An endpoint that successfully removes protection with old 1467 keys when newer keys were used for packets with lower packet numbers 1468 MUST treat this as a connection error of type KEY_UPDATE_ERROR. 1470 6.5. Receiving with Different Keys 1472 For receiving packets during a key update, packets protected with 1473 older keys might arrive if they were delayed by the network. 1474 Retaining old packet protection keys allows these packets to be 1475 successfully processed. 1477 As packets protected with keys from the next key phase use the same 1478 Key Phase value as those protected with keys from the previous key 1479 phase, it can be necessary to distinguish between the two. This can 1480 be done using packet numbers. A recovered packet number that is 1481 lower than any packet number from the current key phase uses the 1482 previous packet protection keys; a recovered packet number that is 1483 higher than any packet number from the current key phase requires the 1484 use of the next packet protection keys. 1486 Some care is necessary to ensure that any process for selecting 1487 between previous, current, and next packet protection keys does not 1488 expose a timing side channel that might reveal which keys were used 1489 to remove packet protection. See Section 9.4 for more information. 1491 Alternatively, endpoints can retain only two sets of packet 1492 protection keys, swapping previous for next after enough time has 1493 passed to allow for reordering in the network. In this case, the Key 1494 Phase bit alone can be used to select keys. 1496 An endpoint MAY allow a period of approximately the Probe Timeout 1497 (PTO; see [QUIC-RECOVERY]) after a key update before it creates the 1498 next set of packet protection keys. These updated keys MAY replace 1499 the previous keys at that time. With the caveat that PTO is a 1500 subjective measure - that is, a peer could have a different view of 1501 the RTT - this time is expected to be long enough that any reordered 1502 packets would be declared lost by a peer even if they were 1503 acknowledged and short enough to allow for subsequent key updates. 1505 Endpoints need to allow for the possibility that a peer might not be 1506 able to decrypt packets that initiate a key update during the period 1507 when it retains old keys. Endpoints SHOULD wait three times the PTO 1508 before initiating a key update after receiving an acknowledgment that 1509 confirms that the previous key update was received. Failing to allow 1510 sufficient time could lead to packets being discarded. 1512 An endpoint SHOULD retain old read keys for no more than three times 1513 the PTO. After this period, old read keys and their corresponding 1514 secrets SHOULD be discarded. 1516 6.6. Key Update Frequency 1518 Key updates MUST be initiated before usage limits on packet 1519 protection keys are exceeded. For the cipher suites mentioned in 1520 this document, the limits in Section 5.5 of [TLS13] apply. Other 1521 cipher suites MUST define usage limits in order to be used with QUIC. 1523 6.7. Key Update Error Code 1525 The KEY_UPDATE_ERROR error code (0xE) is used to signal errors 1526 related to key updates. 1528 7. Security of Initial Messages 1530 Initial packets are not protected with a secret key, so they are 1531 subject to potential tampering by an attacker. QUIC provides 1532 protection against attackers that cannot read packets, but does not 1533 attempt to provide additional protection against attacks where the 1534 attacker can observe and inject packets. Some forms of tampering - 1535 such as modifying the TLS messages themselves - are detectable, but 1536 some - such as modifying ACKs - are not. 1538 For example, an attacker could inject a packet containing an ACK 1539 frame that makes it appear that a packet had not been received or to 1540 create a false impression of the state of the connection (e.g., by 1541 modifying the ACK Delay). Note that such a packet could cause a 1542 legitimate packet to be dropped as a duplicate. Implementations 1543 SHOULD use caution in relying on any data which is contained in 1544 Initial packets that is not otherwise authenticated. 1546 It is also possible for the attacker to tamper with data that is 1547 carried in Handshake packets, but because that tampering requires 1548 modifying TLS handshake messages, that tampering will cause the TLS 1549 handshake to fail. 1551 8. QUIC-Specific Additions to the TLS Handshake 1553 QUIC uses the TLS handshake for more than just negotiation of 1554 cryptographic parameters. The TLS handshake provides preliminary 1555 values for QUIC transport parameters and allows a server to perform 1556 return routability checks on clients. 1558 8.1. Protocol Negotiation 1560 QUIC requires that the cryptographic handshake provide authenticated 1561 protocol negotiation. TLS uses Application Layer Protocol 1562 Negotiation (ALPN) [RFC7301] to select an application protocol. 1563 Unless another mechanism is used for agreeing on an application 1564 protocol, endpoints MUST use ALPN for this purpose. When using ALPN, 1565 endpoints MUST immediately close a connection (see Section 10.3 in 1566 [QUIC-TRANSPORT]) if an application protocol is not negotiated with a 1567 no_application_protocol TLS alert (QUIC error code 0x178, see 1568 Section 4.9). While [RFC7301] only specifies that servers use this 1569 alert, QUIC clients MUST also use it to terminate a connection when 1570 ALPN negotiation fails. 1572 An application-layer protocol MAY restrict the QUIC versions that it 1573 can operate over. Servers MUST select an application protocol 1574 compatible with the QUIC version that the client has selected. If 1575 the server cannot select a compatible combination of application 1576 protocol and QUIC version, it MUST abort the connection. A client 1577 MUST abort a connection if the server picks an application protocol 1578 incompatible with the protocol version being used. 1580 8.2. QUIC Transport Parameters Extension 1582 QUIC transport parameters are carried in a TLS extension. Different 1583 versions of QUIC might define a different method for negotiating 1584 transport configuration. 1586 Including transport parameters in the TLS handshake provides 1587 integrity protection for these values. 1589 enum { 1590 quic_transport_parameters(0xffa5), (65535) 1591 } ExtensionType; 1593 The "extension_data" field of the quic_transport_parameters extension 1594 contains a value that is defined by the version of QUIC that is in 1595 use. 1597 The quic_transport_parameters extension is carried in the ClientHello 1598 and the EncryptedExtensions messages during the handshake. Endpoints 1599 MUST send the quic_transport_parameters extension; endpoints that 1600 receive ClientHello or EncryptedExtensions messages without the 1601 quic_transport_parameters extension MUST close the connection with an 1602 error of type 0x16d (equivalent to a fatal TLS missing_extension 1603 alert, see Section 4.9). 1605 While the transport parameters are technically available prior to the 1606 completion of the handshake, they cannot be fully trusted until the 1607 handshake completes, and reliance on them should be minimized. 1608 However, any tampering with the parameters will cause the handshake 1609 to fail. 1611 Endpoints MUST NOT send this extension in a TLS connection that does 1612 not use QUIC (such as the use of TLS with TCP defined in [TLS13]). A 1613 fatal unsupported_extension alert MUST be sent by an implementation 1614 that supports this extension if the extension is received when the 1615 transport is not QUIC. 1617 8.3. Removing the EndOfEarlyData Message 1619 The TLS EndOfEarlyData message is not used with QUIC. QUIC does not 1620 rely on this message to mark the end of 0-RTT data or to signal the 1621 change to Handshake keys. 1623 Clients MUST NOT send the EndOfEarlyData message. A server MUST 1624 treat receipt of a CRYPTO frame in a 0-RTT packet as a connection 1625 error of type PROTOCOL_VIOLATION. 1627 As a result, EndOfEarlyData does not appear in the TLS handshake 1628 transcript. 1630 9. Security Considerations 1632 There are likely to be some real clangers here eventually, but the 1633 current set of issues is well captured in the relevant sections of 1634 the main text. 1636 Never assume that because it isn't in the security considerations 1637 section it doesn't affect security. Most of this document does. 1639 9.1. Replay Attacks with 0-RTT 1641 As described in Section 8 of [TLS13], use of TLS early data comes 1642 with an exposure to replay attack. The use of 0-RTT in QUIC is 1643 similarly vulnerable to replay attack. 1645 Endpoints MUST implement and use the replay protections described in 1646 [TLS13], however it is recognized that these protections are 1647 imperfect. Therefore, additional consideration of the risk of replay 1648 is needed. 1650 QUIC is not vulnerable to replay attack, except via the application 1651 protocol information it might carry. The management of QUIC protocol 1652 state based on the frame types defined in [QUIC-TRANSPORT] is not 1653 vulnerable to replay. Processing of QUIC frames is idempotent and 1654 cannot result in invalid connection states if frames are replayed, 1655 reordered or lost. QUIC connections do not produce effects that last 1656 beyond the lifetime of the connection, except for those produced by 1657 the application protocol that QUIC serves. 1659 Note: TLS session tickets and address validation tokens are used to 1660 carry QUIC configuration information between connections. These 1661 MUST NOT be used to carry application semantics. The potential 1662 for reuse of these tokens means that they require stronger 1663 protections against replay. 1665 A server that accepts 0-RTT on a connection incurs a higher cost than 1666 accepting a connection without 0-RTT. This includes higher 1667 processing and computation costs. Servers need to consider the 1668 probability of replay and all associated costs when accepting 0-RTT. 1670 Ultimately, the responsibility for managing the risks of replay 1671 attacks with 0-RTT lies with an application protocol. An application 1672 protocol that uses QUIC MUST describe how the protocol uses 0-RTT and 1673 the measures that are employed to protect against replay attack. An 1674 analysis of replay risk needs to consider all QUIC protocol features 1675 that carry application semantics. 1677 Disabling 0-RTT entirely is the most effective defense against replay 1678 attack. 1680 QUIC extensions MUST describe how replay attacks affect their 1681 operation, or prohibit their use in 0-RTT. Application protocols 1682 MUST either prohibit the use of extensions that carry application 1683 semantics in 0-RTT or provide replay mitigation strategies. 1685 9.2. Packet Reflection Attack Mitigation 1687 A small ClientHello that results in a large block of handshake 1688 messages from a server can be used in packet reflection attacks to 1689 amplify the traffic generated by an attacker. 1691 QUIC includes three defenses against this attack. First, the packet 1692 containing a ClientHello MUST be padded to a minimum size. Second, 1693 if responding to an unverified source address, the server is 1694 forbidden to send more than three UDP datagrams in its first flight 1695 (see Section 8.1 of [QUIC-TRANSPORT]). Finally, because 1696 acknowledgements of Handshake packets are authenticated, a blind 1697 attacker cannot forge them. Put together, these defenses limit the 1698 level of amplification. 1700 9.3. Header Protection Analysis 1702 [NAN] analyzes authenticated encryption algorithms which provide 1703 nonce privacy, referred to as "Hide Nonce" (HN) transforms. The 1704 general header protection construction in this document is one of 1705 those algorithms (HN1). Header protection uses the output of the 1706 packet protection AEAD to derive "sample", and then encrypts the 1707 header field using a pseudorandom function (PRF) as follows: 1709 protected_field = field XOR PRF(hp_key, sample) 1711 The header protection variants in this document use a pseudorandom 1712 permutation (PRP) in place of a generic PRF. However, since all PRPs 1713 are also PRFs [IMC], these variants do not deviate from the HN1 1714 construction. 1716 As "hp_key" is distinct from the packet protection key, it follows 1717 that header protection achieves AE2 security as defined in [NAN] and 1718 therefore guarantees privacy of "field", the protected packet header. 1719 Future header protection variants based on this construction MUST use 1720 a PRF to ensure equivalent security guarantees. 1722 Use of the same key and ciphertext sample more than once risks 1723 compromising header protection. Protecting two different headers 1724 with the same key and ciphertext sample reveals the exclusive OR of 1725 the protected fields. Assuming that the AEAD acts as a PRF, if L 1726 bits are sampled, the odds of two ciphertext samples being identical 1727 approach 2^(-L/2), that is, the birthday bound. For the algorithms 1728 described in this document, that probability is one in 2^64. 1730 Note: In some cases, inputs shorter than the full size required by 1731 the packet protection algorithm might be used. 1733 To prevent an attacker from modifying packet headers, the header is 1734 transitively authenticated using packet protection; the entire packet 1735 header is part of the authenticated additional data. Protected 1736 fields that are falsified or modified can only be detected once the 1737 packet protection is removed. 1739 9.4. Header Protection Timing Side-Channels 1741 An attacker could guess values for packet numbers or Key Phase and 1742 have an endpoint confirm guesses through timing side channels. 1743 Similarly, guesses for the packet number length can be trialed and 1744 exposed. If the recipient of a packet discards packets with 1745 duplicate packet numbers without attempting to remove packet 1746 protection they could reveal through timing side-channels that the 1747 packet number matches a received packet. For authentication to be 1748 free from side-channels, the entire process of header protection 1749 removal, packet number recovery, and packet protection removal MUST 1750 be applied together without timing and other side-channels. 1752 For the sending of packets, construction and protection of packet 1753 payloads and packet numbers MUST be free from side-channels that 1754 would reveal the packet number or its encoded size. 1756 During a key update, the time taken to generate new keys could reveal 1757 through timing side-channels that a key update has occurred. 1758 Alternatively, where an attacker injects packets this side-channel 1759 could reveal the value of the Key Phase on injected packets. After 1760 receiving a key update, an endpoint SHOULD generate and save the next 1761 set of receive packet protection keys, as described in Section 6.3. 1762 By generating new keys before a key update is received, receipt of 1763 packets will not create timing signals that leak the value of the Key 1764 Phase. 1766 This depends on not doing this key generation during packet 1767 processing and it can require that endpoints maintain three sets of 1768 packet protection keys for receiving: for the previous key phase, for 1769 the current key phase, and for the next key phase. Endpoints can 1770 instead choose to defer generation of the next receive packet 1771 protection keys until they discard old keys so that only two sets of 1772 receive keys need to be retained at any point in time. 1774 9.5. Key Diversity 1776 In using TLS, the central key schedule of TLS is used. As a result 1777 of the TLS handshake messages being integrated into the calculation 1778 of secrets, the inclusion of the QUIC transport parameters extension 1779 ensures that handshake and 1-RTT keys are not the same as those that 1780 might be produced by a server running TLS over TCP. To avoid the 1781 possibility of cross-protocol key synchronization, additional 1782 measures are provided to improve key separation. 1784 The QUIC packet protection keys and IVs are derived using a different 1785 label than the equivalent keys in TLS. 1787 To preserve this separation, a new version of QUIC SHOULD define new 1788 labels for key derivation for packet protection key and IV, plus the 1789 header protection keys. This version of QUIC uses the string "quic". 1790 Other versions can use a version-specific label in place of that 1791 string. 1793 The initial secrets use a key that is specific to the negotiated QUIC 1794 version. New QUIC versions SHOULD define a new salt value used in 1795 calculating initial secrets. 1797 10. IANA Considerations 1799 This document does not create any new IANA registries, but it 1800 registers the values in the following registries: 1802 o TLS ExtensionsType Registry [TLS-REGISTRIES] - IANA is to register 1803 the quic_transport_parameters extension found in Section 8.2. The 1804 Recommended column is to be marked Yes. The TLS 1.3 Column is to 1805 include CH and EE. 1807 o QUIC Error Codes Registry [QUIC-TRANSPORT] - IANA is to register 1808 the KEY_UPDATE_ERROR (0xE), as described in Section 6.7. 1810 11. References 1812 11.1. Normative References 1814 [AEAD] McGrew, D., "An Interface and Algorithms for Authenticated 1815 Encryption", RFC 5116, DOI 10.17487/RFC5116, January 2008, 1816 . 1818 [AES] "Advanced encryption standard (AES)", National Institute 1819 of Standards and Technology report, 1820 DOI 10.6028/nist.fips.197, November 2001. 1822 [CHACHA] Nir, Y. and A. Langley, "ChaCha20 and Poly1305 for IETF 1823 Protocols", RFC 8439, DOI 10.17487/RFC8439, June 2018, 1824 . 1826 [QUIC-RECOVERY] 1827 Iyengar, J., Ed. and I. Swett, Ed., "QUIC Loss Detection 1828 and Congestion Control", draft-ietf-quic-recovery-24 (work 1829 in progress), November 2019. 1831 [QUIC-TRANSPORT] 1832 Iyengar, J., Ed. and M. Thomson, Ed., "QUIC: A UDP-Based 1833 Multiplexed and Secure Transport", draft-ietf-quic- 1834 transport-24 (work in progress), November 2019. 1836 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1837 Requirement Levels", BCP 14, RFC 2119, 1838 DOI 10.17487/RFC2119, March 1997, 1839 . 1841 [RFC7301] Friedl, S., Popov, A., Langley, A., and E. Stephan, 1842 "Transport Layer Security (TLS) Application-Layer Protocol 1843 Negotiation Extension", RFC 7301, DOI 10.17487/RFC7301, 1844 July 2014, . 1846 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 1847 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 1848 May 2017, . 1850 [SHA] Dang, Q., "Secure Hash Standard", National Institute of 1851 Standards and Technology report, 1852 DOI 10.6028/nist.fips.180-4, July 2015. 1854 [TLS-REGISTRIES] 1855 Salowey, J. and S. Turner, "IANA Registry Updates for TLS 1856 and DTLS", RFC 8447, DOI 10.17487/RFC8447, August 2018, 1857 . 1859 [TLS13] Rescorla, E., "The Transport Layer Security (TLS) Protocol 1860 Version 1.3", RFC 8446, DOI 10.17487/RFC8446, August 2018, 1861 . 1863 11.2. Informative References 1865 [AEBounds] 1866 Luykx, A. and K. Paterson, "Limits on Authenticated 1867 Encryption Use in TLS", March 2016, 1868 . 1870 [HTTP2-TLS13] 1871 Benjamin, D., "Using TLS 1.3 with HTTP/2", draft-ietf- 1872 httpbis-http2-tls13-03 (work in progress), October 2019. 1874 [IMC] Katz, J. and Y. Lindell, "Introduction to Modern 1875 Cryptography, Second Edition", ISBN 978-1466570269, 1876 November 2014. 1878 [NAN] Bellare, M., Ng, R., and B. Tackmann, "Nonces Are Noticed: 1879 AEAD Revisited", Advances in Cryptology - CRYPTO 2019 pp. 1880 235-265, DOI 10.1007/978-3-030-26948-7_9, 2019. 1882 [QUIC-HTTP] 1883 Bishop, M., Ed., "Hypertext Transfer Protocol (HTTP) over 1884 QUIC", draft-ietf-quic-http-24 (work in progress), 1885 November 2019. 1887 [RFC2818] Rescorla, E., "HTTP Over TLS", RFC 2818, 1888 DOI 10.17487/RFC2818, May 2000, 1889 . 1891 [RFC5280] Cooper, D., Santesson, S., Farrell, S., Boeyen, S., 1892 Housley, R., and W. Polk, "Internet X.509 Public Key 1893 Infrastructure Certificate and Certificate Revocation List 1894 (CRL) Profile", RFC 5280, DOI 10.17487/RFC5280, May 2008, 1895 . 1897 11.3. URIs 1899 [1] https://mailarchive.ietf.org/arch/search/?email_list=quic 1901 [2] https://github.com/quicwg 1903 [3] https://github.com/quicwg/base-drafts/labels/-tls 1905 Appendix A. Sample Initial Packet Protection 1907 This section shows examples of packet protection for Initial packets 1908 so that implementations can be verified incrementally. These packets 1909 use an 8-byte client-chosen Destination Connection ID of 1910 0x8394c8f03e515708. Values for both server and client packet 1911 protection are shown together with values in hexadecimal. 1913 A.1. Keys 1915 The labels generated by the HKDF-Expand-Label function are: 1917 client in: 00200f746c73313320636c69656e7420696e00 1918 server in: 00200f746c7331332073657276657220696e00 1920 quic key: 00100e746c7331332071756963206b657900 1922 quic iv: 000c0d746c733133207175696320697600 1924 quic hp: 00100d746c733133207175696320687000 1926 The initial secret is common: 1928 initial_secret = HKDF-Extract(initial_salt, cid) 1929 = 524e374c6da8cf8b496f4bcb69678350 1930 7aafee6198b202b4bc823ebf7514a423 1932 The secrets for protecting client packets are: 1934 client_initial_secret 1935 = HKDF-Expand-Label(initial_secret, "client in", _, 32) 1936 = fda3953aecc040e48b34e27ef87de3a6 1937 098ecf0e38b7e032c5c57bcbd5975b84 1939 key = HKDF-Expand-Label(client_initial_secret, "quic key", _, 16) 1940 = af7fd7efebd21878ff66811248983694 1942 iv = HKDF-Expand-Label(client_initial_secret, "quic iv", _, 12) 1943 = 8681359410a70bb9c92f0420 1945 hp = HKDF-Expand-Label(client_initial_secret, "quic hp", _, 16) 1946 = a980b8b4fb7d9fbc13e814c23164253d 1948 The secrets for protecting server packets are: 1950 server_initial_secret 1951 = HKDF-Expand-Label(initial_secret, "server in", _, 32) 1952 = 554366b81912ff90be41f17e80222130 1953 90ab17d8149179bcadf222f29ff2ddd5 1955 key = HKDF-Expand-Label(server_initial_secret, "quic key", _, 16) 1956 = 5d51da9ee897a21b2659ccc7e5bfa577 1958 iv = HKDF-Expand-Label(server_initial_secret, "quic iv", _, 12) 1959 = 5e5ae651fd1e8495af13508b 1961 hp = HKDF-Expand-Label(server_initial_secret, "quic hp", _, 16) 1962 = a8ed82e6664f865aedf6106943f95fb8 1964 A.2. Client Initial 1966 The client sends an Initial packet. The unprotected payload of this 1967 packet contains the following CRYPTO frame, plus enough PADDING 1968 frames to make a 1162 byte payload: 1970 060040c4010000c003036660261ff947 cea49cce6cfad687f457cf1b14531ba1 1971 4131a0e8f309a1d0b9c4000006130113 031302010000910000000b0009000006 1972 736572766572ff01000100000a001400 12001d00170018001901000101010201 1973 03010400230000003300260024001d00 204cfdfcd178b784bf328cae793b136f 1974 2aedce005ff183d7bb14952072366470 37002b0003020304000d0020001e0403 1975 05030603020308040805080604010501 060102010402050206020202002d0002 1976 0101001c00024001 1978 The unprotected header includes the connection ID and a 4 byte packet 1979 number encoding for a packet number of 2: 1981 c3ff000017088394c8f03e5157080000449e00000002 1983 Protecting the payload produces output that is sampled for header 1984 protection. Because the header uses a 4 byte packet number encoding, 1985 the first 16 bytes of the protected payload is sampled, then applied 1986 to the header: 1988 sample = 535064a4268a0d9d7b1c9d250ae35516 1990 mask = AES-ECB(hp, sample)[0..4] 1991 = 833b343aaa 1993 header[0] ^= mask[0] & 0x0f 1994 = c0 1995 header[17..20] ^= mask[1..4] 1996 = 3b343aa8 1997 header = c0ff000017088394c8f03e5157080000449e3b343aa8 1999 The resulting protected packet is: 2001 c0ff000017088394c8f03e5157080000 449e3b343aa8535064a4268a0d9d7b1c 2002 9d250ae355162276e9b1e3011ef6bbc0 ab48ad5bcc2681e953857ca62becd752 2003 4daac473e68d7405fbba4e9ee616c870 38bdbe908c06d9605d9ac49030359eec 2004 b1d05a14e117db8cede2bb09d0dbbfee 271cb374d8f10abec82d0f59a1dee29f 2005 e95638ed8dd41da07487468791b719c5 5c46968eb3b54680037102a28e53dc1d 2006 12903db0af5821794b41c4a93357fa59 ce69cfe7f6bdfa629eef78616447e1d6 2007 11c4baf71bf33febcb03137c2c75d253 17d3e13b684370f668411c0f00304b50 2008 1c8fd422bd9b9ad81d643b20da89ca05 25d24d2b142041cae0af205092e43008 2009 0cd8559ea4c5c6e4fa3f66082b7d303e 52ce0162baa958532b0bbc2bc785681f 2010 cf37485dff6595e01e739c8ac9efba31 b985d5f656cc092432d781db95221724 2011 87641c4d3ab8ece01e39bc85b1543661 4775a98ba8fa12d46f9b35e2a55eb72d 2012 7f85181a366663387ddc20551807e007 673bd7e26bf9b29b5ab10a1ca87cbb7a 2013 d97e99eb66959c2a9bc3cbde4707ff77 20b110fa95354674e395812e47a0ae53 2014 b464dcb2d1f345df360dc227270c7506 76f6724eb479f0d2fbb6124429990457 2015 ac6c9167f40aab739998f38b9eccb24f d47c8410131bf65a52af841275d5b3d1 2016 880b197df2b5dea3e6de56ebce3ffb6e 9277a82082f8d9677a6767089b671ebd 2017 244c214f0bde95c2beb02cd1172d58bd f39dce56ff68eb35ab39b49b4eac7c81 2018 5ea60451d6e6ab82119118df02a58684 4a9ffe162ba006d0669ef57668cab38b 2019 62f71a2523a084852cd1d079b3658dc2 f3e87949b550bab3e177cfc49ed190df 2020 f0630e43077c30de8f6ae081537f1e83 da537da980afa668e7b7fb25301cf741 2021 524be3c49884b42821f17552fbd1931a 813017b6b6590a41ea18b6ba49cd48a4 2022 40bd9a3346a7623fb4ba34a3ee571e3c 731f35a7a3cf25b551a680fa68763507 2023 b7fde3aaf023c50b9d22da6876ba337e b5e9dd9ec3daf970242b6c5aab3aa4b2 2024 96ad8b9f6832f686ef70fa938b31b4e5 ddd7364442d3ea72e73d668fb0937796 2025 f462923a81a47e1cee7426ff6d922126 9b5a62ec03d6ec94d12606cb485560ba 2026 b574816009e96504249385bb61a819be 04f62c2066214d8360a2022beb316240 2027 b6c7d78bbe56c13082e0ca272661210a bf020bf3b5783f1426436cf9ff418405 2028 93a5d0638d32fc51c5c65ff291a3a7a5 2fd6775e623a4439cc08dd25582febc9 2029 44ef92d8dbd329c91de3e9c9582e41f1 7f3d186f104ad3f90995116c682a2a14 2030 a3b4b1f547c335f0be710fc9fc03e0e5 87b8cda31ce65b969878a4ad4283e6d5 2031 b0373f43da86e9e0ffe1ae0fddd35162 55bd74566f36a38703d5f34249ded1f6 2032 6b3d9b45b9af2ccfefe984e13376b1b2 c6404aa48c8026132343da3f3a33659e 2033 c1b3e95080540b28b7f3fcd35fa5d843 b579a84c089121a60d8c1754915c344e 2034 eaf45a9bf27dc0c1e784161691220913 13eb0e87555abd706626e557fc36a04f 2035 cd191a58829104d6075c5594f627ca50 6bf181daec940f4a4f3af0074eee89da 2036 acde6758312622d4fa675b39f728e062 d2bee680d8f41a597c262648bb18bcfc 2037 13c8b3d97b1a77b2ac3af745d61a34cc 4709865bac824a94bb19058015e4e42d 2038 c9be6c7803567321829dd85853396269 2040 A.3. Server Initial 2042 The server sends the following payload in response, including an ACK 2043 frame, a CRYPTO frame, and no PADDING frames: 2045 0d0000000018410a020000560303eefc e7f7b37ba1d1632e96677825ddf73988 2046 cfc79825df566dc5430b9a045a120013 0100002e00330024001d00209d3c940d 2047 89690b84d08a60993c144eca684d1081 287c834d5311bcf32bb9da1a002b0002 2048 0304 2049 The header from the server includes a new connection ID and a 2-byte 2050 packet number encoding for a packet number of 1: 2052 c1ff0000170008f067a5502a4262b50040740001 2054 As a result, after protection, the header protection sample is taken 2055 starting from the third protected octet: 2057 sample = 7002596f99ae67abf65a5852f54f58c3 2058 mask = 38168a0c25 2059 header = c9ff0000170008f067a5502a4262b5004074168b 2061 The final protected packet is then: 2063 c9ff0000170008f067a5502a4262b500 4074168bf22b7002596f99ae67abf65a 2064 5852f54f58c37c808682e2e40492d8a3 899fb04fc0afe9aabc8767b18a0aa493 2065 537426373b48d502214dd856d63b78ce e37bc664b3fe86d487ac7a77c53038a3 2066 cd32f0b5004d9f5754c4f7f2d1f35cf3 f7116351c92b9cf9bb6d091ddfc8b32d 2067 432348a2c413 2069 Appendix B. Change Log 2071 *RFC Editor's Note:* Please remove this section prior to 2072 publication of a final version of this document. 2074 Issue and pull request numbers are listed with a leading octothorp. 2076 B.1. Since draft-ietf-quic-tls-23 2078 o Key update text update (#3050): 2080 * Recommend constant-time key replacement (#2792) 2082 * Provide explicit labels for key update key derivation (#3054) 2084 o Allow first Initial from a client to span multiple packets (#2928, 2085 #3045) 2087 o PING can be sent at any encryption level (#3034, #3035) 2089 B.2. Since draft-ietf-quic-tls-22 2091 o Update the salt used for Initial secrets (#2887, #2980) 2093 B.3. Since draft-ietf-quic-tls-21 2095 o No changes 2097 B.4. Since draft-ietf-quic-tls-20 2099 o Mandate the use of the QUIC transport parameters extension (#2528, 2100 #2560) 2102 o Define handshake completion and confirmation; define clearer rules 2103 when it encryption keys should be discarded (#2214, #2267, #2673) 2105 B.5. Since draft-ietf-quic-tls-18 2107 o Increased the set of permissible frames in 0-RTT (#2344, #2355) 2109 o Transport parameter extension is mandatory (#2528, #2560) 2111 B.6. Since draft-ietf-quic-tls-17 2113 o Endpoints discard initial keys as soon as handshake keys are 2114 available (#1951, #2045) 2116 o Use of ALPN or equivalent is mandatory (#2263, #2284) 2118 B.7. Since draft-ietf-quic-tls-14 2120 o Update the salt used for Initial secrets (#1970) 2122 o Clarify that TLS_AES_128_CCM_8_SHA256 isn't supported (#2019) 2124 o Change header protection 2126 * Sample from a fixed offset (#1575, #2030) 2128 * Cover part of the first byte, including the key phase (#1322, 2129 #2006) 2131 o TLS provides an AEAD and KDF function (#2046) 2133 * Clarify that the TLS KDF is used with TLS (#1997) 2135 * Change the labels for calculation of QUIC keys (#1845, #1971, 2136 #1991) 2138 o Initial keys are discarded once Handshake keys are available 2139 (#1951, #2045) 2141 B.8. Since draft-ietf-quic-tls-13 2143 o Updated to TLS 1.3 final (#1660) 2145 B.9. Since draft-ietf-quic-tls-12 2147 o Changes to integration of the TLS handshake (#829, #1018, #1094, 2148 #1165, #1190, #1233, #1242, #1252, #1450) 2150 * The cryptographic handshake uses CRYPTO frames, not stream 0 2152 * QUIC packet protection is used in place of TLS record 2153 protection 2155 * Separate QUIC packet number spaces are used for the handshake 2157 * Changed Retry to be independent of the cryptographic handshake 2159 * Limit the use of HelloRetryRequest to address TLS needs (like 2160 key shares) 2162 o Changed codepoint of TLS extension (#1395, #1402) 2164 B.10. Since draft-ietf-quic-tls-11 2166 o Encrypted packet numbers. 2168 B.11. Since draft-ietf-quic-tls-10 2170 o No significant changes. 2172 B.12. Since draft-ietf-quic-tls-09 2174 o Cleaned up key schedule and updated the salt used for handshake 2175 packet protection (#1077) 2177 B.13. Since draft-ietf-quic-tls-08 2179 o Specify value for max_early_data_size to enable 0-RTT (#942) 2181 o Update key derivation function (#1003, #1004) 2183 B.14. Since draft-ietf-quic-tls-07 2185 o Handshake errors can be reported with CONNECTION_CLOSE (#608, 2186 #891) 2188 B.15. Since draft-ietf-quic-tls-05 2190 No significant changes. 2192 B.16. Since draft-ietf-quic-tls-04 2194 o Update labels used in HKDF-Expand-Label to match TLS 1.3 (#642) 2196 B.17. Since draft-ietf-quic-tls-03 2198 No significant changes. 2200 B.18. Since draft-ietf-quic-tls-02 2202 o Updates to match changes in transport draft 2204 B.19. Since draft-ietf-quic-tls-01 2206 o Use TLS alerts to signal TLS errors (#272, #374) 2208 o Require ClientHello to fit in a single packet (#338) 2210 o The second client handshake flight is now sent in the clear (#262, 2211 #337) 2213 o The QUIC header is included as AEAD Associated Data (#226, #243, 2214 #302) 2216 o Add interface necessary for client address validation (#275) 2218 o Define peer authentication (#140) 2220 o Require at least TLS 1.3 (#138) 2222 o Define transport parameters as a TLS extension (#122) 2224 o Define handling for protected packets before the handshake 2225 completes (#39) 2227 o Decouple QUIC version and ALPN (#12) 2229 B.20. Since draft-ietf-quic-tls-00 2231 o Changed bit used to signal key phase 2233 o Updated key phase markings during the handshake 2235 o Added TLS interface requirements section 2236 o Moved to use of TLS exporters for key derivation 2238 o Moved TLS error code definitions into this document 2240 B.21. Since draft-thomson-quic-tls-01 2242 o Adopted as base for draft-ietf-quic-tls 2244 o Updated authors/editors list 2246 o Added status note 2248 Acknowledgments 2250 This document has benefited from input from Dragana Damjanovic, 2251 Christian Huitema, Jana Iyengar, Adam Langley, Roberto Peon, Eric 2252 Rescorla, Ian Swett, and many others. 2254 Contributors 2256 Ryan Hamilton was originally an author of this specification. 2258 Authors' Addresses 2260 Martin Thomson (editor) 2261 Mozilla 2263 Email: mt@lowentropy.net 2265 Sean Turner (editor) 2266 sn3rd 2268 Email: sean@sn3rd.com