idnits 2.17.1 draft-ietf-quic-tls-30.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: ---------------------------------------------------------------------------- == There are 3 instances of lines with non-ascii characters in the document. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (September 10, 2020) is 1317 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: '0' on line 2351 -- Looks like a reference, but probably isn't: '1' on line 1565 -- Possible downref: Non-RFC (?) normative reference: ref. 'AES' ** Downref: Normative reference to an Informational RFC: RFC 8439 (ref. 'CHACHA') ** Downref: Normative reference to an Informational RFC: RFC 5869 (ref. 'HKDF') == Outdated reference: A later version (-34) exists of draft-ietf-quic-recovery-30 == Outdated reference: A later version (-34) exists of draft-ietf-quic-transport-30 -- Possible downref: Non-RFC (?) normative reference: ref. 'SHA' -- Obsolete informational reference (is this intentional?): RFC 8740 (ref. 'HTTP2-TLS13') (Obsoleted by RFC 9113) == Outdated reference: A later version (-34) exists of draft-ietf-quic-http-30 -- Obsolete informational reference (is this intentional?): RFC 2818 (Obsoleted by RFC 9110) Summary: 2 errors (**), 0 flaws (~~), 5 warnings (==), 8 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: March 14, 2021 sn3rd 6 September 10, 2020 8 Using TLS to Secure QUIC 9 draft-ietf-quic-tls-30 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. 22 Working Group information can be found at https://github.com/quicwg; 23 source code and issues list for this draft can be found at 24 https://github.com/quicwg/base-drafts/labels/-tls. 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 March 14, 2021. 43 Copyright Notice 45 Copyright (c) 2020 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 (https://trustee.ietf.org/ 50 license-info) in effect on the date of publication of this document. 51 Please review these documents carefully, as they describe your rights 52 and restrictions with respect to this document. Code Components 53 extracted from this document must include Simplified BSD License text 54 as described in Section 4.e of the Trust Legal Provisions and are 55 provided without warranty as described in the Simplified BSD License. 57 Table of Contents 59 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 4 60 2. Notational Conventions . . . . . . . . . . . . . . . . . . . 4 61 2.1. TLS Overview . . . . . . . . . . . . . . . . . . . . . . 5 62 3. Protocol Overview . . . . . . . . . . . . . . . . . . . . . . 7 63 4. Carrying TLS Messages . . . . . . . . . . . . . . . . . . . . 8 64 4.1. Interface to TLS . . . . . . . . . . . . . . . . . . . . 10 65 4.1.1. Handshake Complete . . . . . . . . . . . . . . . . . 10 66 4.1.2. Handshake Confirmed . . . . . . . . . . . . . . . . . 11 67 4.1.3. Sending and Receiving Handshake Messages . . . . . . 11 68 4.1.4. Encryption Level Changes . . . . . . . . . . . . . . 13 69 4.1.5. TLS Interface Summary . . . . . . . . . . . . . . . . 14 70 4.2. TLS Version . . . . . . . . . . . . . . . . . . . . . . . 15 71 4.3. ClientHello Size . . . . . . . . . . . . . . . . . . . . 16 72 4.4. Peer Authentication . . . . . . . . . . . . . . . . . . . 17 73 4.5. Session Resumption . . . . . . . . . . . . . . . . . . . 17 74 4.6. 0-RTT . . . . . . . . . . . . . . . . . . . . . . . . . . 18 75 4.6.1. Enabling 0-RTT . . . . . . . . . . . . . . . . . . . 19 76 4.6.2. Accepting and Rejecting 0-RTT . . . . . . . . . . . . 19 77 4.6.3. Validating 0-RTT Configuration . . . . . . . . . . . 20 78 4.7. HelloRetryRequest . . . . . . . . . . . . . . . . . . . . 20 79 4.8. TLS Errors . . . . . . . . . . . . . . . . . . . . . . . 20 80 4.9. Discarding Unused Keys . . . . . . . . . . . . . . . . . 21 81 4.9.1. Discarding Initial Keys . . . . . . . . . . . . . . . 21 82 4.9.2. Discarding Handshake Keys . . . . . . . . . . . . . . 22 83 4.9.3. Discarding 0-RTT Keys . . . . . . . . . . . . . . . . 22 84 5. Packet Protection . . . . . . . . . . . . . . . . . . . . . . 22 85 5.1. Packet Protection Keys . . . . . . . . . . . . . . . . . 23 86 5.2. Initial Secrets . . . . . . . . . . . . . . . . . . . . . 24 87 5.3. AEAD Usage . . . . . . . . . . . . . . . . . . . . . . . 25 88 5.4. Header Protection . . . . . . . . . . . . . . . . . . . . 26 89 5.4.1. Header Protection Application . . . . . . . . . . . . 26 90 5.4.2. Header Protection Sample . . . . . . . . . . . . . . 28 91 5.4.3. AES-Based Header Protection . . . . . . . . . . . . . 30 92 5.4.4. ChaCha20-Based Header Protection . . . . . . . . . . 30 93 5.5. Receiving Protected Packets . . . . . . . . . . . . . . . 30 94 5.6. Use of 0-RTT Keys . . . . . . . . . . . . . . . . . . . . 31 95 5.7. Receiving Out-of-Order Protected Frames . . . . . . . . . 31 96 5.8. Retry Packet Integrity . . . . . . . . . . . . . . . . . 33 97 6. Key Update . . . . . . . . . . . . . . . . . . . . . . . . . 34 98 6.1. Initiating a Key Update . . . . . . . . . . . . . . . . . 35 99 6.2. Responding to a Key Update . . . . . . . . . . . . . . . 36 100 6.3. Timing of Receive Key Generation . . . . . . . . . . . . 37 101 6.4. Sending with Updated Keys . . . . . . . . . . . . . . . . 38 102 6.5. Receiving with Different Keys . . . . . . . . . . . . . . 38 103 6.6. Limits on AEAD Usage . . . . . . . . . . . . . . . . . . 39 104 6.7. Key Update Error Code . . . . . . . . . . . . . . . . . . 41 105 7. Security of Initial Messages . . . . . . . . . . . . . . . . 41 106 8. QUIC-Specific Adjustments to the TLS Handshake . . . . . . . 41 107 8.1. Protocol Negotiation . . . . . . . . . . . . . . . . . . 42 108 8.2. QUIC Transport Parameters Extension . . . . . . . . . . . 42 109 8.3. Removing the EndOfEarlyData Message . . . . . . . . . . . 43 110 8.4. Prohibit TLS Middlebox Compatibility Mode . . . . . . . . 43 111 9. Security Considerations . . . . . . . . . . . . . . . . . . . 43 112 9.1. Session Linkability . . . . . . . . . . . . . . . . . . . 44 113 9.2. Replay Attacks with 0-RTT . . . . . . . . . . . . . . . . 44 114 9.3. Packet Reflection Attack Mitigation . . . . . . . . . . . 45 115 9.4. Header Protection Analysis . . . . . . . . . . . . . . . 45 116 9.5. Header Protection Timing Side-Channels . . . . . . . . . 46 117 9.6. Key Diversity . . . . . . . . . . . . . . . . . . . . . . 47 118 10. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 47 119 11. References . . . . . . . . . . . . . . . . . . . . . . . . . 47 120 11.1. Normative References . . . . . . . . . . . . . . . . . . 47 121 11.2. Informative References . . . . . . . . . . . . . . . . . 49 122 Appendix A. Sample Packet Protection . . . . . . . . . . . . . . 50 123 A.1. Keys . . . . . . . . . . . . . . . . . . . . . . . . . . 50 124 A.2. Client Initial . . . . . . . . . . . . . . . . . . . . . 51 125 A.3. Server Initial . . . . . . . . . . . . . . . . . . . . . 53 126 A.4. Retry . . . . . . . . . . . . . . . . . . . . . . . . . . 54 127 A.5. ChaCha20-Poly1305 Short Header Packet . . . . . . . . . . 54 128 Appendix B. AEAD Algorithm Analysis . . . . . . . . . . . . . . 56 129 B.1. Analysis of AEAD_AES_128_GCM and AEAD_AES_256_GCM Usage 130 Limits . . . . . . . . . . . . . . . . . . . . . . . . . 56 131 B.1.1. Confidentiality Limit . . . . . . . . . . . . . . . . 57 132 B.1.2. Integrity Limit . . . . . . . . . . . . . . . . . . . 57 133 B.2. Analysis of AEAD_AES_128_CCM Usage Limits . . . . . . . . 58 134 B.2.1. Confidentiality Limits . . . . . . . . . . . . . . . 58 135 B.2.2. Integrity Limits . . . . . . . . . . . . . . . . . . 58 136 Appendix C. Change Log . . . . . . . . . . . . . . . . . . . . . 59 137 C.1. Since draft-ietf-quic-tls-29 . . . . . . . . . . . . . . 59 138 C.2. Since draft-ietf-quic-tls-28 . . . . . . . . . . . . . . 59 139 C.3. Since draft-ietf-quic-tls-27 . . . . . . . . . . . . . . 59 140 C.4. Since draft-ietf-quic-tls-26 . . . . . . . . . . . . . . 59 141 C.5. Since draft-ietf-quic-tls-25 . . . . . . . . . . . . . . 59 142 C.6. Since draft-ietf-quic-tls-24 . . . . . . . . . . . . . . 59 143 C.7. Since draft-ietf-quic-tls-23 . . . . . . . . . . . . . . 60 144 C.8. Since draft-ietf-quic-tls-22 . . . . . . . . . . . . . . 60 145 C.9. Since draft-ietf-quic-tls-21 . . . . . . . . . . . . . . 60 146 C.10. Since draft-ietf-quic-tls-20 . . . . . . . . . . . . . . 60 147 C.11. Since draft-ietf-quic-tls-18 . . . . . . . . . . . . . . 60 148 C.12. Since draft-ietf-quic-tls-17 . . . . . . . . . . . . . . 60 149 C.13. Since draft-ietf-quic-tls-14 . . . . . . . . . . . . . . 61 150 C.14. Since draft-ietf-quic-tls-13 . . . . . . . . . . . . . . 61 151 C.15. Since draft-ietf-quic-tls-12 . . . . . . . . . . . . . . 61 152 C.16. Since draft-ietf-quic-tls-11 . . . . . . . . . . . . . . 61 153 C.17. Since draft-ietf-quic-tls-10 . . . . . . . . . . . . . . 62 154 C.18. Since draft-ietf-quic-tls-09 . . . . . . . . . . . . . . 62 155 C.19. Since draft-ietf-quic-tls-08 . . . . . . . . . . . . . . 62 156 C.20. Since draft-ietf-quic-tls-07 . . . . . . . . . . . . . . 62 157 C.21. Since draft-ietf-quic-tls-05 . . . . . . . . . . . . . . 62 158 C.22. Since draft-ietf-quic-tls-04 . . . . . . . . . . . . . . 62 159 C.23. Since draft-ietf-quic-tls-03 . . . . . . . . . . . . . . 62 160 C.24. Since draft-ietf-quic-tls-02 . . . . . . . . . . . . . . 62 161 C.25. Since draft-ietf-quic-tls-01 . . . . . . . . . . . . . . 62 162 C.26. Since draft-ietf-quic-tls-00 . . . . . . . . . . . . . . 63 163 C.27. Since draft-thomson-quic-tls-01 . . . . . . . . . . . . . 63 164 Contributors . . . . . . . . . . . . . . . . . . . . . . . . . . 63 165 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 64 167 1. Introduction 169 This document describes how QUIC [QUIC-TRANSPORT] is secured using 170 TLS [TLS13]. 172 TLS 1.3 provides critical latency improvements for connection 173 establishment over previous versions. Absent packet loss, most new 174 connections can be established and secured within a single round 175 trip; on subsequent connections between the same client and server, 176 the client can often send application data immediately, that is, 177 using a zero round trip setup. 179 This document describes how TLS acts as a security component of QUIC. 181 2. Notational Conventions 183 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 184 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 185 "OPTIONAL" in this document are to be interpreted as described in 186 BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all 187 capitals, as shown here. 189 This document uses the terminology established in [QUIC-TRANSPORT]. 191 For brevity, the acronym TLS is used to refer to TLS 1.3, though a 192 newer version could be used; see Section 4.2. 194 2.1. TLS Overview 196 TLS provides two endpoints with a way to establish a means of 197 communication over an untrusted medium (that is, the Internet) that 198 ensures that messages they exchange cannot be observed, modified, or 199 forged. 201 Internally, TLS is a layered protocol, with the structure shown in 202 Figure 1. 204 +-------------+------------+--------------+---------+ 205 Handshake | | | Application | | 206 Layer | Handshake | Alerts | Data | ... | 207 | | | | | 208 +-------------+------------+--------------+---------+ 209 Record | | 210 Layer | Records | 211 | | 212 +---------------------------------------------------+ 214 Figure 1: TLS Layers 216 Each Handshake layer message (e.g., Handshake, Alerts, and 217 Application Data) is carried as a series of typed TLS records by the 218 Record layer. Records are individually cryptographically protected 219 and then transmitted over a reliable transport (typically TCP), which 220 provides sequencing and guaranteed delivery. 222 The TLS authenticated key exchange occurs between two endpoints: 223 client and server. The client initiates the exchange and the server 224 responds. If the key exchange completes successfully, both client 225 and server will agree on a secret. TLS supports both pre-shared key 226 (PSK) and Diffie-Hellman over either finite fields or elliptic curves 227 ((EC)DHE) key exchanges. PSK is the basis for Early Data (0-RTT); 228 the latter provides perfect forward secrecy (PFS) when the (EC)DHE 229 keys are destroyed. 231 After completing the TLS handshake, the client will have learned and 232 authenticated an identity for the server and the server is optionally 233 able to learn and authenticate an identity for the client. TLS 234 supports X.509 [RFC5280] certificate-based authentication for both 235 server and client. 237 The TLS key exchange is resistant to tampering by attackers and it 238 produces shared secrets that cannot be controlled by either 239 participating peer. 241 TLS provides two basic handshake modes of interest to QUIC: 243 * A full 1-RTT handshake, in which the client is able to send 244 Application Data after one round trip and the server immediately 245 responds after receiving the first handshake message from the 246 client. 248 * A 0-RTT handshake, in which the client uses information it has 249 previously learned about the server to send Application Data 250 immediately. This Application Data can be replayed by an attacker 251 so it MUST NOT carry a self-contained trigger for any non- 252 idempotent action. 254 A simplified TLS handshake with 0-RTT application data is shown in 255 Figure 2. 257 Client Server 259 ClientHello 260 (0-RTT Application Data) --------> 261 ServerHello 262 {EncryptedExtensions} 263 {Finished} 264 <-------- [Application Data] 265 {Finished} --------> 267 [Application Data] <-------> [Application Data] 269 () Indicates messages protected by Early Data (0-RTT) Keys 270 {} Indicates messages protected using Handshake Keys 271 [] Indicates messages protected using Application Data 272 (1-RTT) Keys 274 Figure 2: TLS Handshake with 0-RTT 276 Figure 2 omits the EndOfEarlyData message, which is not used in QUIC; 277 see Section 8.3. Likewise, neither ChangeCipherSpec nor KeyUpdate 278 messages are used by QUIC. ChangeCipherSpec is redundant in TLS 1.3; 279 see Section 8.4. QUIC has its own key update mechanism; see 280 Section 6. 282 Data is protected using a number of encryption levels: 284 * Initial Keys 285 * Early Data (0-RTT) Keys 287 * Handshake Keys 289 * Application Data (1-RTT) Keys 291 Application Data may appear only in the Early Data and Application 292 Data levels. Handshake and Alert messages may appear in any level. 294 The 0-RTT handshake is only possible if the client and server have 295 previously communicated. In the 1-RTT handshake, the client is 296 unable to send protected Application Data until it has received all 297 of the Handshake messages sent by the server. 299 3. Protocol Overview 301 QUIC [QUIC-TRANSPORT] assumes responsibility for the confidentiality 302 and integrity protection of packets. For this it uses keys derived 303 from a TLS handshake [TLS13], but instead of carrying TLS records 304 over QUIC (as with TCP), TLS Handshake and Alert messages are carried 305 directly over the QUIC transport, which takes over the 306 responsibilities of the TLS record layer, as shown in Figure 3. 308 +--------------+--------------+ +-------------+ 309 | TLS | TLS | | QUIC | 310 | Handshake | Alerts | | Applications| 311 | | | | (h3, etc.) | 312 +--------------+--------------+-+-------------+ 313 | | 314 | QUIC Transport | 315 | (streams, reliability, congestion, etc.) | 316 | | 317 +---------------------------------------------+ 318 | | 319 | QUIC Packet Protection | 320 | | 321 +---------------------------------------------+ 323 Figure 3: QUIC Layers 325 QUIC also relies on TLS for authentication and negotiation of 326 parameters that are critical to security and performance. 328 Rather than a strict layering, these two protocols cooperate: QUIC 329 uses the TLS handshake; TLS uses the reliability, ordered delivery, 330 and record layer provided by QUIC. 332 At a high level, there are two main interactions between the TLS and 333 QUIC components: 335 * The TLS component sends and receives messages via the QUIC 336 component, with QUIC providing a reliable stream abstraction to 337 TLS. 339 * The TLS component provides a series of updates to the QUIC 340 component, including (a) new packet protection keys to install (b) 341 state changes such as handshake completion, the server 342 certificate, etc. 344 Figure 4 shows these interactions in more detail, with the QUIC 345 packet protection being called out specially. 347 +------------+ +------------+ 348 | |<---- Handshake Messages ----->| | 349 | |<- Validate 0-RTT parameters ->| | 350 | |<--------- 0-RTT Keys ---------| | 351 | QUIC |<------- Handshake Keys -------| TLS | 352 | |<--------- 1-RTT Keys ---------| | 353 | |<------- Handshake Done -------| | 354 +------------+ +------------+ 355 | ^ 356 | Protect | Protected 357 v | Packet 358 +------------+ 359 | QUIC | 360 | Packet | 361 | Protection | 362 +------------+ 364 Figure 4: QUIC and TLS Interactions 366 Unlike TLS over TCP, QUIC applications that want to send data do not 367 send it through TLS "application_data" records. Rather, they send it 368 as QUIC STREAM frames or other frame types, which are then carried in 369 QUIC packets. 371 4. Carrying TLS Messages 373 QUIC carries TLS handshake data in CRYPTO frames, each of which 374 consists of a contiguous block of handshake data identified by an 375 offset and length. Those frames are packaged into QUIC packets and 376 encrypted under the current TLS encryption level. As with TLS over 377 TCP, once TLS handshake data has been delivered to QUIC, it is QUIC's 378 responsibility to deliver it reliably. Each chunk of data that is 379 produced by TLS is associated with the set of keys that TLS is 380 currently using. If QUIC needs to retransmit that data, it MUST use 381 the same keys even if TLS has already updated to newer keys. 383 One important difference between TLS records (used with TCP) and QUIC 384 CRYPTO frames is that in QUIC multiple frames may appear in the same 385 QUIC packet as long as they are associated with the same packet 386 number space. For instance, an endpoint can bundle a Handshake 387 message and an ACK for some Handshake data into the same packet. 389 Some frames are prohibited in different packet number spaces. The 390 rules here generalize those of TLS, in that frames associated with 391 establishing the connection can usually appear in packets in any 392 packet number space, whereas those associated with transferring data 393 can only appear in the application data packet number space: 395 * PADDING, PING, and CRYPTO frames MAY appear in any packet number 396 space. 398 * CONNECTION_CLOSE frames signaling errors at the QUIC layer (type 399 0x1c) MAY appear in any packet number space. CONNECTION_CLOSE 400 frames signaling application errors (type 0x1d) MUST only appear 401 in the application data packet number space. 403 * ACK frames MAY appear in any packet number space, but can only 404 acknowledge packets that appeared in that packet number space. 405 However, as noted below, 0-RTT packets cannot contain ACK frames. 407 * All other frame types MUST only be sent in the application data 408 packet number space. 410 Note that it is not possible to send the following frames in 0-RTT 411 packets for various reasons: ACK, CRYPTO, HANDSHAKE_DONE, NEW_TOKEN, 412 PATH_RESPONSE, and RETIRE_CONNECTION_ID. A server MAY treat receipt 413 of these frames in 0-RTT packets as a connection error of type 414 PROTOCOL_VIOLATION. 416 Because packets could be reordered on the wire, QUIC uses the packet 417 type to indicate which keys were used to protect a given packet, as 418 shown in Table 1. When packets of different types need to be sent, 419 endpoints SHOULD use coalesced packets to send them in the same UDP 420 datagram. 422 +=====================+=================+==================+ 423 | Packet Type | Encryption Keys | PN Space | 424 +=====================+=================+==================+ 425 | Initial | Initial secrets | Initial | 426 +---------------------+-----------------+------------------+ 427 | 0-RTT Protected | 0-RTT | Application data | 428 +---------------------+-----------------+------------------+ 429 | Handshake | Handshake | Handshake | 430 +---------------------+-----------------+------------------+ 431 | Retry | Retry | N/A | 432 +---------------------+-----------------+------------------+ 433 | Version Negotiation | N/A | N/A | 434 +---------------------+-----------------+------------------+ 435 | Short Header | 1-RTT | Application data | 436 +---------------------+-----------------+------------------+ 438 Table 1: Encryption Keys by Packet Type 440 Section 17 of [QUIC-TRANSPORT] shows how packets at the various 441 encryption levels fit into the handshake process. 443 4.1. Interface to TLS 445 As shown in Figure 4, the interface from QUIC to TLS consists of four 446 primary functions: 448 * Sending and receiving handshake messages 450 * Processing stored transport and application state from a resumed 451 session and determining if it is valid to accept early data 453 * Rekeying (both transmit and receive) 455 * Handshake state updates 457 Additional functions might be needed to configure TLS. 459 4.1.1. Handshake Complete 461 In this document, the TLS handshake is considered complete when the 462 TLS stack has reported that the handshake is complete. This happens 463 when the TLS stack has both sent a Finished message and verified the 464 peer's Finished message. Verifying the peer's Finished provides the 465 endpoints with an assurance that previous handshake messages have not 466 been modified. Note that the handshake does not complete at both 467 endpoints simultaneously. Consequently, any requirement that is 468 based on the completion of the handshake depends on the perspective 469 of the endpoint in question. 471 4.1.2. Handshake Confirmed 473 In this document, the TLS handshake is considered confirmed at the 474 server when the handshake completes. At the client, the handshake is 475 considered confirmed when a HANDSHAKE_DONE frame is received. 477 A client MAY consider the handshake to be confirmed when it receives 478 an acknowledgement for a 1-RTT packet. This can be implemented by 479 recording the lowest packet number sent with 1-RTT keys, and 480 comparing it to the Largest Acknowledged field in any received 1-RTT 481 ACK frame: once the latter is greater than or equal to the former, 482 the handshake is confirmed. 484 4.1.3. Sending and Receiving Handshake Messages 486 In order to drive the handshake, TLS depends on being able to send 487 and receive handshake messages. There are two basic functions on 488 this interface: one where QUIC requests handshake messages and one 489 where QUIC provides bytes that comprise handshake messages. 491 Before starting the handshake QUIC provides TLS with the transport 492 parameters (see Section 8.2) that it wishes to carry. 494 A QUIC client starts TLS by requesting TLS handshake bytes from TLS. 495 The client acquires handshake bytes before sending its first packet. 496 A QUIC server starts the process by providing TLS with the client's 497 handshake bytes. 499 At any time, the TLS stack at an endpoint will have a current sending 500 encryption level and receiving encryption level. Encryption levels 501 determine the packet type and keys that are used for protecting data. 503 Each encryption level is associated with a different sequence of 504 bytes, which is reliably transmitted to the peer in CRYPTO frames. 505 When TLS provides handshake bytes to be sent, they are appended to 506 the handshake bytes for the current encryption level. The encryption 507 level then determines the type of packet that the resulting CRYPTO 508 frame is carried in; see Table 1. 510 Four encryption levels are used, producing keys for Initial, 0-RTT, 511 Handshake, and 1-RTT packets. CRYPTO frames are carried in just 512 three of these levels, omitting the 0-RTT level. These four levels 513 correspond to three packet number spaces: Initial and Handshake 514 encrypted packets use their own separate spaces; 0-RTT and 1-RTT 515 packets use the application data packet number space. 517 QUIC takes the unprotected content of TLS handshake records as the 518 content of CRYPTO frames. TLS record protection is not used by QUIC. 519 QUIC assembles CRYPTO frames into QUIC packets, which are protected 520 using QUIC packet protection. 522 QUIC is only capable of conveying TLS handshake records in CRYPTO 523 frames. TLS alerts are turned into QUIC CONNECTION_CLOSE error 524 codes; see Section 4.8. TLS application data and other message types 525 cannot be carried by QUIC at any encryption level; it is an error if 526 they are received from the TLS stack. 528 When an endpoint receives a QUIC packet containing a CRYPTO frame 529 from the network, it proceeds as follows: 531 * If the packet uses the current TLS receiving encryption level, 532 sequence the data into the input flow as usual. As with STREAM 533 frames, the offset is used to find the proper location in the data 534 sequence. If the result of this process is that new data is 535 available, then it is delivered to TLS in order. 537 * If the packet is from a previously installed encryption level, it 538 MUST NOT contain data that extends past the end of previously 539 received data in that flow. Implementations MUST treat any 540 violations of this requirement as a connection error of type 541 PROTOCOL_VIOLATION. 543 * If the packet is from a new encryption level, it is saved for 544 later processing by TLS. Once TLS moves to receiving from this 545 encryption level, saved data can be provided to TLS. When 546 providing data from any new encryption level to TLS, if there is 547 data from a previous encryption level that TLS has not consumed, 548 this MUST be treated as a connection error of type 549 PROTOCOL_VIOLATION. 551 Each time that TLS is provided with new data, new handshake bytes are 552 requested from TLS. TLS might not provide any bytes if the handshake 553 messages it has received are incomplete or it has no data to send. 555 The content of CRYPTO frames might either be processed incrementally 556 by TLS or buffered until complete messages or flights are available. 557 TLS is responsible for buffering handshake bytes that have arrived in 558 order. QUIC is responsible for buffering handshake bytes that arrive 559 out of order or for encryption levels that are not yet ready. QUIC 560 does not provide any means of flow control for CRYPTO frames; see 561 Section 7.5 of [QUIC-TRANSPORT]. 563 Once the TLS handshake is complete, this is indicated to QUIC along 564 with any final handshake bytes that TLS needs to send. TLS also 565 provides QUIC with the transport parameters that the peer advertised 566 during the handshake. 568 Once the handshake is complete, TLS becomes passive. TLS can still 569 receive data from its peer and respond in kind, but it will not need 570 to send more data unless specifically requested - either by an 571 application or QUIC. One reason to send data is that the server 572 might wish to provide additional or updated session tickets to a 573 client. 575 When the handshake is complete, QUIC only needs to provide TLS with 576 any data that arrives in CRYPTO streams. In the same way that is 577 done during the handshake, new data is requested from TLS after 578 providing received data. 580 4.1.4. Encryption Level Changes 582 As keys at a given encryption level become available to TLS, TLS 583 indicates to QUIC that reading or writing keys at that encryption 584 level are available. 586 The availability of new keys is always a result of providing inputs 587 to TLS. TLS only provides new keys after being initialized (by a 588 client) or when provided with new handshake data. 590 However, a TLS implementation could perform some of its processing 591 asynchronously. In particular, the process of validating a 592 certificate can take some time. While waiting for TLS processing to 593 complete, an endpoint SHOULD buffer received packets if they might be 594 processed using keys that aren't yet available. These packets can be 595 processed once keys are provided by TLS. An endpoint SHOULD continue 596 to respond to packets that can be processed during this time. 598 After processing inputs, TLS might produce handshake bytes, keys for 599 new encryption levels, or both. 601 TLS provides QUIC with three items as a new encryption level becomes 602 available: 604 * A secret 606 * An Authenticated Encryption with Associated Data (AEAD) function 608 * A Key Derivation Function (KDF) 609 These values are based on the values that TLS negotiates and are used 610 by QUIC to generate packet and header protection keys; see Section 5 611 and Section 5.4. 613 If 0-RTT is possible, it is ready after the client sends a TLS 614 ClientHello message or the server receives that message. After 615 providing a QUIC client with the first handshake bytes, the TLS stack 616 might signal the change to 0-RTT keys. On the server, after 617 receiving handshake bytes that contain a ClientHello message, a TLS 618 server might signal that 0-RTT keys are available. 620 Although TLS only uses one encryption level at a time, QUIC may use 621 more than one level. For instance, after sending its Finished 622 message (using a CRYPTO frame at the Handshake encryption level) an 623 endpoint can send STREAM data (in 1-RTT encryption). If the Finished 624 message is lost, the endpoint uses the Handshake encryption level to 625 retransmit the lost message. Reordering or loss of packets can mean 626 that QUIC will need to handle packets at multiple encryption levels. 627 During the handshake, this means potentially handling packets at 628 higher and lower encryption levels than the current encryption level 629 used by TLS. 631 In particular, server implementations need to be able to read packets 632 at the Handshake encryption level at the same time as the 0-RTT 633 encryption level. A client could interleave ACK frames that are 634 protected with Handshake keys with 0-RTT data and the server needs to 635 process those acknowledgments in order to detect lost Handshake 636 packets. 638 QUIC also needs access to keys that might not ordinarily be available 639 to a TLS implementation. For instance, a client might need to 640 acknowledge Handshake packets before it is ready to send CRYPTO 641 frames at that encryption level. TLS therefore needs to provide keys 642 to QUIC before it might produce them for its own use. 644 4.1.5. TLS Interface Summary 646 Figure 5 summarizes the exchange between QUIC and TLS for both client 647 and server. Solid arrows indicate packets that carry handshake data; 648 dashed arrows show where application data can be sent. Each arrow is 649 tagged with the encryption level used for that transmission. 651 Client Server 652 ====== ====== 654 Get Handshake 655 Initial -------------> 656 Install tx 0-RTT Keys 657 0-RTT - - - - - - - -> 659 Handshake Received 660 Get Handshake 661 <------------- Initial 662 Install rx 0-RTT keys 663 Install Handshake keys 664 Get Handshake 665 <----------- Handshake 666 Install tx 1-RTT keys 667 <- - - - - - - - 1-RTT 669 Handshake Received (Initial) 670 Install Handshake keys 671 Handshake Received (Handshake) 672 Get Handshake 673 Handshake -----------> 674 Handshake Complete 675 Install 1-RTT keys 676 1-RTT - - - - - - - -> 678 Handshake Received 679 Handshake Complete 680 Install rx 1-RTT keys 682 Figure 5: Interaction Summary between QUIC and TLS 684 Figure 5 shows the multiple packets that form a single "flight" of 685 messages being processed individually, to show what incoming messages 686 trigger different actions. New handshake messages are requested 687 after incoming packets have been processed. This process varies 688 based on the structure of endpoint implementations and the order in 689 which packets arrive; this is intended to illustrate the steps 690 involved in a single handshake exchange. 692 4.2. TLS Version 694 This document describes how TLS 1.3 [TLS13] is used with QUIC. 696 In practice, the TLS handshake will negotiate a version of TLS to 697 use. This could result in a newer version of TLS than 1.3 being 698 negotiated if both endpoints support that version. This is 699 acceptable provided that the features of TLS 1.3 that are used by 700 QUIC are supported by the newer version. 702 Clients MUST NOT offer TLS versions older than 1.3. A badly 703 configured TLS implementation could negotiate TLS 1.2 or another 704 older version of TLS. An endpoint MUST terminate the connection if a 705 version of TLS older than 1.3 is negotiated. 707 4.3. ClientHello Size 709 The first Initial packet from a client contains the start or all of 710 its first cryptographic handshake message, which for TLS is the 711 ClientHello. Servers might need to parse the entire ClientHello 712 (e.g., to access extensions such as Server Name Identification (SNI) 713 or Application Layer Protocol Negotiation (ALPN)) in order to decide 714 whether to accept the new incoming QUIC connection. If the 715 ClientHello spans multiple Initial packets, such servers would need 716 to buffer the first received fragments, which could consume excessive 717 resources if the client's address has not yet been validated. To 718 avoid this, servers MAY use the Retry feature (see Section 8.1 of 719 [QUIC-TRANSPORT]) to only buffer partial ClientHello messages from 720 clients with a validated address. 722 QUIC packet and framing add at least 36 bytes of overhead to the 723 ClientHello message. That overhead increases if the client chooses a 724 connection ID without zero length. Overheads also do not include the 725 token or a connection ID longer than 8 bytes, both of which might be 726 required if a server sends a Retry packet. 728 A typical TLS ClientHello can easily fit into a 1200-byte packet. 729 However, in addition to the overheads added by QUIC, there are 730 several variables that could cause this limit to be exceeded. Large 731 session tickets, multiple or large key shares, and long lists of 732 supported ciphers, signature algorithms, versions, QUIC transport 733 parameters, and other negotiable parameters and extensions could 734 cause this message to grow. 736 For servers, in addition to connection IDs and tokens, the size of 737 TLS session tickets can have an effect on a client's ability to 738 connect efficiently. Minimizing the size of these values increases 739 the probability that clients can use them and still fit their 740 ClientHello message in their first Initial packet. 742 The TLS implementation does not need to ensure that the ClientHello 743 is sufficiently large. QUIC PADDING frames are added to increase the 744 size of the packet as necessary. 746 4.4. Peer Authentication 748 The requirements for authentication depend on the application 749 protocol that is in use. TLS provides server authentication and 750 permits the server to request client authentication. 752 A client MUST authenticate the identity of the server. This 753 typically involves verification that the identity of the server is 754 included in a certificate and that the certificate is issued by a 755 trusted entity (see for example [RFC2818]). 757 Note: Where servers provide certificates for authentication, the 758 size of the certificate chain can consume a large number of bytes. 759 Controlling the size of certificate chains is critical to 760 performance in QUIC as servers are limited to sending 3 bytes for 761 every byte received prior to validating the client address; see 762 Section 8.1 of [QUIC-TRANSPORT]. The size of a certificate chain 763 can be managed by limiting the number of names or extensions; 764 using keys with small public key representations, like ECDSA; or 765 by using certificate compression [COMPRESS]. 767 A server MAY request that the client authenticate during the 768 handshake. A server MAY refuse a connection if the client is unable 769 to authenticate when requested. The requirements for client 770 authentication vary based on application protocol and deployment. 772 A server MUST NOT use post-handshake client authentication (as 773 defined in Section 4.6.2 of [TLS13]), because the multiplexing 774 offered by QUIC prevents clients from correlating the certificate 775 request with the application-level event that triggered it (see 776 [HTTP2-TLS13]). More specifically, servers MUST NOT send post- 777 handshake TLS CertificateRequest messages and clients MUST treat 778 receipt of such messages as a connection error of type 779 PROTOCOL_VIOLATION. 781 4.5. Session Resumption 783 QUIC can use the session resumption feature of TLS 1.3. It does this 784 by carrying NewSessionTicket messages in CRYPTO frames after the 785 handshake is complete. Session resumption is the basis of 0-RTT, but 786 can be used without also enabling 0-RTT. 788 Endpoints that use session resumption might need to remember some 789 information about the current connection when creating a resumed 790 connection. TLS requires that some information be retained; see 791 Section 4.6.1 of [TLS13]. QUIC itself does not depend on any state 792 being retained when resuming a connection, unless 0-RTT is also used; 793 see Section 4.6.1 and Section 7.4.1 of [QUIC-TRANSPORT]. Application 794 protocols could depend on state that is retained between resumed 795 connections. 797 Clients can store any state required for resumption along with the 798 session ticket. Servers can use the session ticket to help carry 799 state. 801 Session resumption allows servers to link activity on the original 802 connection with the resumed connection, which might be a privacy 803 issue for clients. Clients can choose not to enable resumption to 804 avoid creating this correlation. Client SHOULD NOT reuse tickets as 805 that allows entities other than the server to correlate connections; 806 see Section C.4 of [TLS13]. 808 4.6. 0-RTT 810 The 0-RTT feature in QUIC allows a client to send application data 811 before the handshake is complete. This is made possible by reusing 812 negotiated parameters from a previous connection. To enable this, 813 0-RTT depends on the client remembering critical parameters and 814 providing the server with a TLS session ticket that allows the server 815 to recover the same information. 817 This information includes parameters that determine TLS state, as 818 governed by [TLS13], QUIC transport parameters, the chosen 819 application protocol, and any information the application protocol 820 might need; see Section 4.6.3. This information determines how 0-RTT 821 packets and their contents are formed. 823 To ensure that the same information is available to both endpoints, 824 all information used to establish 0-RTT comes from the same 825 connection. Endpoints cannot selectively disregard information that 826 might alter the sending or processing of 0-RTT. 828 [TLS13] sets a limit of 7 days on the time between the original 829 connection and any attempt to use 0-RTT. There are other constraints 830 on 0-RTT usage, notably those caused by the potential exposure to 831 replay attack; see Section 9.2. 833 4.6.1. Enabling 0-RTT 835 To communicate their willingness to process 0-RTT data, servers send 836 a NewSessionTicket message that contains the early_data extension 837 with a max_early_data_size of 0xffffffff. The TLS 838 max_early_data_size parameter is not used in QUIC. The amount of 839 data that the client can send in 0-RTT is controlled by the 840 initial_max_data transport parameter supplied by the server. 842 Servers MUST NOT send the early_data extension with a 843 max_early_data_size field set to any value other than 0xffffffff. A 844 client MUST treat receipt of a NewSessionTicket that contains an 845 early_data extension with any other value as a connection error of 846 type PROTOCOL_VIOLATION. 848 A client that wishes to send 0-RTT packets uses the early_data 849 extension in the ClientHello message of a subsequent handshake; see 850 Section 4.2.10 of [TLS13]. It then sends application data in 0-RTT 851 packets. 853 A client that attempts 0-RTT might also provide an address validation 854 token if the server has sent a NEW_TOKEN frame; see Section 8.1 of 855 [QUIC-TRANSPORT]. 857 4.6.2. Accepting and Rejecting 0-RTT 859 A server accepts 0-RTT by sending an early_data extension in the 860 EncryptedExtensions (see Section 4.2.10 of [TLS13]). The server then 861 processes and acknowledges the 0-RTT packets that it receives. 863 A server rejects 0-RTT by sending the EncryptedExtensions without an 864 early_data extension. A server will always reject 0-RTT if it sends 865 a TLS HelloRetryRequest. When rejecting 0-RTT, a server MUST NOT 866 process any 0-RTT packets, even if it could. When 0-RTT was 867 rejected, a client SHOULD treat receipt of an acknowledgement for a 868 0-RTT packet as a connection error of type PROTOCOL_VIOLATION, if it 869 is able to detect the condition. 871 When 0-RTT is rejected, all connection characteristics that the 872 client assumed might be incorrect. This includes the choice of 873 application protocol, transport parameters, and any application 874 configuration. The client therefore MUST reset the state of all 875 streams, including application state bound to those streams. 877 A client MAY reattempt 0-RTT if it receives a Retry or Version 878 Negotiation packet. These packets do not signify rejection of 0-RTT. 880 4.6.3. Validating 0-RTT Configuration 882 When a server receives a ClientHello with the early_data extension, 883 it has to decide whether to accept or reject early data from the 884 client. Some of this decision is made by the TLS stack (e.g., 885 checking that the cipher suite being resumed was included in the 886 ClientHello; see Section 4.2.10 of [TLS13]). Even when the TLS stack 887 has no reason to reject early data, the QUIC stack or the application 888 protocol using QUIC might reject early data because the configuration 889 of the transport or application associated with the resumed session 890 is not compatible with the server's current configuration. 892 QUIC requires additional transport state to be associated with a 893 0-RTT session ticket. One common way to implement this is using 894 stateless session tickets and storing this state in the session 895 ticket. Application protocols that use QUIC might have similar 896 requirements regarding associating or storing state. This associated 897 state is used for deciding whether early data must be rejected. For 898 example, HTTP/3 ([QUIC-HTTP]) settings determine how early data from 899 the client is interpreted. Other applications using QUIC could have 900 different requirements for determining whether to accept or reject 901 early data. 903 4.7. HelloRetryRequest 905 The HelloRetryRequest message (see Section 4.1.4 of [TLS13]) can be 906 used to request that a client provide new information, such as a key 907 share, or to validate some characteristic of the client. From the 908 perspective of QUIC, HelloRetryRequest is not differentiated from 909 other cryptographic handshake messages that are carried in Initial 910 packets. Although it is in principle possible to use this feature 911 for address verification, QUIC implementations SHOULD instead use the 912 Retry feature; see Section 8.1 of [QUIC-TRANSPORT]. 914 4.8. TLS Errors 916 If TLS experiences an error, it generates an appropriate alert as 917 defined in Section 6 of [TLS13]. 919 A TLS alert is converted into a QUIC connection error. The alert 920 description is added to 0x100 to produce a QUIC error code from the 921 range reserved for CRYPTO_ERROR. The resulting value is sent in a 922 QUIC CONNECTION_CLOSE frame of type 0x1c. 924 The alert level of all TLS alerts is "fatal"; a TLS stack MUST NOT 925 generate alerts at the "warning" level. 927 QUIC permits the use of a generic code in place of a specific error 928 code; see Section 11 of [QUIC-TRANSPORT]. For TLS alerts, this 929 includes replacing any alert with a generic alert, such as 930 handshake_failure (0x128 in QUIC). Endpoints MAY use a generic error 931 code to avoid possibly exposing confidential information. 933 4.9. Discarding Unused Keys 935 After QUIC moves to a new encryption level, packet protection keys 936 for previous encryption levels can be discarded. This occurs several 937 times during the handshake, as well as when keys are updated; see 938 Section 6. 940 Packet protection keys are not discarded immediately when new keys 941 are available. If packets from a lower encryption level contain 942 CRYPTO frames, frames that retransmit that data MUST be sent at the 943 same encryption level. Similarly, an endpoint generates 944 acknowledgements for packets at the same encryption level as the 945 packet being acknowledged. Thus, it is possible that keys for a 946 lower encryption level are needed for a short time after keys for a 947 newer encryption level are available. 949 An endpoint cannot discard keys for a given encryption level unless 950 it has both received and acknowledged all CRYPTO frames for that 951 encryption level and when all CRYPTO frames for that encryption level 952 have been acknowledged by its peer. However, this does not guarantee 953 that no further packets will need to be received or sent at that 954 encryption level because a peer might not have received all the 955 acknowledgements necessary to reach the same state. 957 Though an endpoint might retain older keys, new data MUST be sent at 958 the highest currently-available encryption level. Only ACK frames 959 and retransmissions of data in CRYPTO frames are sent at a previous 960 encryption level. These packets MAY also include PADDING frames. 962 4.9.1. Discarding Initial Keys 964 Packets protected with Initial secrets (Section 5.2) are not 965 authenticated, meaning that an attacker could spoof packets with the 966 intent to disrupt a connection. To limit these attacks, Initial 967 packet protection keys can be discarded more aggressively than other 968 keys. 970 The successful use of Handshake packets indicates that no more 971 Initial packets need to be exchanged, as these keys can only be 972 produced after receiving all CRYPTO frames from Initial packets. 973 Thus, a client MUST discard Initial keys when it first sends a 974 Handshake packet and a server MUST discard Initial keys when it first 975 successfully processes a Handshake packet. Endpoints MUST NOT send 976 Initial packets after this point. 978 This results in abandoning loss recovery state for the Initial 979 encryption level and ignoring any outstanding Initial packets. 981 4.9.2. Discarding Handshake Keys 983 An endpoint MUST discard its handshake keys when the TLS handshake is 984 confirmed (Section 4.1.2). The server MUST send a HANDSHAKE_DONE 985 frame as soon as it completes the handshake. 987 4.9.3. Discarding 0-RTT Keys 989 0-RTT and 1-RTT packets share the same packet number space, and 990 clients do not send 0-RTT packets after sending a 1-RTT packet 991 (Section 5.6). 993 Therefore, a client SHOULD discard 0-RTT keys as soon as it installs 994 1-RTT keys, since they have no use after that moment. 996 Additionally, a server MAY discard 0-RTT keys as soon as it receives 997 a 1-RTT packet. However, due to packet reordering, a 0-RTT packet 998 could arrive after a 1-RTT packet. Servers MAY temporarily retain 999 0-RTT keys to allow decrypting reordered packets without requiring 1000 their contents to be retransmitted with 1-RTT keys. After receiving 1001 a 1-RTT packet, servers MUST discard 0-RTT keys within a short time; 1002 the RECOMMENDED time period is three times the Probe Timeout (PTO, 1003 see [QUIC-RECOVERY]). A server MAY discard 0-RTT keys earlier if it 1004 determines that it has received all 0-RTT packets, which can be done 1005 by keeping track of missing packet numbers. 1007 5. Packet Protection 1009 As with TLS over TCP, QUIC protects packets with keys derived from 1010 the TLS handshake, using the AEAD algorithm [AEAD] negotiated by TLS. 1012 QUIC packets have varying protections depending on their type: 1014 * Version Negotiation packets have no cryptographic protection. 1016 * Retry packets use AEAD_AES_128_GCM to provide protection against 1017 accidental modification or insertion by off-path adversaries; see 1018 Section 5.8. 1020 * Initial packets use AEAD_AES_128_GCM with keys derived from the 1021 Destination Connection ID field of the first Initial packet sent 1022 by the client; see Section 5.2. 1024 * All other packets have strong cryptographic protections for 1025 confidentiality and integrity, using keys and algorithms 1026 negotiated by TLS. 1028 This section describes how packet protection is applied to Handshake 1029 packets, 0-RTT packets, and 1-RTT packets. The same packet 1030 protection process is applied to Initial packets. However, as it is 1031 trivial to determine the keys used for Initial packets, these packets 1032 are not considered to have confidentiality or integrity protection. 1033 Retry packets use a fixed key and so similarly lack confidentiality 1034 and integrity protection. 1036 5.1. Packet Protection Keys 1038 QUIC derives packet protection keys in the same way that TLS derives 1039 record protection keys. 1041 Each encryption level has separate secret values for protection of 1042 packets sent in each direction. These traffic secrets are derived by 1043 TLS (see Section 7.1 of [TLS13]) and are used by QUIC for all 1044 encryption levels except the Initial encryption level. The secrets 1045 for the Initial encryption level are computed based on the client's 1046 initial Destination Connection ID, as described in Section 5.2. 1048 The keys used for packet protection are computed from the TLS secrets 1049 using the KDF provided by TLS. In TLS 1.3, the HKDF-Expand-Label 1050 function described in Section 7.1 of [TLS13] is used, using the hash 1051 function from the negotiated cipher suite. Other versions of TLS 1052 MUST provide a similar function in order to be used with QUIC. 1054 The current encryption level secret and the label "quic key" are 1055 input to the KDF to produce the AEAD key; the label "quic iv" is used 1056 to derive the Initialization Vector (IV); see Section 5.3. The 1057 header protection key uses the "quic hp" label; see Section 5.4. 1058 Using these labels provides key separation between QUIC and TLS; see 1059 Section 9.6. 1061 The KDF used for initial secrets is always the HKDF-Expand-Label 1062 function from TLS 1.3; see Section 5.2. 1064 5.2. Initial Secrets 1066 Initial packets apply the packet protection process, but use a secret 1067 derived from the Destination Connection ID field from the client's 1068 first Initial packet. 1070 This secret is determined by using HKDF-Extract (see Section 2.2 of 1071 [HKDF]) with a salt of 0xafbfec289993d24c9e9786f19c6111e04390a899 and 1072 a IKM of the Destination Connection ID field. This produces an 1073 intermediate pseudorandom key (PRK) that is used to derive two 1074 separate secrets for sending and receiving. 1076 The secret used by clients to construct Initial packets uses the PRK 1077 and the label "client in" as input to the HKDF-Expand-Label function 1078 to produce a 32 byte secret; packets constructed by the server use 1079 the same process with the label "server in". The hash function for 1080 HKDF when deriving initial secrets and keys is SHA-256 [SHA]. 1082 This process in pseudocode is: 1084 initial_salt = 0xafbfec289993d24c9e9786f19c6111e04390a899 1085 initial_secret = HKDF-Extract(initial_salt, 1086 client_dst_connection_id) 1088 client_initial_secret = HKDF-Expand-Label(initial_secret, 1089 "client in", "", 1090 Hash.length) 1091 server_initial_secret = HKDF-Expand-Label(initial_secret, 1092 "server in", "", 1093 Hash.length) 1095 The connection ID used with HKDF-Expand-Label is the Destination 1096 Connection ID in the Initial packet sent by the client. This will be 1097 a randomly-selected value unless the client creates the Initial 1098 packet after receiving a Retry packet, where the Destination 1099 Connection ID is selected by the server. 1101 Future versions of QUIC SHOULD generate a new salt value, thus 1102 ensuring that the keys are different for each version of QUIC. This 1103 prevents a middlebox that recognizes only one version of QUIC from 1104 seeing or modifying the contents of packets from future versions. 1106 The HKDF-Expand-Label function defined in TLS 1.3 MUST be used for 1107 Initial packets even where the TLS versions offered do not include 1108 TLS 1.3. 1110 The secrets used for constructing Initial packets change when a 1111 server sends a Retry packet to use the connection ID value selected 1112 by the server. The secrets do not change when a client changes the 1113 Destination Connection ID it uses in response to an Initial packet 1114 from the server. 1116 Note: The Destination Connection ID is of arbitrary length, and it 1117 could be zero length if the server sends a Retry packet with a 1118 zero-length Source Connection ID field. In this case, the Initial 1119 keys provide no assurance to the client that the server received 1120 its packet; the client has to rely on the exchange that included 1121 the Retry packet for that property. 1123 Appendix A contains sample Initial packets. 1125 5.3. AEAD Usage 1127 The Authenticated Encryption with Associated Data (AEAD; see [AEAD]) 1128 function used for QUIC packet protection is the AEAD that is 1129 negotiated for use with the TLS connection. For example, if TLS is 1130 using the TLS_AES_128_GCM_SHA256 cipher suite, the AEAD_AES_128_GCM 1131 function is used. 1133 QUIC can use any of the cipher suites defined in [TLS13] with the 1134 exception of TLS_AES_128_CCM_8_SHA256. A cipher suite MUST NOT be 1135 negotiated unless a header protection scheme is defined for the 1136 cipher suite. This document defines a header protection scheme for 1137 all cipher suites defined in [TLS13] aside from 1138 TLS_AES_128_CCM_8_SHA256. These cipher suites have a 16-byte 1139 authentication tag and produce an output 16 bytes larger than their 1140 input. 1142 Note: An endpoint MUST NOT reject a ClientHello that offers a cipher 1143 suite that it does not support, or it would be impossible to 1144 deploy a new cipher suite. This also applies to 1145 TLS_AES_128_CCM_8_SHA256. 1147 When constructing packets, the AEAD function is applied prior to 1148 applying header protection; see Section 5.4. The unprotected packet 1149 header is part of the associated data (A). When processing packets, 1150 an endpoint first removes the header protection. 1152 The key and IV for the packet are computed as described in 1153 Section 5.1. The nonce, N, is formed by combining the packet 1154 protection IV with the packet number. The 62 bits of the 1155 reconstructed QUIC packet number in network byte order are left- 1156 padded with zeros to the size of the IV. The exclusive OR of the 1157 padded packet number and the IV forms the AEAD nonce. 1159 The associated data, A, for the AEAD is the contents of the QUIC 1160 header, starting from the first byte of either the short or long 1161 header, up to and including the unprotected packet number. 1163 The input plaintext, P, for the AEAD is the payload of the QUIC 1164 packet, as described in [QUIC-TRANSPORT]. 1166 The output ciphertext, C, of the AEAD is transmitted in place of P. 1168 Some AEAD functions have limits for how many packets can be encrypted 1169 under the same key and IV; see Section 6.6. This might be lower than 1170 the packet number limit. An endpoint MUST initiate a key update 1171 (Section 6) prior to exceeding any limit set for the AEAD that is in 1172 use. 1174 5.4. Header Protection 1176 Parts of QUIC packet headers, in particular the Packet Number field, 1177 are protected using a key that is derived separately from the packet 1178 protection key and IV. The key derived using the "quic hp" label is 1179 used to provide confidentiality protection for those fields that are 1180 not exposed to on-path elements. 1182 This protection applies to the least-significant bits of the first 1183 byte, plus the Packet Number field. The four least-significant bits 1184 of the first byte are protected for packets with long headers; the 1185 five least significant bits of the first byte are protected for 1186 packets with short headers. For both header forms, this covers the 1187 reserved bits and the Packet Number Length field; the Key Phase bit 1188 is also protected for packets with a short header. 1190 The same header protection key is used for the duration of the 1191 connection, with the value not changing after a key update (see 1192 Section 6). This allows header protection to be used to protect the 1193 key phase. 1195 This process does not apply to Retry or Version Negotiation packets, 1196 which do not contain a protected payload or any of the fields that 1197 are protected by this process. 1199 5.4.1. Header Protection Application 1201 Header protection is applied after packet protection is applied (see 1202 Section 5.3). The ciphertext of the packet is sampled and used as 1203 input to an encryption algorithm. The algorithm used depends on the 1204 negotiated AEAD. 1206 The output of this algorithm is a 5-byte mask that is applied to the 1207 protected header fields using exclusive OR. The least significant 1208 bits of the first byte of the packet are masked by the least 1209 significant bits of the first mask byte, and the packet number is 1210 masked with the remaining bytes. Any unused bytes of mask that might 1211 result from a shorter packet number encoding are unused. 1213 Figure 6 shows a sample algorithm for applying header protection. 1214 Removing header protection only differs in the order in which the 1215 packet number length (pn_length) is determined. 1217 mask = header_protection(hp_key, sample) 1219 pn_length = (packet[0] & 0x03) + 1 1220 if (packet[0] & 0x80) == 0x80: 1221 # Long header: 4 bits masked 1222 packet[0] ^= mask[0] & 0x0f 1223 else: 1224 # Short header: 5 bits masked 1225 packet[0] ^= mask[0] & 0x1f 1227 # pn_offset is the start of the Packet Number field. 1228 packet[pn_offset:pn_offset+pn_length] ^= mask[1:1+pn_length] 1230 Figure 6: Header Protection Pseudocode 1232 Figure 7 shows an example long header packet (Initial) and a short 1233 header packet. Figure 7 shows the fields in each header that are 1234 covered by header protection and the portion of the protected packet 1235 payload that is sampled. 1237 Initial Packet { 1238 Header Form (1) = 1, 1239 Fixed Bit (1) = 1, 1240 Long Packet Type (2) = 0, 1241 Reserved Bits (2), # Protected 1242 Packet Number Length (2), # Protected 1243 Version (32), 1244 DCID Len (8), 1245 Destination Connection ID (0..160), 1246 SCID Len (8), 1247 Source Connection ID (0..160), 1248 Token Length (i), 1249 Token (..), 1250 Length (i), 1251 Packet Number (8..32), # Protected 1252 Protected Payload (0..24), # Skipped Part 1253 Protected Payload (128), # Sampled Part 1254 Protected Payload (..) # Remainder 1255 } 1257 Short Header Packet { 1258 Header Form (1) = 0, 1259 Fixed Bit (1) = 1, 1260 Spin Bit (1), 1261 Reserved Bits (2), # Protected 1262 Key Phase (1), # Protected 1263 Packet Number Length (2), # Protected 1264 Destination Connection ID (0..160), 1265 Packet Number (8..32), # Protected 1266 Protected Payload (0..24), # Skipped Part 1267 Protected Payload (128), # Sampled Part 1268 Protected Payload (..), # Remainder 1269 } 1271 Figure 7: Header Protection and Ciphertext Sample 1273 Before a TLS cipher suite can be used with QUIC, a header protection 1274 algorithm MUST be specified for the AEAD used with that cipher suite. 1275 This document defines algorithms for AEAD_AES_128_GCM, 1276 AEAD_AES_128_CCM, AEAD_AES_256_GCM (all these AES AEADs are defined 1277 in [AEAD]), and AEAD_CHACHA20_POLY1305 (defined in [CHACHA]). Prior 1278 to TLS selecting a cipher suite, AES header protection is used 1279 (Section 5.4.3), matching the AEAD_AES_128_GCM packet protection. 1281 5.4.2. Header Protection Sample 1283 The header protection algorithm uses both the header protection key 1284 and a sample of the ciphertext from the packet Payload field. 1286 The same number of bytes are always sampled, but an allowance needs 1287 to be made for the endpoint removing protection, which will not know 1288 the length of the Packet Number field. In sampling the packet 1289 ciphertext, the Packet Number field is assumed to be 4 bytes long 1290 (its maximum possible encoded length). 1292 An endpoint MUST discard packets that are not long enough to contain 1293 a complete sample. 1295 To ensure that sufficient data is available for sampling, packets are 1296 padded so that the combined lengths of the encoded packet number and 1297 protected payload is at least 4 bytes longer than the sample required 1298 for header protection. The cipher suites defined in [TLS13] - other 1299 than TLS_AES_128_CCM_8_SHA256, for which a header protection scheme 1300 is not defined in this document - have 16-byte expansions and 16-byte 1301 header protection samples. This results in needing at least 3 bytes 1302 of frames in the unprotected payload if the packet number is encoded 1303 on a single byte, or 2 bytes of frames for a 2-byte packet number 1304 encoding. 1306 The sampled ciphertext for a packet with a short header can be 1307 determined by the following pseudocode: 1309 sample_offset = 1 + len(connection_id) + 4 1311 sample = packet[sample_offset..sample_offset+sample_length] 1313 For example, for a packet with a short header, an 8-byte connection 1314 ID, and protected with AEAD_AES_128_GCM, the sample takes bytes 13 to 1315 28 inclusive (using zero-based indexing). 1317 A packet with a long header is sampled in the same way, noting that 1318 multiple QUIC packets might be included in the same UDP datagram and 1319 that each one is handled separately. 1321 sample_offset = 7 + len(destination_connection_id) + 1322 len(source_connection_id) + 1323 len(payload_length) + 4 1324 if packet_type == Initial: 1325 sample_offset += len(token_length) + 1326 len(token) 1328 sample = packet[sample_offset..sample_offset+sample_length] 1330 5.4.3. AES-Based Header Protection 1332 This section defines the packet protection algorithm for 1333 AEAD_AES_128_GCM, AEAD_AES_128_CCM, and AEAD_AES_256_GCM. 1334 AEAD_AES_128_GCM and AEAD_AES_128_CCM use 128-bit AES in electronic 1335 code-book (ECB) mode. AEAD_AES_256_GCM uses 256-bit AES in ECB mode. 1336 AES is defined in [AES]. 1338 This algorithm samples 16 bytes from the packet ciphertext. This 1339 value is used as the input to AES-ECB. In pseudocode: 1341 mask = AES-ECB(hp_key, sample) 1343 5.4.4. ChaCha20-Based Header Protection 1345 When AEAD_CHACHA20_POLY1305 is in use, header protection uses the raw 1346 ChaCha20 function as defined in Section 2.4 of [CHACHA]. This uses a 1347 256-bit key and 16 bytes sampled from the packet protection output. 1349 The first 4 bytes of the sampled ciphertext are the block counter. A 1350 ChaCha20 implementation could take a 32-bit integer in place of a 1351 byte sequence, in which case the byte sequence is interpreted as a 1352 little-endian value. 1354 The remaining 12 bytes are used as the nonce. A ChaCha20 1355 implementation might take an array of three 32-bit integers in place 1356 of a byte sequence, in which case the nonce bytes are interpreted as 1357 a sequence of 32-bit little-endian integers. 1359 The encryption mask is produced by invoking ChaCha20 to protect 5 1360 zero bytes. In pseudocode: 1362 counter = sample[0..3] 1363 nonce = sample[4..15] 1364 mask = ChaCha20(hp_key, counter, nonce, {0,0,0,0,0}) 1366 5.5. Receiving Protected Packets 1368 Once an endpoint successfully receives a packet with a given packet 1369 number, it MUST discard all packets in the same packet number space 1370 with higher packet numbers if they cannot be successfully unprotected 1371 with either the same key, or - if there is a key update - the next 1372 packet protection key (see Section 6). Similarly, a packet that 1373 appears to trigger a key update, but cannot be unprotected 1374 successfully MUST be discarded. 1376 Failure to unprotect a packet does not necessarily indicate the 1377 existence of a protocol error in a peer or an attack. The truncated 1378 packet number encoding used in QUIC can cause packet numbers to be 1379 decoded incorrectly if they are delayed significantly. 1381 5.6. Use of 0-RTT Keys 1383 If 0-RTT keys are available (see Section 4.6.1), the lack of replay 1384 protection means that restrictions on their use are necessary to 1385 avoid replay attacks on the protocol. 1387 A client MUST only use 0-RTT keys to protect data that is idempotent. 1388 A client MAY wish to apply additional restrictions on what data it 1389 sends prior to the completion of the TLS handshake. A client 1390 otherwise treats 0-RTT keys as equivalent to 1-RTT keys, except that 1391 it MUST NOT send ACKs with 0-RTT keys. 1393 A client that receives an indication that its 0-RTT data has been 1394 accepted by a server can send 0-RTT data until it receives all of the 1395 server's handshake messages. A client SHOULD stop sending 0-RTT data 1396 if it receives an indication that 0-RTT data has been rejected. 1398 A server MUST NOT use 0-RTT keys to protect packets; it uses 1-RTT 1399 keys to protect acknowledgements of 0-RTT packets. A client MUST NOT 1400 attempt to decrypt 0-RTT packets it receives and instead MUST discard 1401 them. 1403 Once a client has installed 1-RTT keys, it MUST NOT send any more 1404 0-RTT packets. 1406 Note: 0-RTT data can be acknowledged by the server as it receives 1407 it, but any packets containing acknowledgments of 0-RTT data 1408 cannot have packet protection removed by the client until the TLS 1409 handshake is complete. The 1-RTT keys necessary to remove packet 1410 protection cannot be derived until the client receives all server 1411 handshake messages. 1413 5.7. Receiving Out-of-Order Protected Frames 1415 Due to reordering and loss, protected packets might be received by an 1416 endpoint before the final TLS handshake messages are received. A 1417 client will be unable to decrypt 1-RTT packets from the server, 1418 whereas a server will be able to decrypt 1-RTT packets from the 1419 client. Endpoints in either role MUST NOT decrypt 1-RTT packets from 1420 their peer prior to completing the handshake. 1422 Even though 1-RTT keys are available to a server after receiving the 1423 first handshake messages from a client, it is missing assurances on 1424 the client state: 1426 * The client is not authenticated, unless the server has chosen to 1427 use a pre-shared key and validated the client's pre-shared key 1428 binder; see Section 4.2.11 of [TLS13]. 1430 * The client has not demonstrated liveness, unless a RETRY packet 1431 was used. 1433 * Any received 0-RTT data that the server responds to might be due 1434 to a replay attack. 1436 Therefore, the server's use of 1-RTT keys before the handshake is 1437 complete is limited to sending data. A server MUST NOT process 1438 incoming 1-RTT protected packets before the TLS handshake is 1439 complete. Because sending acknowledgments indicates that all frames 1440 in a packet have been processed, a server cannot send acknowledgments 1441 for 1-RTT packets until the TLS handshake is complete. Received 1442 packets protected with 1-RTT keys MAY be stored and later decrypted 1443 and used once the handshake is complete. 1445 Note: TLS implementations might provide all 1-RTT secrets prior to 1446 handshake completion. Even where QUIC implementations have 1-RTT 1447 read keys, those keys cannot be used prior to completing the 1448 handshake. 1450 The requirement for the server to wait for the client Finished 1451 message creates a dependency on that message being delivered. A 1452 client can avoid the potential for head-of-line blocking that this 1453 implies by sending its 1-RTT packets coalesced with a Handshake 1454 packet containing a copy of the CRYPTO frame that carries the 1455 Finished message, until one of the Handshake packets is acknowledged. 1456 This enables immediate server processing for those packets. 1458 A server could receive packets protected with 0-RTT keys prior to 1459 receiving a TLS ClientHello. The server MAY retain these packets for 1460 later decryption in anticipation of receiving a ClientHello. 1462 A client generally receives 1-RTT keys at the same time as the 1463 handshake completes. Even if it has 1-RTT secrets, a client MUST NOT 1464 process incoming 1-RTT protected packets before the TLS handshake is 1465 complete. 1467 5.8. Retry Packet Integrity 1469 Retry packets (see the Retry Packet section of [QUIC-TRANSPORT]) 1470 carry a Retry Integrity Tag that provides two properties: it allows 1471 discarding packets that have accidentally been corrupted by the 1472 network, and it diminishes off-path attackers' ability to send valid 1473 Retry packets. 1475 The Retry Integrity Tag is a 128-bit field that is computed as the 1476 output of AEAD_AES_128_GCM ([AEAD]) used with the following inputs: 1478 * The secret key, K, is 128 bits equal to 1479 0xccce187ed09a09d05728155a6cb96be1. 1481 * The nonce, N, is 96 bits equal to 0xe54930f97f2136f0530a8c1c. 1483 * The plaintext, P, is empty. 1485 * The associated data, A, is the contents of the Retry Pseudo- 1486 Packet, as illustrated in Figure 8: 1488 The secret key and the nonce are values derived by calling HKDF- 1489 Expand-Label using 1490 0x8b0d37eb8535022ebc8d76a207d80df22646ec06dc809642c30a8baa2baaff4c as 1491 the secret, with labels being "quic key" and "quic iv" (Section 5.1). 1493 Retry Pseudo-Packet { 1494 ODCID Length (8), 1495 Original Destination Connection ID (0..160), 1496 Header Form (1) = 1, 1497 Fixed Bit (1) = 1, 1498 Long Packet Type (2) = 3, 1499 Type-Specific Bits (4), 1500 Version (32), 1501 DCID Len (8), 1502 Destination Connection ID (0..160), 1503 SCID Len (8), 1504 Retry Token (..), 1505 } 1507 Figure 8: Retry Pseudo-Packet 1509 The Retry Pseudo-Packet is not sent over the wire. It is computed by 1510 taking the transmitted Retry packet, removing the Retry Integrity Tag 1511 and prepending the two following fields: 1513 ODCID Length: The ODCID Length field contains the length in bytes of 1514 the Original Destination Connection ID field that follows it, 1515 encoded as an 8-bit unsigned integer. 1517 Original Destination Connection ID: The Original Destination 1518 Connection ID contains the value of the Destination Connection ID 1519 from the Initial packet that this Retry is in response to. The 1520 length of this field is given in ODCID Length. The presence of 1521 this field mitigates an off-path attacker's ability to inject a 1522 Retry packet. 1524 6. Key Update 1526 Once the handshake is confirmed (see Section 4.1.2), an endpoint MAY 1527 initiate a key update. 1529 The Key Phase bit indicates which packet protection keys are used to 1530 protect the packet. The Key Phase bit is initially set to 0 for the 1531 first set of 1-RTT packets and toggled to signal each subsequent key 1532 update. 1534 The Key Phase bit allows a recipient to detect a change in keying 1535 material without needing to receive the first packet that triggered 1536 the change. An endpoint that notices a changed Key Phase bit updates 1537 keys and decrypts the packet that contains the changed value. 1539 This mechanism replaces the TLS KeyUpdate message. Endpoints MUST 1540 NOT send a TLS KeyUpdate message. Endpoints MUST treat the receipt 1541 of a TLS KeyUpdate message as a connection error of type 0x10a, 1542 equivalent to a fatal TLS alert of unexpected_message (see 1543 Section 4.8). 1545 Figure 9 shows a key update process, where the initial set of keys 1546 used (identified with @M) are replaced by updated keys (identified 1547 with @N). The value of the Key Phase bit is indicated in brackets 1548 []. 1550 Initiating Peer Responding Peer 1552 @M [0] QUIC Packets 1554 ... Update to @N 1555 @N [1] QUIC Packets 1556 --------> 1557 Update to @N ... 1558 QUIC Packets [1] @N 1559 <-------- 1560 QUIC Packets [1] @N 1561 containing ACK 1562 <-------- 1563 ... Key Update Permitted 1565 @N [1] QUIC Packets 1566 containing ACK for @N packets 1567 --------> 1568 Key Update Permitted ... 1570 Figure 9: Key Update 1572 6.1. Initiating a Key Update 1574 Endpoints maintain separate read and write secrets for packet 1575 protection. An endpoint initiates a key update by updating its 1576 packet protection write secret and using that to protect new packets. 1577 The endpoint creates a new write secret from the existing write 1578 secret as performed in Section 7.2 of [TLS13]. This uses the KDF 1579 function provided by TLS with a label of "quic ku". The 1580 corresponding key and IV are created from that secret as defined in 1581 Section 5.1. The header protection key is not updated. 1583 For example, to update write keys with TLS 1.3, HKDF-Expand-Label is 1584 used as: 1586 secret_ = HKDF-Expand-Label(secret_, "quic ku", 1587 "", Hash.length) 1589 The endpoint toggles the value of the Key Phase bit and uses the 1590 updated key and IV to protect all subsequent packets. 1592 An endpoint MUST NOT initiate a key update prior to having confirmed 1593 the handshake (Section 4.1.2). An endpoint MUST NOT initiate a 1594 subsequent key update unless it has received an acknowledgment for a 1595 packet that was sent protected with keys from the current key phase. 1596 This ensures that keys are available to both peers before another key 1597 update can be initiated. This can be implemented by tracking the 1598 lowest packet number sent with each key phase, and the highest 1599 acknowledged packet number in the 1-RTT space: once the latter is 1600 higher than or equal to the former, another key update can be 1601 initiated. 1603 Note: Keys of packets other than the 1-RTT packets are never 1604 updated; their keys are derived solely from the TLS handshake 1605 state. 1607 The endpoint that initiates a key update also updates the keys that 1608 it uses for receiving packets. These keys will be needed to process 1609 packets the peer sends after updating. 1611 An endpoint MUST retain old keys until it has successfully 1612 unprotected a packet sent using the new keys. An endpoint SHOULD 1613 retain old keys for some time after unprotecting a packet sent using 1614 the new keys. Discarding old keys too early can cause delayed 1615 packets to be discarded. Discarding packets will be interpreted as 1616 packet loss by the peer and could adversely affect performance. 1618 6.2. Responding to a Key Update 1620 A peer is permitted to initiate a key update after receiving an 1621 acknowledgement of a packet in the current key phase. An endpoint 1622 detects a key update when processing a packet with a key phase that 1623 differs from the value used to protect the last packet it sent. To 1624 process this packet, the endpoint uses the next packet protection key 1625 and IV. See Section 6.3 for considerations about generating these 1626 keys. 1628 If a packet is successfully processed using the next key and IV, then 1629 the peer has initiated a key update. The endpoint MUST update its 1630 send keys to the corresponding key phase in response, as described in 1631 Section 6.1. Sending keys MUST be updated before sending an 1632 acknowledgement for the packet that was received with updated keys. 1633 By acknowledging the packet that triggered the key update in a packet 1634 protected with the updated keys, the endpoint signals that the key 1635 update is complete. 1637 An endpoint can defer sending the packet or acknowledgement according 1638 to its normal packet sending behaviour; it is not necessary to 1639 immediately generate a packet in response to a key update. The next 1640 packet sent by the endpoint will use the updated keys. The next 1641 packet that contains an acknowledgement will cause the key update to 1642 be completed. If an endpoint detects a second update before it has 1643 sent any packets with updated keys containing an acknowledgement for 1644 the packet that initiated the key update, it indicates that its peer 1645 has updated keys twice without awaiting confirmation. An endpoint 1646 MAY treat consecutive key updates as a connection error of type 1647 KEY_UPDATE_ERROR. 1649 An endpoint that receives an acknowledgement that is carried in a 1650 packet protected with old keys where any acknowledged packet was 1651 protected with newer keys MAY treat that as a connection error of 1652 type KEY_UPDATE_ERROR. This indicates that a peer has received and 1653 acknowledged a packet that initiates a key update, but has not 1654 updated keys in response. 1656 6.3. Timing of Receive Key Generation 1658 Endpoints responding to an apparent key update MUST NOT generate a 1659 timing side-channel signal that might indicate that the Key Phase bit 1660 was invalid (see Section 9.4). Endpoints can use dummy packet 1661 protection keys in place of discarded keys when key updates are not 1662 yet permitted. Using dummy keys will generate no variation in the 1663 timing signal produced by attempting to remove packet protection, and 1664 results in all packets with an invalid Key Phase bit being rejected. 1666 The process of creating new packet protection keys for receiving 1667 packets could reveal that a key update has occurred. An endpoint MAY 1668 perform this process as part of packet processing, but this creates a 1669 timing signal that can be used by an attacker to learn when key 1670 updates happen and thus the value of the Key Phase bit in certain 1671 packets. Endpoints MAY instead defer the creation of the next set of 1672 receive packet protection keys until some time after a key update 1673 completes, up to three times the PTO; see Section 6.5. 1675 Once generated, the next set of packet protection keys SHOULD be 1676 retained, even if the packet that was received was subsequently 1677 discarded. Packets containing apparent key updates are easy to forge 1678 and - while the process of key update does not require significant 1679 effort - triggering this process could be used by an attacker for 1680 DoS. 1682 For this reason, endpoints MUST be able to retain two sets of packet 1683 protection keys for receiving packets: the current and the next. 1684 Retaining the previous keys in addition to these might improve 1685 performance, but this is not essential. 1687 6.4. Sending with Updated Keys 1689 An endpoint always sends packets that are protected with the newest 1690 keys. Keys used for packet protection can be discarded immediately 1691 after switching to newer keys. 1693 Packets with higher packet numbers MUST be protected with either the 1694 same or newer packet protection keys than packets with lower packet 1695 numbers. An endpoint that successfully removes protection with old 1696 keys when newer keys were used for packets with lower packet numbers 1697 MUST treat this as a connection error of type KEY_UPDATE_ERROR. 1699 6.5. Receiving with Different Keys 1701 For receiving packets during a key update, packets protected with 1702 older keys might arrive if they were delayed by the network. 1703 Retaining old packet protection keys allows these packets to be 1704 successfully processed. 1706 As packets protected with keys from the next key phase use the same 1707 Key Phase value as those protected with keys from the previous key 1708 phase, it can be necessary to distinguish between the two. This can 1709 be done using packet numbers. A recovered packet number that is 1710 lower than any packet number from the current key phase uses the 1711 previous packet protection keys; a recovered packet number that is 1712 higher than any packet number from the current key phase requires the 1713 use of the next packet protection keys. 1715 Some care is necessary to ensure that any process for selecting 1716 between previous, current, and next packet protection keys does not 1717 expose a timing side channel that might reveal which keys were used 1718 to remove packet protection. See Section 9.5 for more information. 1720 Alternatively, endpoints can retain only two sets of packet 1721 protection keys, swapping previous for next after enough time has 1722 passed to allow for reordering in the network. In this case, the Key 1723 Phase bit alone can be used to select keys. 1725 An endpoint MAY allow a period of approximately the Probe Timeout 1726 (PTO; see [QUIC-RECOVERY]) after receiving a packet that uses the new 1727 key generation before it creates the next set of packet protection 1728 keys. These updated keys MAY replace the previous keys at that time. 1729 With the caveat that PTO is a subjective measure - that is, a peer 1730 could have a different view of the RTT - this time is expected to be 1731 long enough that any reordered packets would be declared lost by a 1732 peer even if they were acknowledged and short enough to allow for 1733 subsequent key updates. 1735 Endpoints need to allow for the possibility that a peer might not be 1736 able to decrypt packets that initiate a key update during the period 1737 when it retains old keys. Endpoints SHOULD wait three times the PTO 1738 before initiating a key update after receiving an acknowledgment that 1739 confirms that the previous key update was received. Failing to allow 1740 sufficient time could lead to packets being discarded. 1742 An endpoint SHOULD retain old read keys for no more than three times 1743 the PTO after having received a packet protected using the new keys. 1744 After this period, old read keys and their corresponding secrets 1745 SHOULD be discarded. 1747 6.6. Limits on AEAD Usage 1749 This document sets usage limits for AEAD algorithms to ensure that 1750 overuse does not give an adversary a disproportionate advantage in 1751 attacking the confidentiality and integrity of communications when 1752 using QUIC. 1754 The usage limits defined in TLS 1.3 exist for protection against 1755 attacks on confidentiality and apply to successful applications of 1756 AEAD protection. The integrity protections in authenticated 1757 encryption also depend on limiting the number of attempts to forge 1758 packets. TLS achieves this by closing connections after any record 1759 fails an authentication check. In comparison, QUIC ignores any 1760 packet that cannot be authenticated, allowing multiple forgery 1761 attempts. 1763 QUIC accounts for AEAD confidentiality and integrity limits 1764 separately. The confidentiality limit applies to the number of 1765 packets encrypted with a given key. The integrity limit applies to 1766 the number of packets decrypted within a given connection. Details 1767 on enforcing these limits for each AEAD algorithm follow below. 1769 Endpoints MUST count the number of encrypted packets for each set of 1770 keys. If the total number of encrypted packets with the same key 1771 exceeds the confidentiality limit for the selected AEAD, the endpoint 1772 MUST stop using those keys. Endpoints MUST initiate a key update 1773 before sending more protected packets than the confidentiality limit 1774 for the selected AEAD permits. If a key update is not possible or 1775 integrity limits are reached, the endpoint MUST stop using the 1776 connection and only send stateless resets in response to receiving 1777 packets. It is RECOMMENDED that endpoints immediately close the 1778 connection with a connection error of type AEAD_LIMIT_REACHED before 1779 reaching a state where key updates are not possible. 1781 For AEAD_AES_128_GCM and AEAD_AES_256_GCM, the confidentiality limit 1782 is 2^25 encrypted packets; see Appendix B.1. For 1783 AEAD_CHACHA20_POLY1305, the confidentiality limit is greater than the 1784 number of possible packets (2^62) and so can be disregarded. For 1785 AEAD_AES_128_CCM, the confidentiality limit is 2^23.5 encrypted 1786 packets; see Appendix B.2. Applying a limit reduces the probability 1787 that an attacker can distinguish the AEAD in use from a random 1788 permutation; see [AEBounds], [ROBUST], and [GCM-MU]. 1790 In addition to counting packets sent, endpoints MUST count the number 1791 of received packets that fail authentication during the lifetime of a 1792 connection. If the total number of received packets that fail 1793 authentication within the connection, across all keys, exceeds the 1794 integrity limit for the selected AEAD, the endpoint MUST immediately 1795 close the connection with a connection error of type 1796 AEAD_LIMIT_REACHED and not process any more packets. 1798 For AEAD_AES_128_GCM and AEAD_AES_256_GCM, the integrity limit is 1799 2^54 invalid packets; see Appendix B.1. For AEAD_CHACHA20_POLY1305, 1800 the integrity limit is 2^36 invalid packets; see [AEBounds]. For 1801 AEAD_AES_128_CCM, the integrity limit is 2^23.5 invalid packets; see 1802 Appendix B.2. Applying this limit reduces the probability that an 1803 attacker can successfully forge a packet; see [AEBounds], [ROBUST], 1804 and [GCM-MU]. 1806 Future analyses and specifications MAY relax confidentiality or 1807 integrity limits for an AEAD. 1809 Note: These limits were originally calculated using assumptions 1810 about the limits on TLS record size. The maximum size of a TLS 1811 record is 2^14 bytes. In comparison, QUIC packets can be up to 1812 2^16 bytes. However, it is expected that QUIC packets will 1813 generally be smaller than TLS records. Where packets might be 1814 larger than 2^14 bytes in length, smaller limits might be needed. 1816 Any TLS cipher suite that is specified for use with QUIC MUST define 1817 limits on the use of the associated AEAD function that preserves 1818 margins for confidentiality and integrity. That is, limits MUST be 1819 specified for the number of packets that can be authenticated and for 1820 the number of packets that can fail authentication. Providing a 1821 reference to any analysis upon which values are based - and any 1822 assumptions used in that analysis - allows limits to be adapted to 1823 varying usage conditions. 1825 6.7. Key Update Error Code 1827 The KEY_UPDATE_ERROR error code (0xe) is used to signal errors 1828 related to key updates. 1830 7. Security of Initial Messages 1832 Initial packets are not protected with a secret key, so they are 1833 subject to potential tampering by an attacker. QUIC provides 1834 protection against attackers that cannot read packets, but does not 1835 attempt to provide additional protection against attacks where the 1836 attacker can observe and inject packets. Some forms of tampering - 1837 such as modifying the TLS messages themselves - are detectable, but 1838 some - such as modifying ACKs - are not. 1840 For example, an attacker could inject a packet containing an ACK 1841 frame that makes it appear that a packet had not been received or to 1842 create a false impression of the state of the connection (e.g., by 1843 modifying the ACK Delay). Note that such a packet could cause a 1844 legitimate packet to be dropped as a duplicate. Implementations 1845 SHOULD use caution in relying on any data that is contained in 1846 Initial packets that is not otherwise authenticated. 1848 It is also possible for the attacker to tamper with data that is 1849 carried in Handshake packets, but because that tampering requires 1850 modifying TLS handshake messages, that tampering will cause the TLS 1851 handshake to fail. 1853 8. QUIC-Specific Adjustments to the TLS Handshake 1855 Certain aspects of the TLS handshake are different when used with 1856 QUIC. 1858 QUIC also requires additional features from TLS. In addition to 1859 negotiation of cryptographic parameters, the TLS handshake carries 1860 and authenticates values for QUIC transport parameters. 1862 8.1. Protocol Negotiation 1864 QUIC requires that the cryptographic handshake provide authenticated 1865 protocol negotiation. TLS uses Application Layer Protocol 1866 Negotiation ([ALPN]) to select an application protocol. Unless 1867 another mechanism is used for agreeing on an application protocol, 1868 endpoints MUST use ALPN for this purpose. 1870 When using ALPN, endpoints MUST immediately close a connection (see 1871 Section 10.2 of [QUIC-TRANSPORT]) with a no_application_protocol TLS 1872 alert (QUIC error code 0x178; see Section 4.8) if an application 1873 protocol is not negotiated. While [ALPN] only specifies that servers 1874 use this alert, QUIC clients MUST use error 0x178 to terminate a 1875 connection when ALPN negotiation fails. 1877 An application protocol MAY restrict the QUIC versions that it can 1878 operate over. Servers MUST select an application protocol compatible 1879 with the QUIC version that the client has selected. The server MUST 1880 treat the inability to select a compatible application protocol as a 1881 connection error of type 0x178 (no_application_protocol). Similarly, 1882 a client MUST treat the selection of an incompatible application 1883 protocol by a server as a connection error of type 0x178. 1885 8.2. QUIC Transport Parameters Extension 1887 QUIC transport parameters are carried in a TLS extension. Different 1888 versions of QUIC might define a different method for negotiating 1889 transport configuration. 1891 Including transport parameters in the TLS handshake provides 1892 integrity protection for these values. 1894 enum { 1895 quic_transport_parameters(0xffa5), (65535) 1896 } ExtensionType; 1898 The extension_data field of the quic_transport_parameters extension 1899 contains a value that is defined by the version of QUIC that is in 1900 use. 1902 The quic_transport_parameters extension is carried in the ClientHello 1903 and the EncryptedExtensions messages during the handshake. Endpoints 1904 MUST send the quic_transport_parameters extension; endpoints that 1905 receive ClientHello or EncryptedExtensions messages without the 1906 quic_transport_parameters extension MUST close the connection with an 1907 error of type 0x16d (equivalent to a fatal TLS missing_extension 1908 alert, see Section 4.8). 1910 While the transport parameters are technically available prior to the 1911 completion of the handshake, they cannot be fully trusted until the 1912 handshake completes, and reliance on them should be minimized. 1913 However, any tampering with the parameters will cause the handshake 1914 to fail. 1916 Endpoints MUST NOT send this extension in a TLS connection that does 1917 not use QUIC (such as the use of TLS with TCP defined in [TLS13]). A 1918 fatal unsupported_extension alert MUST be sent by an implementation 1919 that supports this extension if the extension is received when the 1920 transport is not QUIC. 1922 8.3. Removing the EndOfEarlyData Message 1924 The TLS EndOfEarlyData message is not used with QUIC. QUIC does not 1925 rely on this message to mark the end of 0-RTT data or to signal the 1926 change to Handshake keys. 1928 Clients MUST NOT send the EndOfEarlyData message. A server MUST 1929 treat receipt of a CRYPTO frame in a 0-RTT packet as a connection 1930 error of type PROTOCOL_VIOLATION. 1932 As a result, EndOfEarlyData does not appear in the TLS handshake 1933 transcript. 1935 8.4. Prohibit TLS Middlebox Compatibility Mode 1937 Appendix D.4 of [TLS13] describes an alteration to the TLS 1.3 1938 handshake as a workaround for bugs in some middleboxes. The TLS 1.3 1939 middlebox compatibility mode involves setting the legacy_session_id 1940 field to a 32-byte value in the ClientHello and ServerHello, then 1941 sending a change_cipher_spec record. Both field and record carry no 1942 semantic content and are ignored. 1944 This mode has no use in QUIC as it only applies to middleboxes that 1945 interfere with TLS over TCP. QUIC also provides no means to carry a 1946 change_cipher_spec record. A client MUST NOT request the use of the 1947 TLS 1.3 compatibility mode. A server SHOULD treat the receipt of a 1948 TLS ClientHello with a non-empty legacy_session_id field as a 1949 connection error of type PROTOCOL_VIOLATION. 1951 9. Security Considerations 1953 All of the security considerations that apply to TLS also apply to 1954 the use of TLS in QUIC. Reading all of [TLS13] and its appendices is 1955 the best way to gain an understanding of the security properties of 1956 QUIC. 1958 This section summarizes some of the more important security aspects 1959 specific to the TLS integration, though there are many security- 1960 relevant details in the remainder of the document. 1962 9.1. Session Linkability 1964 Use of TLS session tickets allows servers and possibly other entities 1965 to correlate connections made by the same client; see Section 4.5 for 1966 details. 1968 9.2. Replay Attacks with 0-RTT 1970 As described in Section 8 of [TLS13], use of TLS early data comes 1971 with an exposure to replay attack. The use of 0-RTT in QUIC is 1972 similarly vulnerable to replay attack. 1974 Endpoints MUST implement and use the replay protections described in 1975 [TLS13], however it is recognized that these protections are 1976 imperfect. Therefore, additional consideration of the risk of replay 1977 is needed. 1979 QUIC is not vulnerable to replay attack, except via the application 1980 protocol information it might carry. The management of QUIC protocol 1981 state based on the frame types defined in [QUIC-TRANSPORT] is not 1982 vulnerable to replay. Processing of QUIC frames is idempotent and 1983 cannot result in invalid connection states if frames are replayed, 1984 reordered or lost. QUIC connections do not produce effects that last 1985 beyond the lifetime of the connection, except for those produced by 1986 the application protocol that QUIC serves. 1988 Note: TLS session tickets and address validation tokens are used to 1989 carry QUIC configuration information between connections. 1990 Specifically, to enable a server to efficiently recover state that 1991 is used in connection establishment and address validation. These 1992 MUST NOT be used to communicate application semantics between 1993 endpoints; clients MUST treat them as opaque values. The 1994 potential for reuse of these tokens means that they require 1995 stronger protections against replay. 1997 A server that accepts 0-RTT on a connection incurs a higher cost than 1998 accepting a connection without 0-RTT. This includes higher 1999 processing and computation costs. Servers need to consider the 2000 probability of replay and all associated costs when accepting 0-RTT. 2002 Ultimately, the responsibility for managing the risks of replay 2003 attacks with 0-RTT lies with an application protocol. An application 2004 protocol that uses QUIC MUST describe how the protocol uses 0-RTT and 2005 the measures that are employed to protect against replay attack. An 2006 analysis of replay risk needs to consider all QUIC protocol features 2007 that carry application semantics. 2009 Disabling 0-RTT entirely is the most effective defense against replay 2010 attack. 2012 QUIC extensions MUST describe how replay attacks affect their 2013 operation, or prohibit their use in 0-RTT. Application protocols 2014 MUST either prohibit the use of extensions that carry application 2015 semantics in 0-RTT or provide replay mitigation strategies. 2017 9.3. Packet Reflection Attack Mitigation 2019 A small ClientHello that results in a large block of handshake 2020 messages from a server can be used in packet reflection attacks to 2021 amplify the traffic generated by an attacker. 2023 QUIC includes three defenses against this attack. First, the packet 2024 containing a ClientHello MUST be padded to a minimum size. Second, 2025 if responding to an unverified source address, the server is 2026 forbidden to send more than three times as many bytes as the number 2027 of bytes it has received (see Section 8.1 of [QUIC-TRANSPORT]). 2028 Finally, because acknowledgements of Handshake packets are 2029 authenticated, a blind attacker cannot forge them. Put together, 2030 these defenses limit the level of amplification. 2032 9.4. Header Protection Analysis 2034 [NAN] analyzes authenticated encryption algorithms that provide nonce 2035 privacy, referred to as "Hide Nonce" (HN) transforms. The general 2036 header protection construction in this document is one of those 2037 algorithms (HN1). Header protection uses the output of the packet 2038 protection AEAD to derive "sample", and then encrypts the header 2039 field using a pseudorandom function (PRF) as follows: 2041 protected_field = field XOR PRF(hp_key, sample) 2043 The header protection variants in this document use a pseudorandom 2044 permutation (PRP) in place of a generic PRF. However, since all PRPs 2045 are also PRFs [IMC], these variants do not deviate from the HN1 2046 construction. 2048 As "hp_key" is distinct from the packet protection key, it follows 2049 that header protection achieves AE2 security as defined in [NAN] and 2050 therefore guarantees privacy of "field", the protected packet header. 2051 Future header protection variants based on this construction MUST use 2052 a PRF to ensure equivalent security guarantees. 2054 Use of the same key and ciphertext sample more than once risks 2055 compromising header protection. Protecting two different headers 2056 with the same key and ciphertext sample reveals the exclusive OR of 2057 the protected fields. Assuming that the AEAD acts as a PRF, if L 2058 bits are sampled, the odds of two ciphertext samples being identical 2059 approach 2^(-L/2), that is, the birthday bound. For the algorithms 2060 described in this document, that probability is one in 2^64. 2062 To prevent an attacker from modifying packet headers, the header is 2063 transitively authenticated using packet protection; the entire packet 2064 header is part of the authenticated additional data. Protected 2065 fields that are falsified or modified can only be detected once the 2066 packet protection is removed. 2068 9.5. Header Protection Timing Side-Channels 2070 An attacker could guess values for packet numbers or Key Phase and 2071 have an endpoint confirm guesses through timing side channels. 2072 Similarly, guesses for the packet number length can be tried and 2073 exposed. If the recipient of a packet discards packets with 2074 duplicate packet numbers without attempting to remove packet 2075 protection they could reveal through timing side-channels that the 2076 packet number matches a received packet. For authentication to be 2077 free from side-channels, the entire process of header protection 2078 removal, packet number recovery, and packet protection removal MUST 2079 be applied together without timing and other side-channels. 2081 For the sending of packets, construction and protection of packet 2082 payloads and packet numbers MUST be free from side-channels that 2083 would reveal the packet number or its encoded size. 2085 During a key update, the time taken to generate new keys could reveal 2086 through timing side-channels that a key update has occurred. 2087 Alternatively, where an attacker injects packets this side-channel 2088 could reveal the value of the Key Phase on injected packets. After 2089 receiving a key update, an endpoint SHOULD generate and save the next 2090 set of receive packet protection keys, as described in Section 6.3. 2091 By generating new keys before a key update is received, receipt of 2092 packets will not create timing signals that leak the value of the Key 2093 Phase. 2095 This depends on not doing this key generation during packet 2096 processing and it can require that endpoints maintain three sets of 2097 packet protection keys for receiving: for the previous key phase, for 2098 the current key phase, and for the next key phase. Endpoints can 2099 instead choose to defer generation of the next receive packet 2100 protection keys until they discard old keys so that only two sets of 2101 receive keys need to be retained at any point in time. 2103 9.6. Key Diversity 2105 In using TLS, the central key schedule of TLS is used. As a result 2106 of the TLS handshake messages being integrated into the calculation 2107 of secrets, the inclusion of the QUIC transport parameters extension 2108 ensures that handshake and 1-RTT keys are not the same as those that 2109 might be produced by a server running TLS over TCP. To avoid the 2110 possibility of cross-protocol key synchronization, additional 2111 measures are provided to improve key separation. 2113 The QUIC packet protection keys and IVs are derived using a different 2114 label than the equivalent keys in TLS. 2116 To preserve this separation, a new version of QUIC SHOULD define new 2117 labels for key derivation for packet protection key and IV, plus the 2118 header protection keys. This version of QUIC uses the string "quic". 2119 Other versions can use a version-specific label in place of that 2120 string. 2122 The initial secrets use a key that is specific to the negotiated QUIC 2123 version. New QUIC versions SHOULD define a new salt value used in 2124 calculating initial secrets. 2126 10. IANA Considerations 2128 This document does not create any new IANA registries, but it 2129 registers the values in the following registries: 2131 * TLS ExtensionType Values Registry [TLS-REGISTRIES] - IANA is to 2132 register the quic_transport_parameters extension found in 2133 Section 8.2. The Recommended column is to be marked Yes. The TLS 2134 1.3 Column is to include CH and EE. 2136 * QUIC Transport Error Codes Registry [QUIC-TRANSPORT] - IANA is to 2137 register the KEY_UPDATE_ERROR (0xe), as described in Section 6.7. 2139 11. References 2141 11.1. Normative References 2143 [AEAD] McGrew, D., "An Interface and Algorithms for Authenticated 2144 Encryption", RFC 5116, DOI 10.17487/RFC5116, January 2008, 2145 . 2147 [AES] "Advanced encryption standard (AES)", 2148 DOI 10.6028/nist.fips.197, National Institute of Standards 2149 and Technology report, November 2001, 2150 . 2152 [ALPN] Friedl, S., Popov, A., Langley, A., and E. Stephan, 2153 "Transport Layer Security (TLS) Application-Layer Protocol 2154 Negotiation Extension", RFC 7301, DOI 10.17487/RFC7301, 2155 July 2014, . 2157 [CHACHA] Nir, Y. and A. Langley, "ChaCha20 and Poly1305 for IETF 2158 Protocols", RFC 8439, DOI 10.17487/RFC8439, June 2018, 2159 . 2161 [HKDF] Krawczyk, H. and P. Eronen, "HMAC-based Extract-and-Expand 2162 Key Derivation Function (HKDF)", RFC 5869, 2163 DOI 10.17487/RFC5869, May 2010, 2164 . 2166 [QUIC-RECOVERY] 2167 Iyengar, J., Ed. and I. Swett, Ed., "QUIC Loss Detection 2168 and Congestion Control", Work in Progress, Internet-Draft, 2169 draft-ietf-quic-recovery-30, September 10, 2020, 2170 . 2172 [QUIC-TRANSPORT] 2173 Iyengar, J., Ed. and M. Thomson, Ed., "QUIC: A UDP-Based 2174 Multiplexed and Secure Transport", Work in Progress, 2175 Internet-Draft, draft-ietf-quic-transport-30, September 2176 10, 2020, . 2179 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 2180 Requirement Levels", BCP 14, RFC 2119, 2181 DOI 10.17487/RFC2119, March 1997, 2182 . 2184 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2185 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 2186 May 2017, . 2188 [SHA] Dang, Q., "Secure Hash Standard", 2189 DOI 10.6028/nist.fips.180-4, National Institute of 2190 Standards and Technology report, July 2015, 2191 . 2193 [TLS-REGISTRIES] 2194 Salowey, J. and S. Turner, "IANA Registry Updates for TLS 2195 and DTLS", RFC 8447, DOI 10.17487/RFC8447, August 2018, 2196 . 2198 [TLS13] Rescorla, E., "The Transport Layer Security (TLS) Protocol 2199 Version 1.3", RFC 8446, DOI 10.17487/RFC8446, August 2018, 2200 . 2202 11.2. Informative References 2204 [AEBounds] Luykx, A. and K. Paterson, "Limits on Authenticated 2205 Encryption Use in TLS", March 8, 2016, 2206 . 2208 [CCM-ANALYSIS] 2209 Jonsson, J., "On the Security of CTR + CBC-MAC", 2210 DOI 10.1007/3-540-36492-7_7, Selected Areas in 2211 Cryptography pp. 76-93, 2003, 2212 . 2214 [COMPRESS] Ghedini, A. and V. Vasiliev, "TLS Certificate 2215 Compression", Work in Progress, Internet-Draft, draft- 2216 ietf-tls-certificate-compression-10, January 6, 2020, 2217 . 2220 [GCM-MU] Hoang, V., Tessaro, S., and A. Thiruvengadam, "The Multi- 2221 user Security of GCM, Revisited", 2222 DOI 10.1145/3243734.3243816, Proceedings of the 2018 ACM 2223 SIGSAC Conference on Computer and Communications Security, 2224 January 2018, . 2226 [HTTP2-TLS13] 2227 Benjamin, D., "Using TLS 1.3 with HTTP/2", RFC 8740, 2228 DOI 10.17487/RFC8740, February 2020, 2229 . 2231 [IMC] Katz, J. and Y. Lindell, "Introduction to Modern 2232 Cryptography, Second Edition", ISBN 978-1466570269, 2233 November 6, 2014. 2235 [NAN] Bellare, M., Ng, R., and B. Tackmann, "Nonces Are Noticed: 2236 AEAD Revisited", DOI 10.1007/978-3-030-26948-7_9, Advances 2237 in Cryptology - CRYPTO 2019 pp. 235-265, 2019, 2238 . 2240 [QUIC-HTTP] 2241 Bishop, M., Ed., "Hypertext Transfer Protocol Version 3 2242 (HTTP/3)", Work in Progress, Internet-Draft, draft-ietf- 2243 quic-http-30, September 10, 2020, 2244 . 2246 [RFC2818] Rescorla, E., "HTTP Over TLS", RFC 2818, 2247 DOI 10.17487/RFC2818, May 2000, 2248 . 2250 [RFC5280] Cooper, D., Santesson, S., Farrell, S., Boeyen, S., 2251 Housley, R., and W. Polk, "Internet X.509 Public Key 2252 Infrastructure Certificate and Certificate Revocation List 2253 (CRL) Profile", RFC 5280, DOI 10.17487/RFC5280, May 2008, 2254 . 2256 [ROBUST] Fischlin, M., Günther, F., and C. Janson, "Robust 2257 Channels: Handling Unreliable Networks in the Record 2258 Layers of QUIC and DTLS 1.3", May 16, 2020, 2259 . 2261 Appendix A. Sample Packet Protection 2263 This section shows examples of packet protection so that 2264 implementations can be verified incrementally. Samples of Initial 2265 packets from both client and server, plus a Retry packet are defined. 2266 These packets use an 8-byte client-chosen Destination Connection ID 2267 of 0x8394c8f03e515708. Some intermediate values are included. All 2268 values are shown in hexadecimal. 2270 A.1. Keys 2272 The labels generated by the HKDF-Expand-Label function are: 2274 client in: 00200f746c73313320636c69656e7420696e00 2276 server in: 00200f746c7331332073657276657220696e00 2278 quic key: 00100e746c7331332071756963206b657900 2280 quic iv: 000c0d746c733133207175696320697600 2282 quic hp: 00100d746c733133207175696320687000 2283 The initial secret is common: 2285 initial_secret = HKDF-Extract(initial_salt, cid) 2286 = 1e7e7764529715b1e0ddc8e9753c6157 2287 6769605187793ed366f8bbf8c9e986eb 2289 The secrets for protecting client packets are: 2291 client_initial_secret 2292 = HKDF-Expand-Label(initial_secret, "client in", _, 32) 2293 = 0088119288f1d866733ceeed15ff9d50 2294 902cf82952eee27e9d4d4918ea371d87 2296 key = HKDF-Expand-Label(client_initial_secret, "quic key", _, 16) 2297 = 175257a31eb09dea9366d8bb79ad80ba 2299 iv = HKDF-Expand-Label(client_initial_secret, "quic iv", _, 12) 2300 = 6b26114b9cba2b63a9e8dd4f 2302 hp = HKDF-Expand-Label(client_initial_secret, "quic hp", _, 16) 2303 = 9ddd12c994c0698b89374a9c077a3077 2305 The secrets for protecting server packets are: 2307 server_initial_secret 2308 = HKDF-Expand-Label(initial_secret, "server in", _, 32) 2309 = 006f881359244dd9ad1acf85f595bad6 2310 7c13f9f5586f5e64e1acae1d9ea8f616 2312 key = HKDF-Expand-Label(server_initial_secret, "quic key", _, 16) 2313 = 149d0b1662ab871fbe63c49b5e655a5d 2315 iv = HKDF-Expand-Label(server_initial_secret, "quic iv", _, 12) 2316 = bab2b12a4c76016ace47856d 2318 hp = HKDF-Expand-Label(server_initial_secret, "quic hp", _, 16) 2319 = c0c499a65a60024a18a250974ea01dfa 2321 A.2. Client Initial 2323 The client sends an Initial packet. The unprotected payload of this 2324 packet contains the following CRYPTO frame, plus enough PADDING 2325 frames to make a 1162 byte payload: 2327 060040f1010000ed0303ebf8fa56f129 39b9584a3896472ec40bb863cfd3e868 2328 04fe3a47f06a2b69484c000004130113 02010000c000000010000e00000b6578 2329 616d706c652e636f6dff01000100000a 00080006001d00170018001000070005 2330 04616c706e0005000501000000000033 00260024001d00209370b2c9caa47fba 2331 baf4559fedba753de171fa71f50f1ce1 5d43e994ec74d748002b000302030400 2332 0d0010000e0403050306030203080408 050806002d00020101001c00024001ff 2333 a500320408ffffffffffffffff050480 00ffff07048000ffff08011001048000 2334 75300901100f088394c8f03e51570806 048000ffff 2336 The unprotected header includes the connection ID and a 4-byte packet 2337 number encoding for a packet number of 2: 2339 c3ff00001d088394c8f03e5157080000449e00000002 2341 Protecting the payload produces output that is sampled for header 2342 protection. Because the header uses a 4-byte packet number encoding, 2343 the first 16 bytes of the protected payload is sampled, then applied 2344 to the header: 2346 sample = fb66bc6a93032b50dd8973972d149421 2348 mask = AES-ECB(hp, sample)[0..4] 2349 = 1e9cdb9909 2351 header[0] ^= mask[0] & 0x0f 2352 = cd 2353 header[18..21] ^= mask[1..4] 2354 = 9cdb990b 2355 header = cdff00001d088394c8f03e5157080000449e9cdb990b 2357 The resulting protected packet is: 2359 cdff00001d088394c8f03e5157080000 449e9cdb990bfb66bc6a93032b50dd89 2360 73972d149421874d3849e3708d71354e a33bcdc356f3ea6e2a1a1bd7c3d14003 2361 8d3e784d04c30a2cdb40c32523aba2da fe1c1bf3d27a6be38fe38ae033fbb071 2362 3c1c73661bb6639795b42b97f77068ea d51f11fbf9489af2501d09481e6c64d4 2363 b8551cd3cea70d830ce2aeeec789ef55 1a7fbe36b3f7e1549a9f8d8e153b3fac 2364 3fb7b7812c9ed7c20b4be190ebd89956 26e7f0fc887925ec6f0606c5d36aa81b 2365 ebb7aacdc4a31bb5f23d55faef5c5190 5783384f375a43235b5c742c78ab1bae 2366 0a188b75efbde6b3774ed61282f9670a 9dea19e1566103ce675ab4e21081fb58 2367 60340a1e88e4f10e39eae25cd685b109 29636d4f02e7fad2a5a458249f5c0298 2368 a6d53acbe41a7fc83fa7cc01973f7a74 d1237a51974e097636b6203997f921d0 2369 7bc1940a6f2d0de9f5a11432946159ed 6cc21df65c4ddd1115f86427259a196c 2370 7148b25b6478b0dc7766e1c4d1b1f515 9f90eabc61636226244642ee148b464c 2371 9e619ee50a5e3ddc836227cad938987c 4ea3c1fa7c75bbf88d89e9ada642b2b8 2372 8fe8107b7ea375b1b64889a4e9e5c38a 1c896ce275a5658d250e2d76e1ed3a34 2373 ce7e3a3f383d0c996d0bed106c2899ca 6fc263ef0455e74bb6ac1640ea7bfedc 2374 59f03fee0e1725ea150ff4d69a7660c5 542119c71de270ae7c3ecfd1af2c4ce5 2375 51986949cc34a66b3e216bfe18b347e6 c05fd050f85912db303a8f054ec23e38 2376 f44d1c725ab641ae929fecc8e3cefa56 19df4231f5b4c009fa0c0bbc60bc75f7 2377 6d06ef154fc8577077d9d6a1d2bd9bf0 81dc783ece60111bea7da9e5a9748069 2378 d078b2bef48de04cabe3755b197d52b3 2046949ecaa310274b4aac0d008b1948 2379 c1082cdfe2083e386d4fd84c0ed0666d 3ee26c4515c4fee73433ac703b690a9f 2380 7bf278a77486ace44c489a0c7ac8dfe4 d1a58fb3a730b993ff0f0d61b4d89557 2381 831eb4c752ffd39c10f6b9f46d8db278 da624fd800e4af85548a294c1518893a 2382 8778c4f6d6d73c93df200960104e062b 388ea97dcf4016bced7f62b4f062cb6c 2383 04c20693d9a0e3b74ba8fe74cc012378 84f40d765ae56a51688d985cf0ceaef4 2384 3045ed8c3f0c33bced08537f6882613a cd3b08d665fce9dd8aa73171e2d3771a 2385 61dba2790e491d413d93d987e2745af2 9418e428be34941485c93447520ffe23 2386 1da2304d6a0fd5d07d08372202369661 59bef3cf904d722324dd852513df39ae 2387 030d8173908da6364786d3c1bfcb19ea 77a63b25f1e7fc661def480c5d00d444 2388 56269ebd84efd8e3a8b2c257eec76060 682848cbf5194bc99e49ee75e4d0d254 2389 bad4bfd74970c30e44b65511d4ad0e6e c7398e08e01307eeeea14e46ccd87cf3 2390 6b285221254d8fc6a6765c524ded0085 dca5bd688ddf722e2c0faf9d0fb2ce7a 2391 0c3f2cee19ca0ffba461ca8dc5d2c817 8b0762cf67135558494d2a96f1a139f0 2392 edb42d2af89a9c9122b07acbc29e5e72 2df8615c343702491098478a389c9872 2393 a10b0c9875125e257c7bfdf27eef4060 bd3d00f4c14fd3e3496c38d3c5d1a566 2394 8c39350effbc2d16ca17be4ce29f02ed 969504dda2a8c6b9ff919e693ee79e09 2395 089316e7d1d89ec099db3b2b268725d8 88536a4b8bf9aee8fb43e82a4d919d48 2396 1802771a449b30f3fa2289852607b660 2398 A.3. Server Initial 2400 The server sends the following payload in response, including an ACK 2401 frame, a CRYPTO frame, and no PADDING frames: 2403 02000000000600405a020000560303ee fce7f7b37ba1d1632e96677825ddf739 2404 88cfc79825df566dc5430b9a045a1200 130100002e00330024001d00209d3c94 2405 0d89690b84d08a60993c144eca684d10 81287c834d5311bcf32bb9da1a002b00 2406 020304 2407 The header from the server includes a new connection ID and a 2-byte 2408 packet number encoding for a packet number of 1: 2410 c1ff00001d0008f067a5502a4262b50040740001 2412 As a result, after protection, the header protection sample is taken 2413 starting from the third protected octet: 2415 sample = 823a5d3a1207c86ee49132824f046524 2416 mask = abaaf34fdc 2417 header = caff00001d0008f067a5502a4262b5004074aaf2 2419 The final protected packet is then: 2421 c7ff00001d0008f067a5502a4262b500 4075fb12ff07823a5d24534d906ce4c7 2422 6782a2167e3479c0f7f6395dc2c91676 302fe6d70bb7cbeb117b4ddb7d173498 2423 44fd61dae200b8338e1b932976b61d91 e64a02e9e0ee72e3a6f63aba4ceeeec5 2424 be2f24f2d86027572943533846caa13e 6f163fb257473dcca25396e88724f1e5 2425 d964dedee9b633 2427 A.4. Retry 2429 This shows a Retry packet that might be sent in response to the 2430 Initial packet in Appendix A.2. The integrity check includes the 2431 client-chosen connection ID value of 0x8394c8f03e515708, but that 2432 value is not included in the final Retry packet: 2434 ffff00001d0008f067a5502a4262b574 6f6b656ed16926d81f6f9ca2953a8aa4 2435 575e1e49 2437 A.5. ChaCha20-Poly1305 Short Header Packet 2439 This example shows some of the steps required to protect a packet 2440 with a short header. This example uses AEAD_CHACHA20_POLY1305. 2442 In this example, TLS produces an application write secret from which 2443 a server uses HKDF-Expand-Label to produce four values: a key, an IV, 2444 a header protection key, and the secret that will be used after keys 2445 are updated (this last value is not used further in this example). 2447 secret 2448 = 9ac312a7f877468ebe69422748ad00a1 2449 5443f18203a07d6060f688f30f21632b 2451 key = HKDF-Expand-Label(secret, "quic key", _, 32) 2452 = c6d98ff3441c3fe1b2182094f69caa2e 2453 d4b716b65488960a7a984979fb23e1c8 2455 iv = HKDF-Expand-Label(secret, "quic iv", _, 12) 2456 = e0459b3474bdd0e44a41c144 2458 hp = HKDF-Expand-Label(secret, "quic hp", _, 32) 2459 = 25a282b9e82f06f21f488917a4fc8f1b 2460 73573685608597d0efcb076b0ab7a7a4 2462 ku = HKDF-Expand-Label(secret, "quic ku", _, 32) 2463 = 1223504755036d556342ee9361d25342 2464 1a826c9ecdf3c7148684b36b714881f9 2466 The following shows the steps involved in protecting a minimal packet 2467 with an empty Destination Connection ID. This packet contains a 2468 single PING frame (that is, a payload of just 0x01) and has a packet 2469 number of 654360564. In this example, using a packet number of 2470 length 3 (that is, 49140 is encoded) avoids having to pad the payload 2471 of the packet; PADDING frames would be needed if the packet number is 2472 encoded on fewer octets. 2474 pn = 654360564 (decimal) 2475 nonce = e0459b3474bdd0e46d417eb0 2476 unprotected header = 4200bff4 2477 payload plaintext = 01 2478 payload ciphertext = 655e5cd55c41f69080575d7999c25a5bfb 2480 The resulting ciphertext is the minimum size possible. One byte is 2481 skipped to produce the sample for header protection. 2483 sample = 5e5cd55c41f69080575d7999c25a5bfb 2484 mask = aefefe7d03 2485 header = 4cfe4189 2487 The protected packet is the smallest possible packet size of 21 2488 bytes. 2490 packet = 4cfe4189655e5cd55c41f69080575d7999c25a5bfb 2492 Appendix B. AEAD Algorithm Analysis 2494 This section documents analyses used in deriving AEAD algorithm 2495 limits for AEAD_AES_128_GCM, AEAD_AES_128_CCM, and AEAD_AES_256_GCM. 2496 The analyses that follow use symbols for multiplication (*), division 2497 (/), and exponentiation (^), plus parentheses for establishing 2498 precedence. The following symbols are also used: 2500 t: The size of the authentication tag in bits. For this cipher, t 2501 is 128. 2503 n: The size of the block function in bits. For this cipher, n is 2504 128. 2506 l: The number of blocks in each packet (see below). 2508 q: The number of genuine packets created and protected by endpoints. 2509 This value is the bound on the number of packets that can be 2510 protected before updating keys. 2512 v: The number of forged packets that endpoints will accept. This 2513 value is the bound on the number of forged packets that an 2514 endpoint can reject before updating keys. 2516 o: The amount of offline ideal cipher queries made by an adversary. 2518 The analyses that follow rely on a count of the number of block 2519 operations involved in producing each message. For simplicity, and 2520 to match the analysis of other AEAD functions in [AEBounds], this 2521 analysis assumes a packet length of 2^10 blocks; that is, a packet 2522 size limit of 2^14 bytes. 2524 For AEAD_AES_128_CCM, the total number of block cipher operations is 2525 the sum of: the length of the associated data in blocks, the length 2526 of the ciphertext in blocks, the length of the plaintext in blocks, 2527 plus 1. In this analysis, this is simplified to a value of twice the 2528 length of the packet in blocks (that is, "2l = 2^11"). This 2529 simplification is based on the packet containing all of the 2530 associated data and ciphertext. This results in a negligible 1 to 3 2531 block overestimation of the number of operations. 2533 B.1. Analysis of AEAD_AES_128_GCM and AEAD_AES_256_GCM Usage Limits 2535 [GCM-MU] specify concrete bounds for AEAD_AES_128_GCM and 2536 AEAD_AES_256_GCM as used in TLS 1.3 and QUIC. This section documents 2537 this analysis using several simplifying assumptions: 2539 * The number of ciphertext blocks an attacker uses in forgery 2540 attempts is bounded by v * l, the number of forgery attempts and 2541 the size of each packet (in blocks). 2543 * The amount of offline work done by an attacker does not dominate 2544 other factors in the analysis. 2546 The bounds in [GCM-MU] are tighter and more complete than those used 2547 in [AEBounds], which allows for larger limits than those described in 2548 [TLS13]. 2550 B.1.1. Confidentiality Limit 2552 For confidentiality, Theorum (4.3) in [GCM-MU] establishes that - for 2553 a single user that does not repeat nonces - the dominant term in 2554 determining the distinguishing advantage between a real and random 2555 AEAD algorithm gained by an attacker is: 2557 2 * (q * l)^2 / 2^128 2559 For a target advantage of 2^-57, this results in the relation: 2561 q <= 2^25 2563 Thus, endpoints cannot protect more than 2^25 packets in a single 2564 connection without causing an attacker to gain an larger advantage 2565 than the target of 2^-57. 2567 B.1.2. Integrity Limit 2569 For integrity, Theorem (4.3) in [GCM-MU] establishes that an attacker 2570 gains an advantage in successfully forging a packet of no more than: 2572 (1 / 2^(8 * n)) + ((2 * v) / 2^(2 * n)) 2573 + ((2 * o * v) / 2^(k + n)) + (n * (v + (v * l)) / 2^k) 2575 The goal is to limit this advantage to 2^-57. For AEAD_AES_128_GCM, 2576 the fourth term in this inequality dominates the rest, so the others 2577 can be removed without significant effect on the result. This 2578 produces the following approximation: 2580 v <= 2^54 2582 For AEAD_AES_256_GCM, the second and fourth terms dominate the rest, 2583 so the others can be removed without affecting the result. This 2584 produces the following approximation: 2586 v <= 2^182 2587 This is substantially larger than the limit for AEAD_AES_128_GCM. 2588 However, this document recommends that the same limit be applied to 2589 both functions as either limit is acceptably large. 2591 B.2. Analysis of AEAD_AES_128_CCM Usage Limits 2593 TLS [TLS13] and [AEBounds] do not specify limits on usage for 2594 AEAD_AES_128_CCM. However, any AEAD that is used with QUIC requires 2595 limits on use that ensure that both confidentiality and integrity are 2596 preserved. This section documents that analysis. 2598 [CCM-ANALYSIS] is used as the basis of this analysis. The results of 2599 that analysis are used to derive usage limits that are based on those 2600 chosen in [TLS13]. 2602 B.2.1. Confidentiality Limits 2604 For confidentiality, Theorem 2 in [CCM-ANALYSIS] establishes that an 2605 attacker gains a distinguishing advantage over an ideal pseudorandom 2606 permutation (PRP) of no more than: 2608 (2l * q)^2 / 2^n 2610 For a target advantage of 2^-57, this results in the relation: 2612 q <= 2^24.5 2614 That is, endpoints cannot protect more than 2^23 packets with the 2615 same set of keys without causing an attacker to gain a larger 2616 advantage than the target of 2^-57. Note however that the integrity 2617 limits further constrain this value. 2619 B.2.2. Integrity Limits 2621 For integrity, Theorem 1 in [CCM-ANALYSIS] establishes that an 2622 attacker gains an advantage over an ideal PRP of no more than: 2624 v / 2^t + (2l * (v + q))^2 / 2^n 2626 The goal is to limit this advantage to 2^-57. As "t" and "n" are 2627 both 128, the first term is negligible relative to the second, so 2628 that term can be removed without a significant effect on the result. 2629 This produces the relation: 2631 v + q <= 2^24.5 2632 Assuming "q = v", endpoints cannot attempt to protect or authenticate 2633 more than 2^23.5 packets with the same set of keys without causing an 2634 attacker to gain a larger advantage in forging packets than the 2635 target of 2^-57. 2637 Appendix C. Change Log 2639 *RFC Editor's Note:* Please remove this section prior to 2640 publication of a final version of this document. 2642 Issue and pull request numbers are listed with a leading octothorp. 2644 C.1. Since draft-ietf-quic-tls-29 2646 * Updated limits on packet protection (#3788, #3789) 2648 * Allow for packet processing to continue while waiting for TLS to 2649 provide keys (#3821, #3874) 2651 C.2. Since draft-ietf-quic-tls-28 2653 * Defined limits on the number of packets that can be protected with 2654 a single key and limits on the number of packets that can fail 2655 authentication (#3619, #3620) 2657 * Update Initial salt, Retry keys, and samples (#3711) 2659 C.3. Since draft-ietf-quic-tls-27 2661 * Allowed CONNECTION_CLOSE in any packet number space, with 2662 restrictions on use of the application-specific variant (#3430, 2663 #3435, #3440) 2665 * Prohibit the use of the compatibility mode from TLS 1.3 (#3594, 2666 #3595) 2668 C.4. Since draft-ietf-quic-tls-26 2670 * No changes 2672 C.5. Since draft-ietf-quic-tls-25 2674 * No changes 2676 C.6. Since draft-ietf-quic-tls-24 2678 * Rewrite key updates (#3050) 2679 - Allow but don't recommend deferring key updates (#2792, #3263) 2681 - More completely define received behavior (#2791) 2683 - Define the label used with HKDF-Expand-Label (#3054) 2685 C.7. Since draft-ietf-quic-tls-23 2687 * Key update text update (#3050): 2689 - Recommend constant-time key replacement (#2792) 2691 - Provide explicit labels for key update key derivation (#3054) 2693 * Allow first Initial from a client to span multiple packets (#2928, 2694 #3045) 2696 * PING can be sent at any encryption level (#3034, #3035) 2698 C.8. Since draft-ietf-quic-tls-22 2700 * Update the salt used for Initial secrets (#2887, #2980) 2702 C.9. Since draft-ietf-quic-tls-21 2704 * No changes 2706 C.10. Since draft-ietf-quic-tls-20 2708 * Mandate the use of the QUIC transport parameters extension (#2528, 2709 #2560) 2711 * Define handshake completion and confirmation; define clearer rules 2712 when it encryption keys should be discarded (#2214, #2267, #2673) 2714 C.11. Since draft-ietf-quic-tls-18 2716 * Increased the set of permissible frames in 0-RTT (#2344, #2355) 2718 * Transport parameter extension is mandatory (#2528, #2560) 2720 C.12. Since draft-ietf-quic-tls-17 2722 * Endpoints discard initial keys as soon as handshake keys are 2723 available (#1951, #2045) 2725 * Use of ALPN or equivalent is mandatory (#2263, #2284) 2727 C.13. Since draft-ietf-quic-tls-14 2729 * Update the salt used for Initial secrets (#1970) 2731 * Clarify that TLS_AES_128_CCM_8_SHA256 isn't supported (#2019) 2733 * Change header protection 2735 - Sample from a fixed offset (#1575, #2030) 2737 - Cover part of the first byte, including the key phase (#1322, 2738 #2006) 2740 * TLS provides an AEAD and KDF function (#2046) 2742 - Clarify that the TLS KDF is used with TLS (#1997) 2744 - Change the labels for calculation of QUIC keys (#1845, #1971, 2745 #1991) 2747 * Initial keys are discarded once Handshake keys are available 2748 (#1951, #2045) 2750 C.14. Since draft-ietf-quic-tls-13 2752 * Updated to TLS 1.3 final (#1660) 2754 C.15. Since draft-ietf-quic-tls-12 2756 * Changes to integration of the TLS handshake (#829, #1018, #1094, 2757 #1165, #1190, #1233, #1242, #1252, #1450) 2759 - The cryptographic handshake uses CRYPTO frames, not stream 0 2761 - QUIC packet protection is used in place of TLS record 2762 protection 2764 - Separate QUIC packet number spaces are used for the handshake 2766 - Changed Retry to be independent of the cryptographic handshake 2768 - Limit the use of HelloRetryRequest to address TLS needs (like 2769 key shares) 2771 * Changed codepoint of TLS extension (#1395, #1402) 2773 C.16. Since draft-ietf-quic-tls-11 2774 * Encrypted packet numbers. 2776 C.17. Since draft-ietf-quic-tls-10 2778 * No significant changes. 2780 C.18. Since draft-ietf-quic-tls-09 2782 * Cleaned up key schedule and updated the salt used for handshake 2783 packet protection (#1077) 2785 C.19. Since draft-ietf-quic-tls-08 2787 * Specify value for max_early_data_size to enable 0-RTT (#942) 2789 * Update key derivation function (#1003, #1004) 2791 C.20. Since draft-ietf-quic-tls-07 2793 * Handshake errors can be reported with CONNECTION_CLOSE (#608, 2794 #891) 2796 C.21. Since draft-ietf-quic-tls-05 2798 No significant changes. 2800 C.22. Since draft-ietf-quic-tls-04 2802 * Update labels used in HKDF-Expand-Label to match TLS 1.3 (#642) 2804 C.23. Since draft-ietf-quic-tls-03 2806 No significant changes. 2808 C.24. Since draft-ietf-quic-tls-02 2810 * Updates to match changes in transport draft 2812 C.25. Since draft-ietf-quic-tls-01 2814 * Use TLS alerts to signal TLS errors (#272, #374) 2816 * Require ClientHello to fit in a single packet (#338) 2818 * The second client handshake flight is now sent in the clear (#262, 2819 #337) 2821 * The QUIC header is included as AEAD Associated Data (#226, #243, 2822 #302) 2824 * Add interface necessary for client address validation (#275) 2826 * Define peer authentication (#140) 2828 * Require at least TLS 1.3 (#138) 2830 * Define transport parameters as a TLS extension (#122) 2832 * Define handling for protected packets before the handshake 2833 completes (#39) 2835 * Decouple QUIC version and ALPN (#12) 2837 C.26. Since draft-ietf-quic-tls-00 2839 * Changed bit used to signal key phase 2841 * Updated key phase markings during the handshake 2843 * Added TLS interface requirements section 2845 * Moved to use of TLS exporters for key derivation 2847 * Moved TLS error code definitions into this document 2849 C.27. Since draft-thomson-quic-tls-01 2851 * Adopted as base for draft-ietf-quic-tls 2853 * Updated authors/editors list 2855 * Added status note 2857 Contributors 2859 The IETF QUIC Working Group received an enormous amount of support 2860 from many people. The following people provided substantive 2861 contributions to this document: 2863 * Adam Langley 2865 * Alessandro Ghedini 2867 * Christian Huitema 2868 * Christopher Wood 2870 * David Schinazi 2872 * Dragana Damjanovic 2874 * Eric Rescorla 2876 * Felix Guenther 2878 * Ian Swett 2880 * Jana Iyengar 2882 * 奥 一穂 (Kazuho Oku) 2884 * Marten Seemann 2886 * Martin Duke 2888 * Mike Bishop 2890 * Mikkel Fahnøe Jørgensen 2892 * Nick Banks 2894 * Nick Harper 2896 * Roberto Peon 2898 * Rui Paulo 2900 * Ryan Hamilton 2902 * Victor Vasiliev 2904 Authors' Addresses 2906 Martin Thomson (editor) 2907 Mozilla 2909 Email: mt@lowentropy.net 2911 Sean Turner (editor) 2912 sn3rd 2914 Email: sean@sn3rd.com