draft-ietf-quic-tls-29.txt   draft-ietf-quic-tls-30.txt 
QUIC M. Thomson, Ed. QUIC M. Thomson, Ed.
Internet-Draft Mozilla Internet-Draft Mozilla
Intended status: Standards Track S. Turner, Ed. Intended status: Standards Track S. Turner, Ed.
Expires: 11 December 2020 sn3rd Expires: March 14, 2021 sn3rd
9 June 2020 September 10, 2020
Using TLS to Secure QUIC Using TLS to Secure QUIC
draft-ietf-quic-tls-29 draft-ietf-quic-tls-30
Abstract Abstract
This document describes how Transport Layer Security (TLS) is used to This document describes how Transport Layer Security (TLS) is used to
secure QUIC. secure QUIC.
Note to Readers Note to Readers
Discussion of this draft takes place on the QUIC working group Discussion of this draft takes place on the QUIC working group
mailing list (quic@ietf.org (mailto:quic@ietf.org)), which is mailing list (quic@ietf.org), which is archived at
archived at https://mailarchive.ietf.org/arch/ https://mailarchive.ietf.org/arch/search/?email_list=quic.
search/?email_list=quic.
Working Group information can be found at https://github.com/quicwg; Working Group information can be found at https://github.com/quicwg;
source code and issues list for this draft can be found at source code and issues list for this draft can be found at
https://github.com/quicwg/base-drafts/labels/-tls. https://github.com/quicwg/base-drafts/labels/-tls.
Status of This Memo Status of This Memo
This Internet-Draft is submitted in full conformance with the This Internet-Draft is submitted in full conformance with the
provisions of BCP 78 and BCP 79. provisions of BCP 78 and BCP 79.
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet- working documents as Internet-Drafts. The list of current Internet-
Drafts is at https://datatracker.ietf.org/drafts/current/. Drafts is at https://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
This Internet-Draft will expire on 11 December 2020. This Internet-Draft will expire on March 14, 2021.
Copyright Notice Copyright Notice
Copyright (c) 2020 IETF Trust and the persons identified as the Copyright (c) 2020 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents (https://trustee.ietf.org/ Provisions Relating to IETF Documents (https://trustee.ietf.org/
license-info) in effect on the date of publication of this document. license-info) in effect on the date of publication of this document.
Please review these documents carefully, as they describe your rights Please review these documents carefully, as they describe your rights
skipping to change at page 2, line 28 skipping to change at page 2, line 28
2.1. TLS Overview . . . . . . . . . . . . . . . . . . . . . . 5 2.1. TLS Overview . . . . . . . . . . . . . . . . . . . . . . 5
3. Protocol Overview . . . . . . . . . . . . . . . . . . . . . . 7 3. Protocol Overview . . . . . . . . . . . . . . . . . . . . . . 7
4. Carrying TLS Messages . . . . . . . . . . . . . . . . . . . . 8 4. Carrying TLS Messages . . . . . . . . . . . . . . . . . . . . 8
4.1. Interface to TLS . . . . . . . . . . . . . . . . . . . . 10 4.1. Interface to TLS . . . . . . . . . . . . . . . . . . . . 10
4.1.1. Handshake Complete . . . . . . . . . . . . . . . . . 10 4.1.1. Handshake Complete . . . . . . . . . . . . . . . . . 10
4.1.2. Handshake Confirmed . . . . . . . . . . . . . . . . . 11 4.1.2. Handshake Confirmed . . . . . . . . . . . . . . . . . 11
4.1.3. Sending and Receiving Handshake Messages . . . . . . 11 4.1.3. Sending and Receiving Handshake Messages . . . . . . 11
4.1.4. Encryption Level Changes . . . . . . . . . . . . . . 13 4.1.4. Encryption Level Changes . . . . . . . . . . . . . . 13
4.1.5. TLS Interface Summary . . . . . . . . . . . . . . . . 14 4.1.5. TLS Interface Summary . . . . . . . . . . . . . . . . 14
4.2. TLS Version . . . . . . . . . . . . . . . . . . . . . . . 15 4.2. TLS Version . . . . . . . . . . . . . . . . . . . . . . . 15
4.3. ClientHello Size . . . . . . . . . . . . . . . . . . . . 15 4.3. ClientHello Size . . . . . . . . . . . . . . . . . . . . 16
4.4. Peer Authentication . . . . . . . . . . . . . . . . . . . 16 4.4. Peer Authentication . . . . . . . . . . . . . . . . . . . 17
4.5. Session Resumption . . . . . . . . . . . . . . . . . . . 17 4.5. Session Resumption . . . . . . . . . . . . . . . . . . . 17
4.6. Enabling 0-RTT . . . . . . . . . . . . . . . . . . . . . 17 4.6. 0-RTT . . . . . . . . . . . . . . . . . . . . . . . . . . 18
4.7. Accepting and Rejecting 0-RTT . . . . . . . . . . . . . . 18 4.6.1. Enabling 0-RTT . . . . . . . . . . . . . . . . . . . 19
4.8. Validating 0-RTT Configuration . . . . . . . . . . . . . 18 4.6.2. Accepting and Rejecting 0-RTT . . . . . . . . . . . . 19
4.9. HelloRetryRequest . . . . . . . . . . . . . . . . . . . . 19 4.6.3. Validating 0-RTT Configuration . . . . . . . . . . . 20
4.10. TLS Errors . . . . . . . . . . . . . . . . . . . . . . . 19 4.7. HelloRetryRequest . . . . . . . . . . . . . . . . . . . . 20
4.11. Discarding Unused Keys . . . . . . . . . . . . . . . . . 19 4.8. TLS Errors . . . . . . . . . . . . . . . . . . . . . . . 20
4.11.1. Discarding Initial Keys . . . . . . . . . . . . . . 20 4.9. Discarding Unused Keys . . . . . . . . . . . . . . . . . 21
4.11.2. Discarding Handshake Keys . . . . . . . . . . . . . 20 4.9.1. Discarding Initial Keys . . . . . . . . . . . . . . . 21
4.11.3. Discarding 0-RTT Keys . . . . . . . . . . . . . . . 20 4.9.2. Discarding Handshake Keys . . . . . . . . . . . . . . 22
5. Packet Protection . . . . . . . . . . . . . . . . . . . . . . 21 4.9.3. Discarding 0-RTT Keys . . . . . . . . . . . . . . . . 22
5.1. Packet Protection Keys . . . . . . . . . . . . . . . . . 21 5. Packet Protection . . . . . . . . . . . . . . . . . . . . . . 22
5.2. Initial Secrets . . . . . . . . . . . . . . . . . . . . . 21 5.1. Packet Protection Keys . . . . . . . . . . . . . . . . . 23
5.3. AEAD Usage . . . . . . . . . . . . . . . . . . . . . . . 23 5.2. Initial Secrets . . . . . . . . . . . . . . . . . . . . . 24
5.4. Header Protection . . . . . . . . . . . . . . . . . . . . 24 5.3. AEAD Usage . . . . . . . . . . . . . . . . . . . . . . . 25
5.4.1. Header Protection Application . . . . . . . . . . . . 24 5.4. Header Protection . . . . . . . . . . . . . . . . . . . . 26
5.4.2. Header Protection Sample . . . . . . . . . . . . . . 26 5.4.1. Header Protection Application . . . . . . . . . . . . 26
5.4.3. AES-Based Header Protection . . . . . . . . . . . . . 28 5.4.2. Header Protection Sample . . . . . . . . . . . . . . 28
5.4.4. ChaCha20-Based Header Protection . . . . . . . . . . 28 5.4.3. AES-Based Header Protection . . . . . . . . . . . . . 30
5.5. Receiving Protected Packets . . . . . . . . . . . . . . . 28 5.4.4. ChaCha20-Based Header Protection . . . . . . . . . . 30
5.6. Use of 0-RTT Keys . . . . . . . . . . . . . . . . . . . . 29 5.5. Receiving Protected Packets . . . . . . . . . . . . . . . 30
5.7. Receiving Out-of-Order Protected Frames . . . . . . . . . 29 5.6. Use of 0-RTT Keys . . . . . . . . . . . . . . . . . . . . 31
5.8. Retry Packet Integrity . . . . . . . . . . . . . . . . . 30 5.7. Receiving Out-of-Order Protected Frames . . . . . . . . . 31
5.8. Retry Packet Integrity . . . . . . . . . . . . . . . . . 33
6. Key Update . . . . . . . . . . . . . . . . . . . . . . . . . 32 6. Key Update . . . . . . . . . . . . . . . . . . . . . . . . . 34
6.1. Initiating a Key Update . . . . . . . . . . . . . . . . . 33 6.1. Initiating a Key Update . . . . . . . . . . . . . . . . . 35
6.2. Responding to a Key Update . . . . . . . . . . . . . . . 34 6.2. Responding to a Key Update . . . . . . . . . . . . . . . 36
6.3. Timing of Receive Key Generation . . . . . . . . . . . . 34 6.3. Timing of Receive Key Generation . . . . . . . . . . . . 37
6.4. Sending with Updated Keys . . . . . . . . . . . . . . . . 35 6.4. Sending with Updated Keys . . . . . . . . . . . . . . . . 38
6.5. Receiving with Different Keys . . . . . . . . . . . . . . 35 6.5. Receiving with Different Keys . . . . . . . . . . . . . . 38
6.6. Minimum Key Update Frequency . . . . . . . . . . . . . . 36 6.6. Limits on AEAD Usage . . . . . . . . . . . . . . . . . . 39
6.7. Key Update Error Code . . . . . . . . . . . . . . . . . . 37 6.7. Key Update Error Code . . . . . . . . . . . . . . . . . . 41
7. Security of Initial Messages . . . . . . . . . . . . . . . . 38 7. Security of Initial Messages . . . . . . . . . . . . . . . . 41
8. QUIC-Specific Adjustments to the TLS Handshake . . . . . . . 38 8. QUIC-Specific Adjustments to the TLS Handshake . . . . . . . 41
8.1. Protocol Negotiation . . . . . . . . . . . . . . . . . . 38 8.1. Protocol Negotiation . . . . . . . . . . . . . . . . . . 42
8.2. QUIC Transport Parameters Extension . . . . . . . . . . . 39 8.2. QUIC Transport Parameters Extension . . . . . . . . . . . 42
8.3. Removing the EndOfEarlyData Message . . . . . . . . . . . 39 8.3. Removing the EndOfEarlyData Message . . . . . . . . . . . 43
8.4. Prohibit TLS Middlebox Compatibility Mode . . . . . . . . 40 8.4. Prohibit TLS Middlebox Compatibility Mode . . . . . . . . 43
9. Security Considerations . . . . . . . . . . . . . . . . . . . 40 9. Security Considerations . . . . . . . . . . . . . . . . . . . 43
9.1. Session Linkability . . . . . . . . . . . . . . . . . . . 40 9.1. Session Linkability . . . . . . . . . . . . . . . . . . . 44
9.2. Replay Attacks with 0-RTT . . . . . . . . . . . . . . . . 40 9.2. Replay Attacks with 0-RTT . . . . . . . . . . . . . . . . 44
9.3. Packet Reflection Attack Mitigation . . . . . . . . . . . 41 9.3. Packet Reflection Attack Mitigation . . . . . . . . . . . 45
9.4. Header Protection Analysis . . . . . . . . . . . . . . . 42 9.4. Header Protection Analysis . . . . . . . . . . . . . . . 45
9.5. Header Protection Timing Side-Channels . . . . . . . . . 43 9.5. Header Protection Timing Side-Channels . . . . . . . . . 46
9.6. Key Diversity . . . . . . . . . . . . . . . . . . . . . . 43 9.6. Key Diversity . . . . . . . . . . . . . . . . . . . . . . 47
10. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 44 10. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 47
11. References . . . . . . . . . . . . . . . . . . . . . . . . . 44 11. References . . . . . . . . . . . . . . . . . . . . . . . . . 47
11.1. Normative References . . . . . . . . . . . . . . . . . . 44 11.1. Normative References . . . . . . . . . . . . . . . . . . 47
11.2. Informative References . . . . . . . . . . . . . . . . . 45 11.2. Informative References . . . . . . . . . . . . . . . . . 49
Appendix A. Sample Packet Protection . . . . . . . . . . . . . . 46 Appendix A. Sample Packet Protection . . . . . . . . . . . . . . 50
A.1. Keys . . . . . . . . . . . . . . . . . . . . . . . . . . 47 A.1. Keys . . . . . . . . . . . . . . . . . . . . . . . . . . 50
A.2. Client Initial . . . . . . . . . . . . . . . . . . . . . 48 A.2. Client Initial . . . . . . . . . . . . . . . . . . . . . 51
A.3. Server Initial . . . . . . . . . . . . . . . . . . . . . 49 A.3. Server Initial . . . . . . . . . . . . . . . . . . . . . 53
A.4. Retry . . . . . . . . . . . . . . . . . . . . . . . . . . 50 A.4. Retry . . . . . . . . . . . . . . . . . . . . . . . . . . 54
A.5. ChaCha20-Poly1305 Short Header Packet . . . . . . . . . . 50 A.5. ChaCha20-Poly1305 Short Header Packet . . . . . . . . . . 54
Appendix B. Analysis of Limits on AEAD_AES_128_CCM Usage . . . . 52 Appendix B. AEAD Algorithm Analysis . . . . . . . . . . . . . . 56
B.1. Confidentiality Limits . . . . . . . . . . . . . . . . . 53 B.1. Analysis of AEAD_AES_128_GCM and AEAD_AES_256_GCM Usage
B.2. Integrity Limits . . . . . . . . . . . . . . . . . . . . 53 Limits . . . . . . . . . . . . . . . . . . . . . . . . . 56
Appendix C. Change Log . . . . . . . . . . . . . . . . . . . . . 53 B.1.1. Confidentiality Limit . . . . . . . . . . . . . . . . 57
C.1. Since draft-ietf-quic-tls-28 . . . . . . . . . . . . . . 53 B.1.2. Integrity Limit . . . . . . . . . . . . . . . . . . . 57
C.2. Since draft-ietf-quic-tls-27 . . . . . . . . . . . . . . 54 B.2. Analysis of AEAD_AES_128_CCM Usage Limits . . . . . . . . 58
C.3. Since draft-ietf-quic-tls-26 . . . . . . . . . . . . . . 54 B.2.1. Confidentiality Limits . . . . . . . . . . . . . . . 58
C.4. Since draft-ietf-quic-tls-25 . . . . . . . . . . . . . . 54 B.2.2. Integrity Limits . . . . . . . . . . . . . . . . . . 58
C.5. Since draft-ietf-quic-tls-24 . . . . . . . . . . . . . . 54 Appendix C. Change Log . . . . . . . . . . . . . . . . . . . . . 59
C.6. Since draft-ietf-quic-tls-23 . . . . . . . . . . . . . . 54 C.1. Since draft-ietf-quic-tls-29 . . . . . . . . . . . . . . 59
C.7. Since draft-ietf-quic-tls-22 . . . . . . . . . . . . . . 54 C.2. Since draft-ietf-quic-tls-28 . . . . . . . . . . . . . . 59
C.8. Since draft-ietf-quic-tls-21 . . . . . . . . . . . . . . 55 C.3. Since draft-ietf-quic-tls-27 . . . . . . . . . . . . . . 59
C.9. Since draft-ietf-quic-tls-20 . . . . . . . . . . . . . . 55 C.4. Since draft-ietf-quic-tls-26 . . . . . . . . . . . . . . 59
C.10. Since draft-ietf-quic-tls-18 . . . . . . . . . . . . . . 55 C.5. Since draft-ietf-quic-tls-25 . . . . . . . . . . . . . . 59
C.11. Since draft-ietf-quic-tls-17 . . . . . . . . . . . . . . 55 C.6. Since draft-ietf-quic-tls-24 . . . . . . . . . . . . . . 59
C.12. Since draft-ietf-quic-tls-14 . . . . . . . . . . . . . . 55 C.7. Since draft-ietf-quic-tls-23 . . . . . . . . . . . . . . 60
C.13. Since draft-ietf-quic-tls-13 . . . . . . . . . . . . . . 56 C.8. Since draft-ietf-quic-tls-22 . . . . . . . . . . . . . . 60
C.14. Since draft-ietf-quic-tls-12 . . . . . . . . . . . . . . 56 C.9. Since draft-ietf-quic-tls-21 . . . . . . . . . . . . . . 60
C.15. Since draft-ietf-quic-tls-11 . . . . . . . . . . . . . . 56 C.10. Since draft-ietf-quic-tls-20 . . . . . . . . . . . . . . 60
C.16. Since draft-ietf-quic-tls-10 . . . . . . . . . . . . . . 56 C.11. Since draft-ietf-quic-tls-18 . . . . . . . . . . . . . . 60
C.17. Since draft-ietf-quic-tls-09 . . . . . . . . . . . . . . 56 C.12. Since draft-ietf-quic-tls-17 . . . . . . . . . . . . . . 60
C.18. Since draft-ietf-quic-tls-08 . . . . . . . . . . . . . . 56 C.13. Since draft-ietf-quic-tls-14 . . . . . . . . . . . . . . 61
C.19. Since draft-ietf-quic-tls-07 . . . . . . . . . . . . . . 56 C.14. Since draft-ietf-quic-tls-13 . . . . . . . . . . . . . . 61
C.20. Since draft-ietf-quic-tls-05 . . . . . . . . . . . . . . 57 C.15. Since draft-ietf-quic-tls-12 . . . . . . . . . . . . . . 61
C.21. Since draft-ietf-quic-tls-04 . . . . . . . . . . . . . . 57 C.16. Since draft-ietf-quic-tls-11 . . . . . . . . . . . . . . 61
C.22. Since draft-ietf-quic-tls-03 . . . . . . . . . . . . . . 57 C.17. Since draft-ietf-quic-tls-10 . . . . . . . . . . . . . . 62
C.23. Since draft-ietf-quic-tls-02 . . . . . . . . . . . . . . 57 C.18. Since draft-ietf-quic-tls-09 . . . . . . . . . . . . . . 62
C.24. Since draft-ietf-quic-tls-01 . . . . . . . . . . . . . . 57 C.19. Since draft-ietf-quic-tls-08 . . . . . . . . . . . . . . 62
C.25. Since draft-ietf-quic-tls-00 . . . . . . . . . . . . . . 57 C.20. Since draft-ietf-quic-tls-07 . . . . . . . . . . . . . . 62
C.26. Since draft-thomson-quic-tls-01 . . . . . . . . . . . . . 58 C.21. Since draft-ietf-quic-tls-05 . . . . . . . . . . . . . . 62
Contributors . . . . . . . . . . . . . . . . . . . . . . . . . . 58 C.22. Since draft-ietf-quic-tls-04 . . . . . . . . . . . . . . 62
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 59 C.23. Since draft-ietf-quic-tls-03 . . . . . . . . . . . . . . 62
C.24. Since draft-ietf-quic-tls-02 . . . . . . . . . . . . . . 62
C.25. Since draft-ietf-quic-tls-01 . . . . . . . . . . . . . . 62
C.26. Since draft-ietf-quic-tls-00 . . . . . . . . . . . . . . 63
C.27. Since draft-thomson-quic-tls-01 . . . . . . . . . . . . . 63
Contributors . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 64
1. Introduction 1. Introduction
This document describes how QUIC [QUIC-TRANSPORT] is secured using This document describes how QUIC [QUIC-TRANSPORT] is secured using
TLS [TLS13]. TLS [TLS13].
TLS 1.3 provides critical latency improvements for connection TLS 1.3 provides critical latency improvements for connection
establishment over previous versions. Absent packet loss, most new establishment over previous versions. Absent packet loss, most new
connections can be established and secured within a single round connections can be established and secured within a single round
trip; on subsequent connections between the same client and server, trip; on subsequent connections between the same client and server,
skipping to change at page 4, line 45 skipping to change at page 5, line 6
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
"OPTIONAL" in this document are to be interpreted as described in "OPTIONAL" in this document are to be interpreted as described in
BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all
capitals, as shown here. capitals, as shown here.
This document uses the terminology established in [QUIC-TRANSPORT]. This document uses the terminology established in [QUIC-TRANSPORT].
For brevity, the acronym TLS is used to refer to TLS 1.3, though a For brevity, the acronym TLS is used to refer to TLS 1.3, though a
newer version could be used (see Section 4.2). newer version could be used; see Section 4.2.
2.1. TLS Overview 2.1. TLS Overview
TLS provides two endpoints with a way to establish a means of TLS provides two endpoints with a way to establish a means of
communication over an untrusted medium (that is, the Internet) that communication over an untrusted medium (that is, the Internet) that
ensures that messages they exchange cannot be observed, modified, or ensures that messages they exchange cannot be observed, modified, or
forged. forged.
Internally, TLS is a layered protocol, with the structure shown in Internally, TLS is a layered protocol, with the structure shown in
Figure 1. Figure 1.
skipping to change at page 5, line 30 skipping to change at page 5, line 33
Record | | Record | |
Layer | Records | Layer | Records |
| | | |
+---------------------------------------------------+ +---------------------------------------------------+
Figure 1: TLS Layers Figure 1: TLS Layers
Each Handshake layer message (e.g., Handshake, Alerts, and Each Handshake layer message (e.g., Handshake, Alerts, and
Application Data) is carried as a series of typed TLS records by the Application Data) is carried as a series of typed TLS records by the
Record layer. Records are individually cryptographically protected Record layer. Records are individually cryptographically protected
and then transmitted over a reliable transport (typically TCP) which and then transmitted over a reliable transport (typically TCP), which
provides sequencing and guaranteed delivery. provides sequencing and guaranteed delivery.
The TLS authenticated key exchange occurs between two endpoints: The TLS authenticated key exchange occurs between two endpoints:
client and server. The client initiates the exchange and the server client and server. The client initiates the exchange and the server
responds. If the key exchange completes successfully, both client responds. If the key exchange completes successfully, both client
and server will agree on a secret. TLS supports both pre-shared key and server will agree on a secret. TLS supports both pre-shared key
(PSK) and Diffie-Hellman over either finite fields or elliptic curves (PSK) and Diffie-Hellman over either finite fields or elliptic curves
((EC)DHE) key exchanges. PSK is the basis for 0-RTT; the latter ((EC)DHE) key exchanges. PSK is the basis for Early Data (0-RTT);
provides perfect forward secrecy (PFS) when the (EC)DHE keys are the latter provides perfect forward secrecy (PFS) when the (EC)DHE
destroyed. keys are destroyed.
After completing the TLS handshake, the client will have learned and After completing the TLS handshake, the client will have learned and
authenticated an identity for the server and the server is optionally authenticated an identity for the server and the server is optionally
able to learn and authenticate an identity for the client. TLS able to learn and authenticate an identity for the client. TLS
supports X.509 [RFC5280] certificate-based authentication for both supports X.509 [RFC5280] certificate-based authentication for both
server and client. server and client.
The TLS key exchange is resistant to tampering by attackers and it The TLS key exchange is resistant to tampering by attackers and it
produces shared secrets that cannot be controlled by either produces shared secrets that cannot be controlled by either
participating peer. participating peer.
TLS provides two basic handshake modes of interest to QUIC: TLS provides two basic handshake modes of interest to QUIC:
* A full 1-RTT handshake in which the client is able to send * A full 1-RTT handshake, in which the client is able to send
Application Data after one round trip and the server immediately Application Data after one round trip and the server immediately
responds after receiving the first handshake message from the responds after receiving the first handshake message from the
client. client.
* A 0-RTT handshake in which the client uses information it has * A 0-RTT handshake, in which the client uses information it has
previously learned about the server to send Application Data previously learned about the server to send Application Data
immediately. This Application Data can be replayed by an attacker immediately. This Application Data can be replayed by an attacker
so it MUST NOT carry a self-contained trigger for any non- so it MUST NOT carry a self-contained trigger for any non-
idempotent action. idempotent action.
A simplified TLS handshake with 0-RTT application data is shown in A simplified TLS handshake with 0-RTT application data is shown in
Figure 2. Figure 2.
Client Server Client Server
skipping to change at page 8, line 32 skipping to change at page 8, line 39
| Protect | Protected | Protect | Protected
v | Packet v | Packet
+------------+ +------------+
| QUIC | | QUIC |
| Packet | | Packet |
| Protection | | Protection |
+------------+ +------------+
Figure 4: QUIC and TLS Interactions Figure 4: QUIC and TLS Interactions
Unlike TLS over TCP, QUIC applications which want to send data do not Unlike TLS over TCP, QUIC applications that want to send data do not
send it through TLS "application_data" records. Rather, they send it send it through TLS "application_data" records. Rather, they send it
as QUIC STREAM frames or other frame types which are then carried in as QUIC STREAM frames or other frame types, which are then carried in
QUIC packets. QUIC packets.
4. Carrying TLS Messages 4. Carrying TLS Messages
QUIC carries TLS handshake data in CRYPTO frames, each of which QUIC carries TLS handshake data in CRYPTO frames, each of which
consists of a contiguous block of handshake data identified by an consists of a contiguous block of handshake data identified by an
offset and length. Those frames are packaged into QUIC packets and offset and length. Those frames are packaged into QUIC packets and
encrypted under the current TLS encryption level. As with TLS over encrypted under the current TLS encryption level. As with TLS over
TCP, once TLS handshake data has been delivered to QUIC, it is QUIC's TCP, once TLS handshake data has been delivered to QUIC, it is QUIC's
responsibility to deliver it reliably. Each chunk of data that is responsibility to deliver it reliably. Each chunk of data that is
skipping to change at page 9, line 26 skipping to change at page 9, line 28
* PADDING, PING, and CRYPTO frames MAY appear in any packet number * PADDING, PING, and CRYPTO frames MAY appear in any packet number
space. space.
* CONNECTION_CLOSE frames signaling errors at the QUIC layer (type * CONNECTION_CLOSE frames signaling errors at the QUIC layer (type
0x1c) MAY appear in any packet number space. CONNECTION_CLOSE 0x1c) MAY appear in any packet number space. CONNECTION_CLOSE
frames signaling application errors (type 0x1d) MUST only appear frames signaling application errors (type 0x1d) MUST only appear
in the application data packet number space. in the application data packet number space.
* ACK frames MAY appear in any packet number space, but can only * ACK frames MAY appear in any packet number space, but can only
acknowledge packets which appeared in that packet number space. acknowledge packets that appeared in that packet number space.
However, as noted below, 0-RTT packets cannot contain ACK frames. However, as noted below, 0-RTT packets cannot contain ACK frames.
* All other frame types MUST only be sent in the application data * All other frame types MUST only be sent in the application data
packet number space. packet number space.
Note that it is not possible to send the following frames in 0-RTT Note that it is not possible to send the following frames in 0-RTT
packets for various reasons: ACK, CRYPTO, HANDSHAKE_DONE, NEW_TOKEN, packets for various reasons: ACK, CRYPTO, HANDSHAKE_DONE, NEW_TOKEN,
PATH_RESPONSE, and RETIRE_CONNECTION_ID. A server MAY treat receipt PATH_RESPONSE, and RETIRE_CONNECTION_ID. A server MAY treat receipt
of these frames in 0-RTT packets as a connection error of type of these frames in 0-RTT packets as a connection error of type
PROTOCOL_VIOLATION. PROTOCOL_VIOLATION.
Because packets could be reordered on the wire, QUIC uses the packet Because packets could be reordered on the wire, QUIC uses the packet
type to indicate which keys were used to protect a given packet, as type to indicate which keys were used to protect a given packet, as
shown in Table 1. When packets of different types need to be sent, shown in Table 1. When packets of different types need to be sent,
endpoints SHOULD use coalesced packets to send them in the same UDP endpoints SHOULD use coalesced packets to send them in the same UDP
datagram. datagram.
+---------------------+-----------------+------------------+ +=====================+=================+==================+
| Packet Type | Encryption Keys | PN Space | | Packet Type | Encryption Keys | PN Space |
+=====================+=================+==================+ +=====================+=================+==================+
| Initial | Initial secrets | Initial | | Initial | Initial secrets | Initial |
+---------------------+-----------------+------------------+ +---------------------+-----------------+------------------+
| 0-RTT Protected | 0-RTT | Application data | | 0-RTT Protected | 0-RTT | Application data |
+---------------------+-----------------+------------------+ +---------------------+-----------------+------------------+
| Handshake | Handshake | Handshake | | Handshake | Handshake | Handshake |
+---------------------+-----------------+------------------+ +---------------------+-----------------+------------------+
| Retry | Retry | N/A | | Retry | Retry | N/A |
+---------------------+-----------------+------------------+ +---------------------+-----------------+------------------+
skipping to change at page 11, line 23 skipping to change at page 11, line 23
recording the lowest packet number sent with 1-RTT keys, and recording the lowest packet number sent with 1-RTT keys, and
comparing it to the Largest Acknowledged field in any received 1-RTT comparing it to the Largest Acknowledged field in any received 1-RTT
ACK frame: once the latter is greater than or equal to the former, ACK frame: once the latter is greater than or equal to the former,
the handshake is confirmed. the handshake is confirmed.
4.1.3. Sending and Receiving Handshake Messages 4.1.3. Sending and Receiving Handshake Messages
In order to drive the handshake, TLS depends on being able to send In order to drive the handshake, TLS depends on being able to send
and receive handshake messages. There are two basic functions on and receive handshake messages. There are two basic functions on
this interface: one where QUIC requests handshake messages and one this interface: one where QUIC requests handshake messages and one
where QUIC provides handshake packets. where QUIC provides bytes that comprise handshake messages.
Before starting the handshake QUIC provides TLS with the transport Before starting the handshake QUIC provides TLS with the transport
parameters (see Section 8.2) that it wishes to carry. parameters (see Section 8.2) that it wishes to carry.
A QUIC client starts TLS by requesting TLS handshake bytes from TLS. A QUIC client starts TLS by requesting TLS handshake bytes from TLS.
The client acquires handshake bytes before sending its first packet. The client acquires handshake bytes before sending its first packet.
A QUIC server starts the process by providing TLS with the client's A QUIC server starts the process by providing TLS with the client's
handshake bytes. handshake bytes.
At any time, the TLS stack at an endpoint will have a current sending At any time, the TLS stack at an endpoint will have a current sending
encryption level and receiving encryption level. Encryption levels encryption level and receiving encryption level. Encryption levels
determine the packet type and keys that are used for protecting data. determine the packet type and keys that are used for protecting data.
Each encryption level is associated with a different sequence of Each encryption level is associated with a different sequence of
bytes, which is reliably transmitted to the peer in CRYPTO frames. bytes, which is reliably transmitted to the peer in CRYPTO frames.
When TLS provides handshake bytes to be sent, they are appended to When TLS provides handshake bytes to be sent, they are appended to
the current flow. Any packet that includes the CRYPTO frame is the handshake bytes for the current encryption level. The encryption
protected using keys from the corresponding encryption level. Four level then determines the type of packet that the resulting CRYPTO
encryption levels are used, producing keys for Initial, 0-RTT, frame is carried in; see Table 1.
Four encryption levels are used, producing keys for Initial, 0-RTT,
Handshake, and 1-RTT packets. CRYPTO frames are carried in just Handshake, and 1-RTT packets. CRYPTO frames are carried in just
three of these levels, omitting the 0-RTT level. These four levels three of these levels, omitting the 0-RTT level. These four levels
correspond to three packet number spaces: Initial and Handshake correspond to three packet number spaces: Initial and Handshake
encrypted packets use their own separate spaces; 0-RTT and 1-RTT encrypted packets use their own separate spaces; 0-RTT and 1-RTT
packets use the application data packet number space. packets use the application data packet number space.
QUIC takes the unprotected content of TLS handshake records as the QUIC takes the unprotected content of TLS handshake records as the
content of CRYPTO frames. TLS record protection is not used by QUIC. content of CRYPTO frames. TLS record protection is not used by QUIC.
QUIC assembles CRYPTO frames into QUIC packets, which are protected QUIC assembles CRYPTO frames into QUIC packets, which are protected
using QUIC packet protection. using QUIC packet protection.
QUIC is only capable of conveying TLS handshake records in CRYPTO QUIC is only capable of conveying TLS handshake records in CRYPTO
frames. TLS alerts are turned into QUIC CONNECTION_CLOSE error frames. TLS alerts are turned into QUIC CONNECTION_CLOSE error
codes; see Section 4.10. TLS application data and other message codes; see Section 4.8. TLS application data and other message types
types cannot be carried by QUIC at any encryption level and is an cannot be carried by QUIC at any encryption level; it is an error if
error if they are received from the TLS stack. they are received from the TLS stack.
When an endpoint receives a QUIC packet containing a CRYPTO frame When an endpoint receives a QUIC packet containing a CRYPTO frame
from the network, it proceeds as follows: from the network, it proceeds as follows:
* If the packet was in the TLS receiving encryption level, sequence * If the packet uses the current TLS receiving encryption level,
the data into the input flow as usual. As with STREAM frames, the sequence the data into the input flow as usual. As with STREAM
offset is used to find the proper location in the data sequence. frames, the offset is used to find the proper location in the data
If the result of this process is that new data is available, then sequence. If the result of this process is that new data is
it is delivered to TLS in order. available, then it is delivered to TLS in order.
* If the packet is from a previously installed encryption level, it * If the packet is from a previously installed encryption level, it
MUST NOT contain data which extends past the end of previously MUST NOT contain data that extends past the end of previously
received data in that flow. Implementations MUST treat any received data in that flow. Implementations MUST treat any
violations of this requirement as a connection error of type violations of this requirement as a connection error of type
PROTOCOL_VIOLATION. PROTOCOL_VIOLATION.
* If the packet is from a new encryption level, it is saved for * If the packet is from a new encryption level, it is saved for
later processing by TLS. Once TLS moves to receiving from this later processing by TLS. Once TLS moves to receiving from this
encryption level, saved data can be provided. When providing data encryption level, saved data can be provided to TLS. When
from any new encryption level to TLS, if there is data from a providing data from any new encryption level to TLS, if there is
previous encryption level that TLS has not consumed, this MUST be data from a previous encryption level that TLS has not consumed,
treated as a connection error of type PROTOCOL_VIOLATION. this MUST be treated as a connection error of type
PROTOCOL_VIOLATION.
Each time that TLS is provided with new data, new handshake bytes are Each time that TLS is provided with new data, new handshake bytes are
requested from TLS. TLS might not provide any bytes if the handshake requested from TLS. TLS might not provide any bytes if the handshake
messages it has received are incomplete or it has no data to send. messages it has received are incomplete or it has no data to send.
The content of CRYPTO frames might either be processed incrementally
by TLS or buffered until complete messages or flights are available.
TLS is responsible for buffering handshake bytes that have arrived in
order. QUIC is responsible for buffering handshake bytes that arrive
out of order or for encryption levels that are not yet ready. QUIC
does not provide any means of flow control for CRYPTO frames; see
Section 7.5 of [QUIC-TRANSPORT].
Once the TLS handshake is complete, this is indicated to QUIC along Once the TLS handshake is complete, this is indicated to QUIC along
with any final handshake bytes that TLS needs to send. TLS also with any final handshake bytes that TLS needs to send. TLS also
provides QUIC with the transport parameters that the peer advertised provides QUIC with the transport parameters that the peer advertised
during the handshake. during the handshake.
Once the handshake is complete, TLS becomes passive. TLS can still Once the handshake is complete, TLS becomes passive. TLS can still
receive data from its peer and respond in kind, but it will not need receive data from its peer and respond in kind, but it will not need
to send more data unless specifically requested - either by an to send more data unless specifically requested - either by an
application or QUIC. One reason to send data is that the server application or QUIC. One reason to send data is that the server
might wish to provide additional or updated session tickets to a might wish to provide additional or updated session tickets to a
client. client.
When the handshake is complete, QUIC only needs to provide TLS with When the handshake is complete, QUIC only needs to provide TLS with
any data that arrives in CRYPTO streams. In the same way that is any data that arrives in CRYPTO streams. In the same way that is
done during the handshake, new data is requested from TLS after done during the handshake, new data is requested from TLS after
providing received data. providing received data.
4.1.4. Encryption Level Changes 4.1.4. Encryption Level Changes
As keys for new encryption levels become available, TLS provides QUIC As keys at a given encryption level become available to TLS, TLS
with those keys. Separately, as keys at a given encryption level indicates to QUIC that reading or writing keys at that encryption
become available to TLS, TLS indicates to QUIC that reading or level are available.
writing keys at that encryption level are available. These events
are not asynchronous; they always occur immediately after TLS is The availability of new keys is always a result of providing inputs
provided with new handshake bytes, or after TLS produces handshake to TLS. TLS only provides new keys after being initialized (by a
bytes. client) or when provided with new handshake data.
However, a TLS implementation could perform some of its processing
asynchronously. In particular, the process of validating a
certificate can take some time. While waiting for TLS processing to
complete, an endpoint SHOULD buffer received packets if they might be
processed using keys that aren't yet available. These packets can be
processed once keys are provided by TLS. An endpoint SHOULD continue
to respond to packets that can be processed during this time.
After processing inputs, TLS might produce handshake bytes, keys for
new encryption levels, or both.
TLS provides QUIC with three items as a new encryption level becomes TLS provides QUIC with three items as a new encryption level becomes
available: available:
* A secret * A secret
* An Authenticated Encryption with Associated Data (AEAD) function * An Authenticated Encryption with Associated Data (AEAD) function
* A Key Derivation Function (KDF) * A Key Derivation Function (KDF)
These values are based on the values that TLS negotiates and are used These values are based on the values that TLS negotiates and are used
by QUIC to generate packet and header protection keys (see Section 5 by QUIC to generate packet and header protection keys; see Section 5
and Section 5.4). and Section 5.4.
If 0-RTT is possible, it is ready after the client sends a TLS If 0-RTT is possible, it is ready after the client sends a TLS
ClientHello message or the server receives that message. After ClientHello message or the server receives that message. After
providing a QUIC client with the first handshake bytes, the TLS stack providing a QUIC client with the first handshake bytes, the TLS stack
might signal the change to 0-RTT keys. On the server, after might signal the change to 0-RTT keys. On the server, after
receiving handshake bytes that contain a ClientHello message, a TLS receiving handshake bytes that contain a ClientHello message, a TLS
server might signal that 0-RTT keys are available. server might signal that 0-RTT keys are available.
Although TLS only uses one encryption level at a time, QUIC may use Although TLS only uses one encryption level at a time, QUIC may use
more than one level. For instance, after sending its Finished more than one level. For instance, after sending its Finished
skipping to change at page 14, line 14 skipping to change at page 14, line 42
QUIC also needs access to keys that might not ordinarily be available QUIC also needs access to keys that might not ordinarily be available
to a TLS implementation. For instance, a client might need to to a TLS implementation. For instance, a client might need to
acknowledge Handshake packets before it is ready to send CRYPTO acknowledge Handshake packets before it is ready to send CRYPTO
frames at that encryption level. TLS therefore needs to provide keys frames at that encryption level. TLS therefore needs to provide keys
to QUIC before it might produce them for its own use. to QUIC before it might produce them for its own use.
4.1.5. TLS Interface Summary 4.1.5. TLS Interface Summary
Figure 5 summarizes the exchange between QUIC and TLS for both client Figure 5 summarizes the exchange between QUIC and TLS for both client
and server. Each arrow is tagged with the encryption level used for and server. Solid arrows indicate packets that carry handshake data;
that transmission. dashed arrows show where application data can be sent. Each arrow is
tagged with the encryption level used for that transmission.
Client Server Client Server
====== ======
Get Handshake Get Handshake
Initial -------------> Initial ------------->
Handshake Received
Install tx 0-RTT Keys Install tx 0-RTT Keys
0-RTT ---------------> 0-RTT - - - - - - - ->
Handshake Received
Get Handshake Get Handshake
<------------- Initial <------------- Initial
Handshake Received
Install Handshake keys
Install rx 0-RTT keys Install rx 0-RTT keys
Install Handshake keys Install Handshake keys
Get Handshake Get Handshake
<----------- Handshake <----------- Handshake
Handshake Received
Install tx 1-RTT keys Install tx 1-RTT keys
<--------------- 1-RTT <- - - - - - - - 1-RTT
Handshake Received (Initial)
Install Handshake keys
Handshake Received (Handshake)
Get Handshake Get Handshake
Handshake Complete
Handshake -----------> Handshake ----------->
Handshake Complete
Install 1-RTT keys
1-RTT - - - - - - - ->
Handshake Received Handshake Received
Install rx 1-RTT keys
Handshake Complete Handshake Complete
Install 1-RTT keys Install rx 1-RTT keys
1-RTT --------------->
Get Handshake
<--------------- 1-RTT
Handshake Received
Figure 5: Interaction Summary between QUIC and TLS Figure 5: Interaction Summary between QUIC and TLS
Figure 5 shows the multiple packets that form a single "flight" of Figure 5 shows the multiple packets that form a single "flight" of
messages being processed individually, to show what incoming messages messages being processed individually, to show what incoming messages
trigger different actions. New handshake messages are requested trigger different actions. New handshake messages are requested
after all incoming packets have been processed. This process might after incoming packets have been processed. This process varies
vary depending on how QUIC implementations and the packets they based on the structure of endpoint implementations and the order in
receive are structured. which packets arrive; this is intended to illustrate the steps
involved in a single handshake exchange.
4.2. TLS Version 4.2. TLS Version
This document describes how TLS 1.3 [TLS13] is used with QUIC. This document describes how TLS 1.3 [TLS13] is used with QUIC.
In practice, the TLS handshake will negotiate a version of TLS to In practice, the TLS handshake will negotiate a version of TLS to
use. This could result in a newer version of TLS than 1.3 being use. This could result in a newer version of TLS than 1.3 being
negotiated if both endpoints support that version. This is negotiated if both endpoints support that version. This is
acceptable provided that the features of TLS 1.3 that are used by acceptable provided that the features of TLS 1.3 that are used by
QUIC are supported by the newer version. QUIC are supported by the newer version.
A badly configured TLS implementation could negotiate TLS 1.2 or Clients MUST NOT offer TLS versions older than 1.3. A badly
another older version of TLS. An endpoint MUST terminate the configured TLS implementation could negotiate TLS 1.2 or another
connection if a version of TLS older than 1.3 is negotiated. older version of TLS. An endpoint MUST terminate the connection if a
version of TLS older than 1.3 is negotiated.
4.3. ClientHello Size 4.3. ClientHello Size
The first Initial packet from a client contains the start or all of The first Initial packet from a client contains the start or all of
its first cryptographic handshake message, which for TLS is the its first cryptographic handshake message, which for TLS is the
ClientHello. Servers might need to parse the entire ClientHello ClientHello. Servers might need to parse the entire ClientHello
(e.g., to access extensions such as Server Name Identification (SNI) (e.g., to access extensions such as Server Name Identification (SNI)
or Application Layer Protocol Negotiation (ALPN)) in order to decide or Application Layer Protocol Negotiation (ALPN)) in order to decide
whether to accept the new incoming QUIC connection. If the whether to accept the new incoming QUIC connection. If the
ClientHello spans multiple Initial packets, such servers would need ClientHello spans multiple Initial packets, such servers would need
skipping to change at page 16, line 5 skipping to change at page 16, line 37
avoid this, servers MAY use the Retry feature (see Section 8.1 of avoid this, servers MAY use the Retry feature (see Section 8.1 of
[QUIC-TRANSPORT]) to only buffer partial ClientHello messages from [QUIC-TRANSPORT]) to only buffer partial ClientHello messages from
clients with a validated address. clients with a validated address.
QUIC packet and framing add at least 36 bytes of overhead to the QUIC packet and framing add at least 36 bytes of overhead to the
ClientHello message. That overhead increases if the client chooses a ClientHello message. That overhead increases if the client chooses a
connection ID without zero length. Overheads also do not include the connection ID without zero length. Overheads also do not include the
token or a connection ID longer than 8 bytes, both of which might be token or a connection ID longer than 8 bytes, both of which might be
required if a server sends a Retry packet. required if a server sends a Retry packet.
A typical TLS ClientHello can easily fit into a 1200 byte packet. A typical TLS ClientHello can easily fit into a 1200-byte packet.
However, in addition to the overheads added by QUIC, there are However, in addition to the overheads added by QUIC, there are
several variables that could cause this limit to be exceeded. Large several variables that could cause this limit to be exceeded. Large
session tickets, multiple or large key shares, and long lists of session tickets, multiple or large key shares, and long lists of
supported ciphers, signature algorithms, versions, QUIC transport supported ciphers, signature algorithms, versions, QUIC transport
parameters, and other negotiable parameters and extensions could parameters, and other negotiable parameters and extensions could
cause this message to grow. cause this message to grow.
For servers, in addition to connection IDs and tokens, the size of For servers, in addition to connection IDs and tokens, the size of
TLS session tickets can have an effect on a client's ability to TLS session tickets can have an effect on a client's ability to
connect efficiently. Minimizing the size of these values increases connect efficiently. Minimizing the size of these values increases
skipping to change at page 16, line 34 skipping to change at page 17, line 20
The requirements for authentication depend on the application The requirements for authentication depend on the application
protocol that is in use. TLS provides server authentication and protocol that is in use. TLS provides server authentication and
permits the server to request client authentication. permits the server to request client authentication.
A client MUST authenticate the identity of the server. This A client MUST authenticate the identity of the server. This
typically involves verification that the identity of the server is typically involves verification that the identity of the server is
included in a certificate and that the certificate is issued by a included in a certificate and that the certificate is issued by a
trusted entity (see for example [RFC2818]). trusted entity (see for example [RFC2818]).
Note: Where servers provide certificates for authentication, the
size of the certificate chain can consume a large number of bytes.
Controlling the size of certificate chains is critical to
performance in QUIC as servers are limited to sending 3 bytes for
every byte received prior to validating the client address; see
Section 8.1 of [QUIC-TRANSPORT]. The size of a certificate chain
can be managed by limiting the number of names or extensions;
using keys with small public key representations, like ECDSA; or
by using certificate compression [COMPRESS].
A server MAY request that the client authenticate during the A server MAY request that the client authenticate during the
handshake. A server MAY refuse a connection if the client is unable handshake. A server MAY refuse a connection if the client is unable
to authenticate when requested. The requirements for client to authenticate when requested. The requirements for client
authentication vary based on application protocol and deployment. authentication vary based on application protocol and deployment.
A server MUST NOT use post-handshake client authentication (as A server MUST NOT use post-handshake client authentication (as
defined in Section 4.6.2 of [TLS13]), because the multiplexing defined in Section 4.6.2 of [TLS13]), because the multiplexing
offered by QUIC prevents clients from correlating the certificate offered by QUIC prevents clients from correlating the certificate
request with the application-level event that triggered it (see request with the application-level event that triggered it (see
[HTTP2-TLS13]). More specifically, servers MUST NOT send post- [HTTP2-TLS13]). More specifically, servers MUST NOT send post-
skipping to change at page 17, line 17 skipping to change at page 18, line 10
QUIC can use the session resumption feature of TLS 1.3. It does this QUIC can use the session resumption feature of TLS 1.3. It does this
by carrying NewSessionTicket messages in CRYPTO frames after the by carrying NewSessionTicket messages in CRYPTO frames after the
handshake is complete. Session resumption is the basis of 0-RTT, but handshake is complete. Session resumption is the basis of 0-RTT, but
can be used without also enabling 0-RTT. can be used without also enabling 0-RTT.
Endpoints that use session resumption might need to remember some Endpoints that use session resumption might need to remember some
information about the current connection when creating a resumed information about the current connection when creating a resumed
connection. TLS requires that some information be retained; see connection. TLS requires that some information be retained; see
Section 4.6.1 of [TLS13]. QUIC itself does not depend on any state Section 4.6.1 of [TLS13]. QUIC itself does not depend on any state
being retained when resuming a connection, unless 0-RTT is also used; being retained when resuming a connection, unless 0-RTT is also used;
see Section 4.6 and Section 7.4.1 of [QUIC-TRANSPORT]. Application see Section 4.6.1 and Section 7.4.1 of [QUIC-TRANSPORT]. Application
protocols could depend on state that is retained between resumed protocols could depend on state that is retained between resumed
connections. connections.
Clients can store any state required for resumption along with the Clients can store any state required for resumption along with the
session ticket. Servers can use the session ticket to help carry session ticket. Servers can use the session ticket to help carry
state. state.
Session resumption allows servers to link activity on the original Session resumption allows servers to link activity on the original
connection with the resumed connection, which might be a privacy connection with the resumed connection, which might be a privacy
issue for clients. Clients can choose not to enable resumption to issue for clients. Clients can choose not to enable resumption to
avoid creating this correlation. Client SHOULD NOT reuse tickets as avoid creating this correlation. Client SHOULD NOT reuse tickets as
that allows entities other than the server to correlate connections; that allows entities other than the server to correlate connections;
see Section C.4 of [TLS13]. see Section C.4 of [TLS13].
4.6. Enabling 0-RTT 4.6. 0-RTT
The 0-RTT feature in QUIC allows a client to send application data
before the handshake is complete. This is made possible by reusing
negotiated parameters from a previous connection. To enable this,
0-RTT depends on the client remembering critical parameters and
providing the server with a TLS session ticket that allows the server
to recover the same information.
This information includes parameters that determine TLS state, as
governed by [TLS13], QUIC transport parameters, the chosen
application protocol, and any information the application protocol
might need; see Section 4.6.3. This information determines how 0-RTT
packets and their contents are formed.
To ensure that the same information is available to both endpoints,
all information used to establish 0-RTT comes from the same
connection. Endpoints cannot selectively disregard information that
might alter the sending or processing of 0-RTT.
[TLS13] sets a limit of 7 days on the time between the original
connection and any attempt to use 0-RTT. There are other constraints
on 0-RTT usage, notably those caused by the potential exposure to
replay attack; see Section 9.2.
4.6.1. Enabling 0-RTT
To communicate their willingness to process 0-RTT data, servers send To communicate their willingness to process 0-RTT data, servers send
a NewSessionTicket message that contains the "early_data" extension a NewSessionTicket message that contains the early_data extension
with a max_early_data_size of 0xffffffff; the amount of data which with a max_early_data_size of 0xffffffff. The TLS
the client can send in 0-RTT is controlled by the "initial_max_data" max_early_data_size parameter is not used in QUIC. The amount of
transport parameter supplied by the server. Servers MUST NOT send data that the client can send in 0-RTT is controlled by the
the "early_data" extension with a max_early_data_size set to any initial_max_data transport parameter supplied by the server.
value other than 0xffffffff. A client MUST treat receipt of a
NewSessionTicket that contains an "early_data" extension with any
other value as a connection error of type PROTOCOL_VIOLATION.
A client that wishes to send 0-RTT packets uses the "early_data" Servers MUST NOT send the early_data extension with a
extension in the ClientHello message of a subsequent handshake (see max_early_data_size field set to any value other than 0xffffffff. A
Section 4.2.10 of [TLS13]). It then sends the application data in client MUST treat receipt of a NewSessionTicket that contains an
0-RTT packets. early_data extension with any other value as a connection error of
type PROTOCOL_VIOLATION.
4.7. Accepting and Rejecting 0-RTT A client that wishes to send 0-RTT packets uses the early_data
extension in the ClientHello message of a subsequent handshake; see
Section 4.2.10 of [TLS13]. It then sends application data in 0-RTT
packets.
A client that attempts 0-RTT might also provide an address validation
token if the server has sent a NEW_TOKEN frame; see Section 8.1 of
[QUIC-TRANSPORT].
4.6.2. Accepting and Rejecting 0-RTT
A server accepts 0-RTT by sending an early_data extension in the A server accepts 0-RTT by sending an early_data extension in the
EncryptedExtensions (see Section 4.2.10 of [TLS13]). The server then EncryptedExtensions (see Section 4.2.10 of [TLS13]). The server then
processes and acknowledges the 0-RTT packets that it receives. processes and acknowledges the 0-RTT packets that it receives.
A server rejects 0-RTT by sending the EncryptedExtensions without an A server rejects 0-RTT by sending the EncryptedExtensions without an
early_data extension. A server will always reject 0-RTT if it sends early_data extension. A server will always reject 0-RTT if it sends
a TLS HelloRetryRequest. When rejecting 0-RTT, a server MUST NOT a TLS HelloRetryRequest. When rejecting 0-RTT, a server MUST NOT
process any 0-RTT packets, even if it could. When 0-RTT was process any 0-RTT packets, even if it could. When 0-RTT was
rejected, a client SHOULD treat receipt of an acknowledgement for a rejected, a client SHOULD treat receipt of an acknowledgement for a
0-RTT packet as a connection error of type PROTOCOL_VIOLATION, if it 0-RTT packet as a connection error of type PROTOCOL_VIOLATION, if it
is able to detect the condition. is able to detect the condition.
When 0-RTT is rejected, all connection characteristics that the When 0-RTT is rejected, all connection characteristics that the
client assumed might be incorrect. This includes the choice of client assumed might be incorrect. This includes the choice of
application protocol, transport parameters, and any application application protocol, transport parameters, and any application
configuration. The client therefore MUST reset the state of all configuration. The client therefore MUST reset the state of all
streams, including application state bound to those streams. streams, including application state bound to those streams.
A client MAY attempt to send 0-RTT again if it receives a Retry or A client MAY reattempt 0-RTT if it receives a Retry or Version
Version Negotiation packet. These packets do not signify rejection Negotiation packet. These packets do not signify rejection of 0-RTT.
of 0-RTT.
4.8. Validating 0-RTT Configuration 4.6.3. Validating 0-RTT Configuration
When a server receives a ClientHello with the "early_data" extension, When a server receives a ClientHello with the early_data extension,
it has to decide whether to accept or reject early data from the it has to decide whether to accept or reject early data from the
client. Some of this decision is made by the TLS stack (e.g., client. Some of this decision is made by the TLS stack (e.g.,
checking that the cipher suite being resumed was included in the checking that the cipher suite being resumed was included in the
ClientHello; see Section 4.2.10 of [TLS13]). Even when the TLS stack ClientHello; see Section 4.2.10 of [TLS13]). Even when the TLS stack
has no reason to reject early data, the QUIC stack or the application has no reason to reject early data, the QUIC stack or the application
protocol using QUIC might reject early data because the configuration protocol using QUIC might reject early data because the configuration
of the transport or application associated with the resumed session of the transport or application associated with the resumed session
is not compatible with the server's current configuration. is not compatible with the server's current configuration.
QUIC requires additional transport state to be associated with a QUIC requires additional transport state to be associated with a
0-RTT session ticket. One common way to implement this is using 0-RTT session ticket. One common way to implement this is using
stateless session tickets and storing this state in the session stateless session tickets and storing this state in the session
ticket. Application protocols that use QUIC might have similar ticket. Application protocols that use QUIC might have similar
requirements regarding associating or storing state. This associated requirements regarding associating or storing state. This associated
state is used for deciding whether early data must be rejected. For state is used for deciding whether early data must be rejected. For
example, HTTP/3 ([QUIC-HTTP]) settings determine how early data from example, HTTP/3 ([QUIC-HTTP]) settings determine how early data from
the client is interpreted. Other applications using QUIC could have the client is interpreted. Other applications using QUIC could have
different requirements for determining whether to accept or reject different requirements for determining whether to accept or reject
early data. early data.
4.9. HelloRetryRequest 4.7. HelloRetryRequest
In TLS over TCP, the HelloRetryRequest feature (see Section 4.1.4 of The HelloRetryRequest message (see Section 4.1.4 of [TLS13]) can be
[TLS13]) can be used to correct a client's incorrect KeyShare used to request that a client provide new information, such as a key
extension as well as for a stateless round-trip check. From the share, or to validate some characteristic of the client. From the
perspective of QUIC, this just looks like additional messages carried perspective of QUIC, HelloRetryRequest is not differentiated from
in Initial packets. Although it is in principle possible to use this other cryptographic handshake messages that are carried in Initial
feature for address verification in QUIC, QUIC implementations SHOULD packets. Although it is in principle possible to use this feature
instead use the Retry feature (see Section 8.1 of [QUIC-TRANSPORT]). for address verification, QUIC implementations SHOULD instead use the
HelloRetryRequest is still used to request key shares. Retry feature; see Section 8.1 of [QUIC-TRANSPORT].
4.10. TLS Errors 4.8. TLS Errors
If TLS experiences an error, it generates an appropriate alert as If TLS experiences an error, it generates an appropriate alert as
defined in Section 6 of [TLS13]. defined in Section 6 of [TLS13].
A TLS alert is converted into a QUIC connection error. The alert A TLS alert is converted into a QUIC connection error. The alert
description is added to 0x100 to produce a QUIC error code from the description is added to 0x100 to produce a QUIC error code from the
range reserved for CRYPTO_ERROR. The resulting value is sent in a range reserved for CRYPTO_ERROR. The resulting value is sent in a
QUIC CONNECTION_CLOSE frame of type 0x1c. QUIC CONNECTION_CLOSE frame of type 0x1c.
The alert level of all TLS alerts is "fatal"; a TLS stack MUST NOT The alert level of all TLS alerts is "fatal"; a TLS stack MUST NOT
generate alerts at the "warning" level. generate alerts at the "warning" level.
QUIC permits the use of a generic code in place of a specific error QUIC permits the use of a generic code in place of a specific error
code; see Section 11 of [QUIC-TRANSPORT]. For TLS alerts, this code; see Section 11 of [QUIC-TRANSPORT]. For TLS alerts, this
includes replacing any alert with a generic alert, such as includes replacing any alert with a generic alert, such as
handshake_failure (0x128 in QUIC). Endpoints MAY use a generic error handshake_failure (0x128 in QUIC). Endpoints MAY use a generic error
code to avoid possibly exposing confidential information. code to avoid possibly exposing confidential information.
4.11. Discarding Unused Keys 4.9. Discarding Unused Keys
After QUIC moves to a new encryption level, packet protection keys After QUIC moves to a new encryption level, packet protection keys
for previous encryption levels can be discarded. This occurs several for previous encryption levels can be discarded. This occurs several
times during the handshake, as well as when keys are updated; see times during the handshake, as well as when keys are updated; see
Section 6. Section 6.
Packet protection keys are not discarded immediately when new keys Packet protection keys are not discarded immediately when new keys
are available. If packets from a lower encryption level contain are available. If packets from a lower encryption level contain
CRYPTO frames, frames that retransmit that data MUST be sent at the CRYPTO frames, frames that retransmit that data MUST be sent at the
same encryption level. Similarly, an endpoint generates same encryption level. Similarly, an endpoint generates
skipping to change at page 20, line 18 skipping to change at page 21, line 40
have been acknowledged by its peer. However, this does not guarantee have been acknowledged by its peer. However, this does not guarantee
that no further packets will need to be received or sent at that that no further packets will need to be received or sent at that
encryption level because a peer might not have received all the encryption level because a peer might not have received all the
acknowledgements necessary to reach the same state. acknowledgements necessary to reach the same state.
Though an endpoint might retain older keys, new data MUST be sent at Though an endpoint might retain older keys, new data MUST be sent at
the highest currently-available encryption level. Only ACK frames the highest currently-available encryption level. Only ACK frames
and retransmissions of data in CRYPTO frames are sent at a previous and retransmissions of data in CRYPTO frames are sent at a previous
encryption level. These packets MAY also include PADDING frames. encryption level. These packets MAY also include PADDING frames.
4.11.1. Discarding Initial Keys 4.9.1. Discarding Initial Keys
Packets protected with Initial secrets (Section 5.2) are not Packets protected with Initial secrets (Section 5.2) are not
authenticated, meaning that an attacker could spoof packets with the authenticated, meaning that an attacker could spoof packets with the
intent to disrupt a connection. To limit these attacks, Initial intent to disrupt a connection. To limit these attacks, Initial
packet protection keys can be discarded more aggressively than other packet protection keys can be discarded more aggressively than other
keys. keys.
The successful use of Handshake packets indicates that no more The successful use of Handshake packets indicates that no more
Initial packets need to be exchanged, as these keys can only be Initial packets need to be exchanged, as these keys can only be
produced after receiving all CRYPTO frames from Initial packets. produced after receiving all CRYPTO frames from Initial packets.
Thus, a client MUST discard Initial keys when it first sends a Thus, a client MUST discard Initial keys when it first sends a
Handshake packet and a server MUST discard Initial keys when it first Handshake packet and a server MUST discard Initial keys when it first
successfully processes a Handshake packet. Endpoints MUST NOT send successfully processes a Handshake packet. Endpoints MUST NOT send
Initial packets after this point. Initial packets after this point.
This results in abandoning loss recovery state for the Initial This results in abandoning loss recovery state for the Initial
encryption level and ignoring any outstanding Initial packets. encryption level and ignoring any outstanding Initial packets.
4.11.2. Discarding Handshake Keys 4.9.2. Discarding Handshake Keys
An endpoint MUST discard its handshake keys when the TLS handshake is An endpoint MUST discard its handshake keys when the TLS handshake is
confirmed (Section 4.1.2). The server MUST send a HANDSHAKE_DONE confirmed (Section 4.1.2). The server MUST send a HANDSHAKE_DONE
frame as soon as it completes the handshake. frame as soon as it completes the handshake.
4.11.3. Discarding 0-RTT Keys 4.9.3. Discarding 0-RTT Keys
0-RTT and 1-RTT packets share the same packet number space, and 0-RTT and 1-RTT packets share the same packet number space, and
clients do not send 0-RTT packets after sending a 1-RTT packet clients do not send 0-RTT packets after sending a 1-RTT packet
(Section 5.6). (Section 5.6).
Therefore, a client SHOULD discard 0-RTT keys as soon as it installs Therefore, a client SHOULD discard 0-RTT keys as soon as it installs
1-RTT keys, since they have no use after that moment. 1-RTT keys, since they have no use after that moment.
Additionally, a server MAY discard 0-RTT keys as soon as it receives Additionally, a server MAY discard 0-RTT keys as soon as it receives
a 1-RTT packet. However, due to packet reordering, a 0-RTT packet a 1-RTT packet. However, due to packet reordering, a 0-RTT packet
skipping to change at page 21, line 19 skipping to change at page 22, line 45
their contents to be retransmitted with 1-RTT keys. After receiving their contents to be retransmitted with 1-RTT keys. After receiving
a 1-RTT packet, servers MUST discard 0-RTT keys within a short time; a 1-RTT packet, servers MUST discard 0-RTT keys within a short time;
the RECOMMENDED time period is three times the Probe Timeout (PTO, the RECOMMENDED time period is three times the Probe Timeout (PTO,
see [QUIC-RECOVERY]). A server MAY discard 0-RTT keys earlier if it see [QUIC-RECOVERY]). A server MAY discard 0-RTT keys earlier if it
determines that it has received all 0-RTT packets, which can be done determines that it has received all 0-RTT packets, which can be done
by keeping track of missing packet numbers. by keeping track of missing packet numbers.
5. Packet Protection 5. Packet Protection
As with TLS over TCP, QUIC protects packets with keys derived from As with TLS over TCP, QUIC protects packets with keys derived from
the TLS handshake, using the AEAD algorithm negotiated by TLS. the TLS handshake, using the AEAD algorithm [AEAD] negotiated by TLS.
QUIC packets have varying protections depending on their type:
* Version Negotiation packets have no cryptographic protection.
* Retry packets use AEAD_AES_128_GCM to provide protection against
accidental modification or insertion by off-path adversaries; see
Section 5.8.
* Initial packets use AEAD_AES_128_GCM with keys derived from the
Destination Connection ID field of the first Initial packet sent
by the client; see Section 5.2.
* All other packets have strong cryptographic protections for
confidentiality and integrity, using keys and algorithms
negotiated by TLS.
This section describes how packet protection is applied to Handshake
packets, 0-RTT packets, and 1-RTT packets. The same packet
protection process is applied to Initial packets. However, as it is
trivial to determine the keys used for Initial packets, these packets
are not considered to have confidentiality or integrity protection.
Retry packets use a fixed key and so similarly lack confidentiality
and integrity protection.
5.1. Packet Protection Keys 5.1. Packet Protection Keys
QUIC derives packet protection keys in the same way that TLS derives QUIC derives packet protection keys in the same way that TLS derives
record protection keys. record protection keys.
Each encryption level has separate secret values for protection of Each encryption level has separate secret values for protection of
packets sent in each direction. These traffic secrets are derived by packets sent in each direction. These traffic secrets are derived by
TLS (see Section 7.1 of [TLS13]) and are used by QUIC for all TLS (see Section 7.1 of [TLS13]) and are used by QUIC for all
encryption levels except the Initial encryption level. The secrets encryption levels except the Initial encryption level. The secrets
skipping to change at page 21, line 41 skipping to change at page 23, line 45
initial Destination Connection ID, as described in Section 5.2. initial Destination Connection ID, as described in Section 5.2.
The keys used for packet protection are computed from the TLS secrets The keys used for packet protection are computed from the TLS secrets
using the KDF provided by TLS. In TLS 1.3, the HKDF-Expand-Label using the KDF provided by TLS. In TLS 1.3, the HKDF-Expand-Label
function described in Section 7.1 of [TLS13] is used, using the hash function described in Section 7.1 of [TLS13] is used, using the hash
function from the negotiated cipher suite. Other versions of TLS function from the negotiated cipher suite. Other versions of TLS
MUST provide a similar function in order to be used with QUIC. MUST provide a similar function in order to be used with QUIC.
The current encryption level secret and the label "quic key" are The current encryption level secret and the label "quic key" are
input to the KDF to produce the AEAD key; the label "quic iv" is used input to the KDF to produce the AEAD key; the label "quic iv" is used
to derive the IV; see Section 5.3. The header protection key uses to derive the Initialization Vector (IV); see Section 5.3. The
the "quic hp" label; see Section 5.4. Using these labels provides header protection key uses the "quic hp" label; see Section 5.4.
key separation between QUIC and TLS; see Section 9.6. Using these labels provides key separation between QUIC and TLS; see
Section 9.6.
The KDF used for initial secrets is always the HKDF-Expand-Label The KDF used for initial secrets is always the HKDF-Expand-Label
function from TLS 1.3 (see Section 5.2). function from TLS 1.3; see Section 5.2.
5.2. Initial Secrets 5.2. Initial Secrets
Initial packets are protected with a secret derived from the Initial packets apply the packet protection process, but use a secret
Destination Connection ID field from the client's Initial packet. derived from the Destination Connection ID field from the client's
Specifically: first Initial packet.
This secret is determined by using HKDF-Extract (see Section 2.2 of
[HKDF]) with a salt of 0xafbfec289993d24c9e9786f19c6111e04390a899 and
a IKM of the Destination Connection ID field. This produces an
intermediate pseudorandom key (PRK) that is used to derive two
separate secrets for sending and receiving.
The secret used by clients to construct Initial packets uses the PRK
and the label "client in" as input to the HKDF-Expand-Label function
to produce a 32 byte secret; packets constructed by the server use
the same process with the label "server in". The hash function for
HKDF when deriving initial secrets and keys is SHA-256 [SHA].
This process in pseudocode is:
initial_salt = 0xafbfec289993d24c9e9786f19c6111e04390a899 initial_salt = 0xafbfec289993d24c9e9786f19c6111e04390a899
initial_secret = HKDF-Extract(initial_salt, initial_secret = HKDF-Extract(initial_salt,
client_dst_connection_id) client_dst_connection_id)
client_initial_secret = HKDF-Expand-Label(initial_secret, client_initial_secret = HKDF-Expand-Label(initial_secret,
"client in", "", "client in", "",
Hash.length) Hash.length)
server_initial_secret = HKDF-Expand-Label(initial_secret, server_initial_secret = HKDF-Expand-Label(initial_secret,
"server in", "", "server in", "",
Hash.length) Hash.length)
The hash function for HKDF when deriving initial secrets and keys is
SHA-256 [SHA].
The connection ID used with HKDF-Expand-Label is the Destination The connection ID used with HKDF-Expand-Label is the Destination
Connection ID in the Initial packet sent by the client. This will be Connection ID in the Initial packet sent by the client. This will be
a randomly-selected value unless the client creates the Initial a randomly-selected value unless the client creates the Initial
packet after receiving a Retry packet, where the Destination packet after receiving a Retry packet, where the Destination
Connection ID is selected by the server. Connection ID is selected by the server.
The value of initial_salt is a 20 byte sequence shown in the figure Future versions of QUIC SHOULD generate a new salt value, thus
in hexadecimal notation. Future versions of QUIC SHOULD generate a ensuring that the keys are different for each version of QUIC. This
new salt value, thus ensuring that the keys are different for each prevents a middlebox that recognizes only one version of QUIC from
version of QUIC. This prevents a middlebox that only recognizes one seeing or modifying the contents of packets from future versions.
version of QUIC from seeing or modifying the contents of packets from
future versions.
The HKDF-Expand-Label function defined in TLS 1.3 MUST be used for The HKDF-Expand-Label function defined in TLS 1.3 MUST be used for
Initial packets even where the TLS versions offered do not include Initial packets even where the TLS versions offered do not include
TLS 1.3. TLS 1.3.
The secrets used for protecting Initial packets change when a server The secrets used for constructing Initial packets change when a
sends a Retry packet to use the connection ID value selected by the server sends a Retry packet to use the connection ID value selected
server. The secrets do not change when a client changes the by the server. The secrets do not change when a client changes the
Destination Connection ID it uses in response to an Initial packet Destination Connection ID it uses in response to an Initial packet
from the server. from the server.
Note: The Destination Connection ID is of arbitrary length, and it Note: The Destination Connection ID is of arbitrary length, and it
could be zero length if the server sends a Retry packet with a could be zero length if the server sends a Retry packet with a
zero-length Source Connection ID field. In this case, the Initial zero-length Source Connection ID field. In this case, the Initial
keys provide no assurance to the client that the server received keys provide no assurance to the client that the server received
its packet; the client has to rely on the exchange that included its packet; the client has to rely on the exchange that included
the Retry packet for that property. the Retry packet for that property.
Appendix A contains test vectors for packet encryption. Appendix A contains sample Initial packets.
5.3. AEAD Usage 5.3. AEAD Usage
The Authentication Encryption with Associated Data (AEAD) [AEAD] The Authenticated Encryption with Associated Data (AEAD; see [AEAD])
function used for QUIC packet protection is the AEAD that is function used for QUIC packet protection is the AEAD that is
negotiated for use with the TLS connection. For example, if TLS is negotiated for use with the TLS connection. For example, if TLS is
using the TLS_AES_128_GCM_SHA256, the AEAD_AES_128_GCM function is using the TLS_AES_128_GCM_SHA256 cipher suite, the AEAD_AES_128_GCM
used. function is used.
Packets are protected prior to applying header protection
(Section 5.4). The unprotected packet header is part of the
associated data (A). When removing packet protection, an endpoint
first removes the header protection.
All QUIC packets other than Version Negotiation and Retry packets are
protected with an AEAD algorithm [AEAD]. Prior to establishing a
shared secret, packets are protected with AEAD_AES_128_GCM and a key
derived from the Destination Connection ID in the client's first
Initial packet (see Section 5.2). This provides protection against
off-path attackers and robustness against QUIC version unaware
middleboxes, but not against on-path attackers.
QUIC can use any of the ciphersuites defined in [TLS13] with the QUIC can use any of the cipher suites defined in [TLS13] with the
exception of TLS_AES_128_CCM_8_SHA256. A ciphersuite MUST NOT be exception of TLS_AES_128_CCM_8_SHA256. A cipher suite MUST NOT be
negotiated unless a header protection scheme is defined for the negotiated unless a header protection scheme is defined for the
ciphersuite. This document defines a header protection scheme for cipher suite. This document defines a header protection scheme for
all ciphersuites defined in [TLS13] aside from all cipher suites defined in [TLS13] aside from
TLS_AES_128_CCM_8_SHA256. These ciphersuites have a 16-byte TLS_AES_128_CCM_8_SHA256. These cipher suites have a 16-byte
authentication tag and produce an output 16 bytes larger than their authentication tag and produce an output 16 bytes larger than their
input. input.
Note: An endpoint MUST NOT reject a ClientHello that offers a Note: An endpoint MUST NOT reject a ClientHello that offers a cipher
ciphersuite that it does not support, or it would be impossible to suite that it does not support, or it would be impossible to
deploy a new ciphersuite. This also applies to deploy a new cipher suite. This also applies to
TLS_AES_128_CCM_8_SHA256. TLS_AES_128_CCM_8_SHA256.
When constructing packets, the AEAD function is applied prior to
applying header protection; see Section 5.4. The unprotected packet
header is part of the associated data (A). When processing packets,
an endpoint first removes the header protection.
The key and IV for the packet are computed as described in The key and IV for the packet are computed as described in
Section 5.1. The nonce, N, is formed by combining the packet Section 5.1. The nonce, N, is formed by combining the packet
protection IV with the packet number. The 62 bits of the protection IV with the packet number. The 62 bits of the
reconstructed QUIC packet number in network byte order are left- reconstructed QUIC packet number in network byte order are left-
padded with zeros to the size of the IV. The exclusive OR of the padded with zeros to the size of the IV. The exclusive OR of the
padded packet number and the IV forms the AEAD nonce. padded packet number and the IV forms the AEAD nonce.
The associated data, A, for the AEAD is the contents of the QUIC The associated data, A, for the AEAD is the contents of the QUIC
header, starting from the flags byte in either the short or long header, starting from the first byte of either the short or long
header, up to and including the unprotected packet number. header, up to and including the unprotected packet number.
The input plaintext, P, for the AEAD is the payload of the QUIC The input plaintext, P, for the AEAD is the payload of the QUIC
packet, as described in [QUIC-TRANSPORT]. packet, as described in [QUIC-TRANSPORT].
The output ciphertext, C, of the AEAD is transmitted in place of P. The output ciphertext, C, of the AEAD is transmitted in place of P.
Some AEAD functions have limits for how many packets can be encrypted Some AEAD functions have limits for how many packets can be encrypted
under the same key and IV (see for example [AEBounds]). This might under the same key and IV; see Section 6.6. This might be lower than
be lower than the packet number limit. An endpoint MUST initiate a the packet number limit. An endpoint MUST initiate a key update
key update (Section 6) prior to exceeding any limit set for the AEAD (Section 6) prior to exceeding any limit set for the AEAD that is in
that is in use. use.
5.4. Header Protection 5.4. Header Protection
Parts of QUIC packet headers, in particular the Packet Number field, Parts of QUIC packet headers, in particular the Packet Number field,
are protected using a key that is derived separate to the packet are protected using a key that is derived separately from the packet
protection key and IV. The key derived using the "quic hp" label is protection key and IV. The key derived using the "quic hp" label is
used to provide confidentiality protection for those fields that are used to provide confidentiality protection for those fields that are
not exposed to on-path elements. not exposed to on-path elements.
This protection applies to the least-significant bits of the first This protection applies to the least-significant bits of the first
byte, plus the Packet Number field. The four least-significant bits byte, plus the Packet Number field. The four least-significant bits
of the first byte are protected for packets with long headers; the of the first byte are protected for packets with long headers; the
five least significant bits of the first byte are protected for five least significant bits of the first byte are protected for
packets with short headers. For both header forms, this covers the packets with short headers. For both header forms, this covers the
reserved bits and the Packet Number Length field; the Key Phase bit reserved bits and the Packet Number Length field; the Key Phase bit
skipping to change at page 24, line 45 skipping to change at page 27, line 5
which do not contain a protected payload or any of the fields that which do not contain a protected payload or any of the fields that
are protected by this process. are protected by this process.
5.4.1. Header Protection Application 5.4.1. Header Protection Application
Header protection is applied after packet protection is applied (see Header protection is applied after packet protection is applied (see
Section 5.3). The ciphertext of the packet is sampled and used as Section 5.3). The ciphertext of the packet is sampled and used as
input to an encryption algorithm. The algorithm used depends on the input to an encryption algorithm. The algorithm used depends on the
negotiated AEAD. negotiated AEAD.
The output of this algorithm is a 5 byte mask which is applied to the The output of this algorithm is a 5-byte mask that is applied to the
protected header fields using exclusive OR. The least significant protected header fields using exclusive OR. The least significant
bits of the first byte of the packet are masked by the least bits of the first byte of the packet are masked by the least
significant bits of the first mask byte, and the packet number is significant bits of the first mask byte, and the packet number is
masked with the remaining bytes. Any unused bytes of mask that might masked with the remaining bytes. Any unused bytes of mask that might
result from a shorter packet number encoding are unused. result from a shorter packet number encoding are unused.
Figure 6 shows a sample algorithm for applying header protection. Figure 6 shows a sample algorithm for applying header protection.
Removing header protection only differs in the order in which the Removing header protection only differs in the order in which the
packet number length (pn_length) is determined. packet number length (pn_length) is determined.
skipping to change at page 26, line 41 skipping to change at page 28, line 41
Packet Number Length (2), # Protected Packet Number Length (2), # Protected
Destination Connection ID (0..160), Destination Connection ID (0..160),
Packet Number (8..32), # Protected Packet Number (8..32), # Protected
Protected Payload (0..24), # Skipped Part Protected Payload (0..24), # Skipped Part
Protected Payload (128), # Sampled Part Protected Payload (128), # Sampled Part
Protected Payload (..), # Remainder Protected Payload (..), # Remainder
} }
Figure 7: Header Protection and Ciphertext Sample Figure 7: Header Protection and Ciphertext Sample
Before a TLS ciphersuite can be used with QUIC, a header protection Before a TLS cipher suite can be used with QUIC, a header protection
algorithm MUST be specified for the AEAD used with that ciphersuite. algorithm MUST be specified for the AEAD used with that cipher suite.
This document defines algorithms for AEAD_AES_128_GCM, This document defines algorithms for AEAD_AES_128_GCM,
AEAD_AES_128_CCM, AEAD_AES_256_GCM (all AES AEADs are defined in AEAD_AES_128_CCM, AEAD_AES_256_GCM (all these AES AEADs are defined
[AEAD]), and AEAD_CHACHA20_POLY1305 [CHACHA]. Prior to TLS selecting in [AEAD]), and AEAD_CHACHA20_POLY1305 (defined in [CHACHA]). Prior
a ciphersuite, AES header protection is used (Section 5.4.3), to TLS selecting a cipher suite, AES header protection is used
matching the AEAD_AES_128_GCM packet protection. (Section 5.4.3), matching the AEAD_AES_128_GCM packet protection.
5.4.2. Header Protection Sample 5.4.2. Header Protection Sample
The header protection algorithm uses both the header protection key The header protection algorithm uses both the header protection key
and a sample of the ciphertext from the packet Payload field. and a sample of the ciphertext from the packet Payload field.
The same number of bytes are always sampled, but an allowance needs The same number of bytes are always sampled, but an allowance needs
to be made for the endpoint removing protection, which will not know to be made for the endpoint removing protection, which will not know
the length of the Packet Number field. In sampling the packet the length of the Packet Number field. In sampling the packet
ciphertext, the Packet Number field is assumed to be 4 bytes long ciphertext, the Packet Number field is assumed to be 4 bytes long
(its maximum possible encoded length). (its maximum possible encoded length).
An endpoint MUST discard packets that are not long enough to contain An endpoint MUST discard packets that are not long enough to contain
a complete sample. a complete sample.
To ensure that sufficient data is available for sampling, packets are To ensure that sufficient data is available for sampling, packets are
padded so that the combined lengths of the encoded packet number and padded so that the combined lengths of the encoded packet number and
protected payload is at least 4 bytes longer than the sample required protected payload is at least 4 bytes longer than the sample required
for header protection. The ciphersuites defined in [TLS13] - other for header protection. The cipher suites defined in [TLS13] - other
than TLS_AES_128_CCM_8_SHA256, for which a header protection scheme than TLS_AES_128_CCM_8_SHA256, for which a header protection scheme
is not defined in this document - have 16-byte expansions and 16-byte is not defined in this document - have 16-byte expansions and 16-byte
header protection samples. This results in needing at least 3 bytes header protection samples. This results in needing at least 3 bytes
of frames in the unprotected payload if the packet number is encoded of frames in the unprotected payload if the packet number is encoded
on a single byte, or 2 bytes of frames for a 2-byte packet number on a single byte, or 2 bytes of frames for a 2-byte packet number
encoding. encoding.
The sampled ciphertext for a packet with a short header can be The sampled ciphertext for a packet with a short header can be
determined by the following pseudocode: determined by the following pseudocode:
sample_offset = 1 + len(connection_id) + 4 sample_offset = 1 + len(connection_id) + 4
sample = packet[sample_offset..sample_offset+sample_length] sample = packet[sample_offset..sample_offset+sample_length]
For example, for a packet with a short header, an 8 byte connection For example, for a packet with a short header, an 8-byte connection
ID, and protected with AEAD_AES_128_GCM, the sample takes bytes 13 to ID, and protected with AEAD_AES_128_GCM, the sample takes bytes 13 to
28 inclusive (using zero-based indexing). 28 inclusive (using zero-based indexing).
A packet with a long header is sampled in the same way, noting that A packet with a long header is sampled in the same way, noting that
multiple QUIC packets might be included in the same UDP datagram and multiple QUIC packets might be included in the same UDP datagram and
that each one is handled separately. that each one is handled separately.
sample_offset = 7 + len(destination_connection_id) + sample_offset = 7 + len(destination_connection_id) +
len(source_connection_id) + len(source_connection_id) +
len(payload_length) + 4 len(payload_length) + 4
if packet_type == Initial: if packet_type == Initial:
sample_offset += len(token_length) + sample_offset += len(token_length) +
len(token) len(token)
sample = packet[sample_offset..sample_offset+sample_length] sample = packet[sample_offset..sample_offset+sample_length]
5.4.3. AES-Based Header Protection 5.4.3. AES-Based Header Protection
This section defines the packet protection algorithm for This section defines the packet protection algorithm for
AEAD_AES_128_GCM, AEAD_AES_128_CCM, and AEAD_AES_256_GCM. AEAD_AES_128_GCM, AEAD_AES_128_CCM, and AEAD_AES_256_GCM.
AEAD_AES_128_GCM and AEAD_AES_128_CCM use 128-bit AES [AES] in AEAD_AES_128_GCM and AEAD_AES_128_CCM use 128-bit AES in electronic
electronic code-book (ECB) mode. AEAD_AES_256_GCM uses 256-bit AES code-book (ECB) mode. AEAD_AES_256_GCM uses 256-bit AES in ECB mode.
in ECB mode. AES is defined in [AES].
This algorithm samples 16 bytes from the packet ciphertext. This This algorithm samples 16 bytes from the packet ciphertext. This
value is used as the input to AES-ECB. In pseudocode: value is used as the input to AES-ECB. In pseudocode:
mask = AES-ECB(hp_key, sample) mask = AES-ECB(hp_key, sample)
5.4.4. ChaCha20-Based Header Protection 5.4.4. ChaCha20-Based Header Protection
When AEAD_CHACHA20_POLY1305 is in use, header protection uses the raw When AEAD_CHACHA20_POLY1305 is in use, header protection uses the raw
ChaCha20 function as defined in Section 2.4 of [CHACHA]. This uses a ChaCha20 function as defined in Section 2.4 of [CHACHA]. This uses a
skipping to change at page 29, line 12 skipping to change at page 31, line 12
appears to trigger a key update, but cannot be unprotected appears to trigger a key update, but cannot be unprotected
successfully MUST be discarded. successfully MUST be discarded.
Failure to unprotect a packet does not necessarily indicate the Failure to unprotect a packet does not necessarily indicate the
existence of a protocol error in a peer or an attack. The truncated existence of a protocol error in a peer or an attack. The truncated
packet number encoding used in QUIC can cause packet numbers to be packet number encoding used in QUIC can cause packet numbers to be
decoded incorrectly if they are delayed significantly. decoded incorrectly if they are delayed significantly.
5.6. Use of 0-RTT Keys 5.6. Use of 0-RTT Keys
If 0-RTT keys are available (see Section 4.6), the lack of replay If 0-RTT keys are available (see Section 4.6.1), the lack of replay
protection means that restrictions on their use are necessary to protection means that restrictions on their use are necessary to
avoid replay attacks on the protocol. avoid replay attacks on the protocol.
A client MUST only use 0-RTT keys to protect data that is idempotent. A client MUST only use 0-RTT keys to protect data that is idempotent.
A client MAY wish to apply additional restrictions on what data it A client MAY wish to apply additional restrictions on what data it
sends prior to the completion of the TLS handshake. A client sends prior to the completion of the TLS handshake. A client
otherwise treats 0-RTT keys as equivalent to 1-RTT keys, except that otherwise treats 0-RTT keys as equivalent to 1-RTT keys, except that
it MUST NOT send ACKs with 0-RTT keys. it MUST NOT send ACKs with 0-RTT keys.
A client that receives an indication that its 0-RTT data has been A client that receives an indication that its 0-RTT data has been
skipping to change at page 30, line 19 skipping to change at page 32, line 19
* The client is not authenticated, unless the server has chosen to * The client is not authenticated, unless the server has chosen to
use a pre-shared key and validated the client's pre-shared key use a pre-shared key and validated the client's pre-shared key
binder; see Section 4.2.11 of [TLS13]. binder; see Section 4.2.11 of [TLS13].
* The client has not demonstrated liveness, unless a RETRY packet * The client has not demonstrated liveness, unless a RETRY packet
was used. was used.
* Any received 0-RTT data that the server responds to might be due * Any received 0-RTT data that the server responds to might be due
to a replay attack. to a replay attack.
Therefore, the server's use of 1-RTT keys MUST be limited to sending Therefore, the server's use of 1-RTT keys before the handshake is
data before the handshake is complete. A server MUST NOT process complete is limited to sending data. A server MUST NOT process
incoming 1-RTT protected packets before the TLS handshake is incoming 1-RTT protected packets before the TLS handshake is
complete. Because sending acknowledgments indicates that all frames complete. Because sending acknowledgments indicates that all frames
in a packet have been processed, a server cannot send acknowledgments in a packet have been processed, a server cannot send acknowledgments
for 1-RTT packets until the TLS handshake is complete. Received for 1-RTT packets until the TLS handshake is complete. Received
packets protected with 1-RTT keys MAY be stored and later decrypted packets protected with 1-RTT keys MAY be stored and later decrypted
and used once the handshake is complete. and used once the handshake is complete.
Note: TLS implementations might provide all 1-RTT secrets prior to Note: TLS implementations might provide all 1-RTT secrets prior to
handshake completion. Even where QUIC implementations have 1-RTT handshake completion. Even where QUIC implementations have 1-RTT
read keys, those keys cannot be used prior to completing the read keys, those keys cannot be used prior to completing the
handshake. handshake.
The requirement for the server to wait for the client Finished The requirement for the server to wait for the client Finished
message creates a dependency on that message being delivered. A message creates a dependency on that message being delivered. A
client can avoid the potential for head-of-line blocking that this client can avoid the potential for head-of-line blocking that this
implies by sending its 1-RTT packets coalesced with a handshake implies by sending its 1-RTT packets coalesced with a Handshake
packet containing a copy of the CRYPTO frame that carries the packet containing a copy of the CRYPTO frame that carries the
Finished message, until one of the handshake packets is acknowledged. Finished message, until one of the Handshake packets is acknowledged.
This enables immediate server processing for those packets. This enables immediate server processing for those packets.
A server could receive packets protected with 0-RTT keys prior to A server could receive packets protected with 0-RTT keys prior to
receiving a TLS ClientHello. The server MAY retain these packets for receiving a TLS ClientHello. The server MAY retain these packets for
later decryption in anticipation of receiving a ClientHello. later decryption in anticipation of receiving a ClientHello.
A client generally receives 1-RTT keys at the same time as the
handshake completes. Even if it has 1-RTT secrets, a client MUST NOT
process incoming 1-RTT protected packets before the TLS handshake is
complete.
5.8. Retry Packet Integrity 5.8. Retry Packet Integrity
Retry packets (see the Retry Packet section of [QUIC-TRANSPORT]) Retry packets (see the Retry Packet section of [QUIC-TRANSPORT])
carry a Retry Integrity Tag that provides two properties: it allows carry a Retry Integrity Tag that provides two properties: it allows
discarding packets that have accidentally been corrupted by the discarding packets that have accidentally been corrupted by the
network, and it diminishes off-path attackers' ability to send valid network, and it diminishes off-path attackers' ability to send valid
Retry packets. Retry packets.
The Retry Integrity Tag is a 128-bit field that is computed as the The Retry Integrity Tag is a 128-bit field that is computed as the
output of AEAD_AES_128_GCM [AEAD] used with the following inputs: output of AEAD_AES_128_GCM ([AEAD]) used with the following inputs:
* The secret key, K, is 128 bits equal to * The secret key, K, is 128 bits equal to
0xccce187ed09a09d05728155a6cb96be1. 0xccce187ed09a09d05728155a6cb96be1.
* The nonce, N, is 96 bits equal to 0xe54930f97f2136f0530a8c1c. * The nonce, N, is 96 bits equal to 0xe54930f97f2136f0530a8c1c.
* The plaintext, P, is empty. * The plaintext, P, is empty.
* The associated data, A, is the contents of the Retry Pseudo- * The associated data, A, is the contents of the Retry Pseudo-
Packet, as illustrated in Figure 8: Packet, as illustrated in Figure 8:
skipping to change at page 31, line 43 skipping to change at page 33, line 51
SCID Len (8), SCID Len (8),
Retry Token (..), Retry Token (..),
} }
Figure 8: Retry Pseudo-Packet Figure 8: Retry Pseudo-Packet
The Retry Pseudo-Packet is not sent over the wire. It is computed by The Retry Pseudo-Packet is not sent over the wire. It is computed by
taking the transmitted Retry packet, removing the Retry Integrity Tag taking the transmitted Retry packet, removing the Retry Integrity Tag
and prepending the two following fields: and prepending the two following fields:
ODCID Length: The ODCID Len contains the length in bytes of the ODCID Length: The ODCID Length field contains the length in bytes of
Original Destination Connection ID field that follows it, encoded the Original Destination Connection ID field that follows it,
as an 8-bit unsigned integer. encoded as an 8-bit unsigned integer.
Original Destination Connection ID: The Original Destination Original Destination Connection ID: The Original Destination
Connection ID contains the value of the Destination Connection ID Connection ID contains the value of the Destination Connection ID
from the Initial packet that this Retry is in response to. The from the Initial packet that this Retry is in response to. The
length of this field is given in ODCID Len. The presence of this length of this field is given in ODCID Length. The presence of
field mitigates an off-path attacker's ability to inject a Retry this field mitigates an off-path attacker's ability to inject a
packet. Retry packet.
6. Key Update 6. Key Update
Once the handshake is confirmed (see Section 4.1.2), an endpoint MAY Once the handshake is confirmed (see Section 4.1.2), an endpoint MAY
initiate a key update. initiate a key update.
The Key Phase bit indicates which packet protection keys are used to The Key Phase bit indicates which packet protection keys are used to
protect the packet. The Key Phase bit is initially set to 0 for the protect the packet. The Key Phase bit is initially set to 0 for the
first set of 1-RTT packets and toggled to signal each subsequent key first set of 1-RTT packets and toggled to signal each subsequent key
update. update.
The Key Phase bit allows a recipient to detect a change in keying The Key Phase bit allows a recipient to detect a change in keying
material without needing to receive the first packet that triggered material without needing to receive the first packet that triggered
the change. An endpoint that notices a changed Key Phase bit updates the change. An endpoint that notices a changed Key Phase bit updates
keys and decrypts the packet that contains the changed value. keys and decrypts the packet that contains the changed value.
This mechanism replaces the TLS KeyUpdate message. Endpoints MUST This mechanism replaces the TLS KeyUpdate message. Endpoints MUST
NOT send a TLS KeyUpdate message. Endpoints MUST treat the receipt NOT send a TLS KeyUpdate message. Endpoints MUST treat the receipt
of a TLS KeyUpdate message as a connection error of type 0x10a, of a TLS KeyUpdate message as a connection error of type 0x10a,
equivalent to a fatal TLS alert of unexpected_message (see equivalent to a fatal TLS alert of unexpected_message (see
Section 4.10). Section 4.8).
Figure 9 shows a key update process, where the initial set of keys Figure 9 shows a key update process, where the initial set of keys
used (identified with @M) are replaced by updated keys (identified used (identified with @M) are replaced by updated keys (identified
with @N). The value of the Key Phase bit is indicated in brackets with @N). The value of the Key Phase bit is indicated in brackets
[]. [].
Initiating Peer Responding Peer Initiating Peer Responding Peer
@M [0] QUIC Packets @M [0] QUIC Packets
skipping to change at page 33, line 27 skipping to change at page 35, line 49
used as: used as:
secret_<n+1> = HKDF-Expand-Label(secret_<n>, "quic ku", secret_<n+1> = HKDF-Expand-Label(secret_<n>, "quic ku",
"", Hash.length) "", Hash.length)
The endpoint toggles the value of the Key Phase bit and uses the The endpoint toggles the value of the Key Phase bit and uses the
updated key and IV to protect all subsequent packets. updated key and IV to protect all subsequent packets.
An endpoint MUST NOT initiate a key update prior to having confirmed An endpoint MUST NOT initiate a key update prior to having confirmed
the handshake (Section 4.1.2). An endpoint MUST NOT initiate a the handshake (Section 4.1.2). An endpoint MUST NOT initiate a
subsequent key update prior unless it has received an acknowledgment subsequent key update unless it has received an acknowledgment for a
for a packet that was sent protected with keys from the current key packet that was sent protected with keys from the current key phase.
phase. This ensures that keys are available to both peers before This ensures that keys are available to both peers before another key
another key update can be initiated. This can be implemented by update can be initiated. This can be implemented by tracking the
tracking the lowest packet number sent with each key phase, and the lowest packet number sent with each key phase, and the highest
highest acknowledged packet number in the 1-RTT space: once the acknowledged packet number in the 1-RTT space: once the latter is
latter is higher than or equal to the former, another key update can higher than or equal to the former, another key update can be
be initiated. initiated.
Note: Keys of packets other than the 1-RTT packets are never Note: Keys of packets other than the 1-RTT packets are never
updated; their keys are derived solely from the TLS handshake updated; their keys are derived solely from the TLS handshake
state. state.
The endpoint that initiates a key update also updates the keys that The endpoint that initiates a key update also updates the keys that
it uses for receiving packets. These keys will be needed to process it uses for receiving packets. These keys will be needed to process
packets the peer sends after updating. packets the peer sends after updating.
An endpoint SHOULD retain old keys so that packets sent by its peer An endpoint MUST retain old keys until it has successfully
prior to receiving the key update can be processed. Discarding old unprotected a packet sent using the new keys. An endpoint SHOULD
keys too early can cause delayed packets to be discarded. Discarding retain old keys for some time after unprotecting a packet sent using
packets will be interpreted as packet loss by the peer and could the new keys. Discarding old keys too early can cause delayed
adversely affect performance. packets to be discarded. Discarding packets will be interpreted as
packet loss by the peer and could adversely affect performance.
6.2. Responding to a Key Update 6.2. Responding to a Key Update
A peer is permitted to initiate a key update after receiving an A peer is permitted to initiate a key update after receiving an
acknowledgement of a packet in the current key phase. An endpoint acknowledgement of a packet in the current key phase. An endpoint
detects a key update when processing a packet with a key phase that detects a key update when processing a packet with a key phase that
differs from the value last used to protect the last packet it sent. differs from the value used to protect the last packet it sent. To
To process this packet, the endpoint uses the next packet protection process this packet, the endpoint uses the next packet protection key
key and IV. See Section 6.3 for considerations about generating and IV. See Section 6.3 for considerations about generating these
these keys. keys.
If a packet is successfully processed using the next key and IV, then If a packet is successfully processed using the next key and IV, then
the peer has initiated a key update. The endpoint MUST update its the peer has initiated a key update. The endpoint MUST update its
send keys to the corresponding key phase in response, as described in send keys to the corresponding key phase in response, as described in
Section 6.1. Sending keys MUST be updated before sending an Section 6.1. Sending keys MUST be updated before sending an
acknowledgement for the packet that was received with updated keys. acknowledgement for the packet that was received with updated keys.
By acknowledging the packet that triggered the key update in a packet By acknowledging the packet that triggered the key update in a packet
protected with the updated keys, the endpoint signals that the key protected with the updated keys, the endpoint signals that the key
update is complete. update is complete.
skipping to change at page 36, line 16 skipping to change at page 38, line 49
between previous, current, and next packet protection keys does not between previous, current, and next packet protection keys does not
expose a timing side channel that might reveal which keys were used expose a timing side channel that might reveal which keys were used
to remove packet protection. See Section 9.5 for more information. to remove packet protection. See Section 9.5 for more information.
Alternatively, endpoints can retain only two sets of packet Alternatively, endpoints can retain only two sets of packet
protection keys, swapping previous for next after enough time has protection keys, swapping previous for next after enough time has
passed to allow for reordering in the network. In this case, the Key passed to allow for reordering in the network. In this case, the Key
Phase bit alone can be used to select keys. Phase bit alone can be used to select keys.
An endpoint MAY allow a period of approximately the Probe Timeout An endpoint MAY allow a period of approximately the Probe Timeout
(PTO; see [QUIC-RECOVERY]) after a key update before it creates the (PTO; see [QUIC-RECOVERY]) after receiving a packet that uses the new
next set of packet protection keys. These updated keys MAY replace key generation before it creates the next set of packet protection
the previous keys at that time. With the caveat that PTO is a keys. These updated keys MAY replace the previous keys at that time.
subjective measure - that is, a peer could have a different view of With the caveat that PTO is a subjective measure - that is, a peer
the RTT - this time is expected to be long enough that any reordered could have a different view of the RTT - this time is expected to be
packets would be declared lost by a peer even if they were long enough that any reordered packets would be declared lost by a
acknowledged and short enough to allow for subsequent key updates. peer even if they were acknowledged and short enough to allow for
subsequent key updates.
Endpoints need to allow for the possibility that a peer might not be Endpoints need to allow for the possibility that a peer might not be
able to decrypt packets that initiate a key update during the period able to decrypt packets that initiate a key update during the period
when it retains old keys. Endpoints SHOULD wait three times the PTO when it retains old keys. Endpoints SHOULD wait three times the PTO
before initiating a key update after receiving an acknowledgment that before initiating a key update after receiving an acknowledgment that
confirms that the previous key update was received. Failing to allow confirms that the previous key update was received. Failing to allow
sufficient time could lead to packets being discarded. sufficient time could lead to packets being discarded.
An endpoint SHOULD retain old read keys for no more than three times An endpoint SHOULD retain old read keys for no more than three times
the PTO. After this period, old read keys and their corresponding the PTO after having received a packet protected using the new keys.
secrets SHOULD be discarded. After this period, old read keys and their corresponding secrets
SHOULD be discarded.
6.6. Minimum Key Update Frequency 6.6. Limits on AEAD Usage
Key updates MUST be initiated before usage limits on packet This document sets usage limits for AEAD algorithms to ensure that
protection keys are exceeded. For the cipher suites mentioned in overuse does not give an adversary a disproportionate advantage in
this document, the limits in Section 5.5 of [TLS13] apply. [TLS13] attacking the confidentiality and integrity of communications when
does not specify a limit for AEAD_AES_128_CCM, but the analysis in using QUIC.
Appendix B shows that a limit of 2^23 packets can be used to obtain
the same confidentiality protection as the limits specified in TLS.
The usage limits defined in TLS 1.3 exist for protection against The usage limits defined in TLS 1.3 exist for protection against
attacks on confidentiality and apply to successful applications of attacks on confidentiality and apply to successful applications of
AEAD protection. The integrity protections in authenticated AEAD protection. The integrity protections in authenticated
encryption also depend on limiting the number of attempts to forge encryption also depend on limiting the number of attempts to forge
packets. TLS achieves this by closing connections after any record packets. TLS achieves this by closing connections after any record
fails an authentication check. In comparison, QUIC ignores any fails an authentication check. In comparison, QUIC ignores any
packet that cannot be authenticated, allowing multiple forgery packet that cannot be authenticated, allowing multiple forgery
attempts. attempts.
Endpoints MUST count the number of received packets that fail QUIC accounts for AEAD confidentiality and integrity limits
authentication for each set of keys. If the number of packets that separately. The confidentiality limit applies to the number of
fail authentication with the same key exceeds a limit that is packets encrypted with a given key. The integrity limit applies to
specific to the AEAD in use, the endpoint MUST stop using those keys. the number of packets decrypted within a given connection. Details
Endpoints MUST initiate a key update before reaching this limit. If on enforcing these limits for each AEAD algorithm follow below.
a key update is not possible, the endpoint MUST immediately close the
connection. Applying a limit reduces the probability that an
attacker is able to successfully forge a packet; see [AEBounds] and
[ROBUST].
Note: Due to the way that header protection protects the Key Phase, Endpoints MUST count the number of encrypted packets for each set of
packets that are discarded are likely to have an even distribution keys. If the total number of encrypted packets with the same key
of both Key Phase values. This means that packets that fail exceeds the confidentiality limit for the selected AEAD, the endpoint
authentication will often use the packet protection keys from the MUST stop using those keys. Endpoints MUST initiate a key update
next key phase. It is therefore necessary to also track the before sending more protected packets than the confidentiality limit
number of packets that fail authentication with the next set of for the selected AEAD permits. If a key update is not possible or
packet protection keys. To avoid exhaustion of both sets of keys, integrity limits are reached, the endpoint MUST stop using the
it might be necessary to initiate two key updates in succession. connection and only send stateless resets in response to receiving
packets. It is RECOMMENDED that endpoints immediately close the
connection with a connection error of type AEAD_LIMIT_REACHED before
reaching a state where key updates are not possible.
For AEAD_AES_128_GCM, AEAD_AES_256_GCM, and AEAD_CHACHA20_POLY1305, For AEAD_AES_128_GCM and AEAD_AES_256_GCM, the confidentiality limit
the limit on the number of packets that fail authentication is 2^36. is 2^25 encrypted packets; see Appendix B.1. For
Note that the analysis in [AEBounds] supports a higher limit for the AEAD_CHACHA20_POLY1305, the confidentiality limit is greater than the
AEAD_AES_128_GCM and AEAD_AES_256_GCM, but this specification number of possible packets (2^62) and so can be disregarded. For
recommends a lower limit. For AEAD_AES_128_CCM, the limit on the AEAD_AES_128_CCM, the confidentiality limit is 2^23.5 encrypted
number of packets that fail authentication is 2^23.5; see Appendix B. packets; see Appendix B.2. Applying a limit reduces the probability
that an attacker can distinguish the AEAD in use from a random
permutation; see [AEBounds], [ROBUST], and [GCM-MU].
In addition to counting packets sent, endpoints MUST count the number
of received packets that fail authentication during the lifetime of a
connection. If the total number of received packets that fail
authentication within the connection, across all keys, exceeds the
integrity limit for the selected AEAD, the endpoint MUST immediately
close the connection with a connection error of type
AEAD_LIMIT_REACHED and not process any more packets.
For AEAD_AES_128_GCM and AEAD_AES_256_GCM, the integrity limit is
2^54 invalid packets; see Appendix B.1. For AEAD_CHACHA20_POLY1305,
the integrity limit is 2^36 invalid packets; see [AEBounds]. For
AEAD_AES_128_CCM, the integrity limit is 2^23.5 invalid packets; see
Appendix B.2. Applying this limit reduces the probability that an
attacker can successfully forge a packet; see [AEBounds], [ROBUST],
and [GCM-MU].
Future analyses and specifications MAY relax confidentiality or
integrity limits for an AEAD.
Note: These limits were originally calculated using assumptions Note: These limits were originally calculated using assumptions
about the limits on TLS record size. The maximum size of a TLS about the limits on TLS record size. The maximum size of a TLS
record is 2^14 bytes. In comparison, QUIC packets can be up to record is 2^14 bytes. In comparison, QUIC packets can be up to
2^16 bytes. However, it is expected that QUIC packets will 2^16 bytes. However, it is expected that QUIC packets will
generally be smaller than TLS records. Where packets might be generally be smaller than TLS records. Where packets might be
larger than 2^14 bytes in length, smaller limits might be needed. larger than 2^14 bytes in length, smaller limits might be needed.
Any TLS cipher suite that is specified for use with QUIC MUST define Any TLS cipher suite that is specified for use with QUIC MUST define
limits on the use of the associated AEAD function that preserves limits on the use of the associated AEAD function that preserves
margins for confidentiality and integrity. That is, limits MUST be margins for confidentiality and integrity. That is, limits MUST be
specified for the number of packets that can be authenticated and for specified for the number of packets that can be authenticated and for
the number packets that can fail authentication. Providing a the number of packets that can fail authentication. Providing a
reference to any analysis upon which values are based - and any reference to any analysis upon which values are based - and any
assumptions used in that analysis - allows limits to be adapted to assumptions used in that analysis - allows limits to be adapted to
varying usage conditions. varying usage conditions.
6.7. Key Update Error Code 6.7. Key Update Error Code
The KEY_UPDATE_ERROR error code (0xE) is used to signal errors The KEY_UPDATE_ERROR error code (0xe) is used to signal errors
related to key updates. related to key updates.
7. Security of Initial Messages 7. Security of Initial Messages
Initial packets are not protected with a secret key, so they are Initial packets are not protected with a secret key, so they are
subject to potential tampering by an attacker. QUIC provides subject to potential tampering by an attacker. QUIC provides
protection against attackers that cannot read packets, but does not protection against attackers that cannot read packets, but does not
attempt to provide additional protection against attacks where the attempt to provide additional protection against attacks where the
attacker can observe and inject packets. Some forms of tampering - attacker can observe and inject packets. Some forms of tampering -
such as modifying the TLS messages themselves - are detectable, but such as modifying the TLS messages themselves - are detectable, but
some - such as modifying ACKs - are not. some - such as modifying ACKs - are not.
For example, an attacker could inject a packet containing an ACK For example, an attacker could inject a packet containing an ACK
frame that makes it appear that a packet had not been received or to frame that makes it appear that a packet had not been received or to
create a false impression of the state of the connection (e.g., by create a false impression of the state of the connection (e.g., by
modifying the ACK Delay). Note that such a packet could cause a modifying the ACK Delay). Note that such a packet could cause a
legitimate packet to be dropped as a duplicate. Implementations legitimate packet to be dropped as a duplicate. Implementations
SHOULD use caution in relying on any data which is contained in SHOULD use caution in relying on any data that is contained in
Initial packets that is not otherwise authenticated. Initial packets that is not otherwise authenticated.
It is also possible for the attacker to tamper with data that is It is also possible for the attacker to tamper with data that is
carried in Handshake packets, but because that tampering requires carried in Handshake packets, but because that tampering requires
modifying TLS handshake messages, that tampering will cause the TLS modifying TLS handshake messages, that tampering will cause the TLS
handshake to fail. handshake to fail.
8. QUIC-Specific Adjustments to the TLS Handshake 8. QUIC-Specific Adjustments to the TLS Handshake
QUIC uses the TLS handshake for more than just negotiation of Certain aspects of the TLS handshake are different when used with
cryptographic parameters. The TLS handshake provides preliminary QUIC.
values for QUIC transport parameters and allows a server to perform
return routability checks on clients. QUIC also requires additional features from TLS. In addition to
negotiation of cryptographic parameters, the TLS handshake carries
and authenticates values for QUIC transport parameters.
8.1. Protocol Negotiation 8.1. Protocol Negotiation
QUIC requires that the cryptographic handshake provide authenticated QUIC requires that the cryptographic handshake provide authenticated
protocol negotiation. TLS uses Application Layer Protocol protocol negotiation. TLS uses Application Layer Protocol
Negotiation (ALPN) [ALPN] to select an application protocol. Unless Negotiation ([ALPN]) to select an application protocol. Unless
another mechanism is used for agreeing on an application protocol, another mechanism is used for agreeing on an application protocol,
endpoints MUST use ALPN for this purpose. endpoints MUST use ALPN for this purpose.
When using ALPN, endpoints MUST immediately close a connection (see When using ALPN, endpoints MUST immediately close a connection (see
Section 10.3 of [QUIC-TRANSPORT]) with a no_application_protocol TLS Section 10.2 of [QUIC-TRANSPORT]) with a no_application_protocol TLS
alert (QUIC error code 0x178; see Section 4.10) if an application alert (QUIC error code 0x178; see Section 4.8) if an application
protocol is not negotiated. While [ALPN] only specifies that servers protocol is not negotiated. While [ALPN] only specifies that servers
use this alert, QUIC clients MUST use error 0x178 to terminate a use this alert, QUIC clients MUST use error 0x178 to terminate a
connection when ALPN negotiation fails. connection when ALPN negotiation fails.
An application protocol MAY restrict the QUIC versions that it can An application protocol MAY restrict the QUIC versions that it can
operate over. Servers MUST select an application protocol compatible operate over. Servers MUST select an application protocol compatible
with the QUIC version that the client has selected. The server MUST with the QUIC version that the client has selected. The server MUST
treat the inability to select a compatible application protocol as a treat the inability to select a compatible application protocol as a
connection error of type 0x178 (no_application_protocol). Similarly, connection error of type 0x178 (no_application_protocol). Similarly,
a client MUST treat the selection of an incompatible application a client MUST treat the selection of an incompatible application
skipping to change at page 39, line 32 skipping to change at page 42, line 51
The extension_data field of the quic_transport_parameters extension The extension_data field of the quic_transport_parameters extension
contains a value that is defined by the version of QUIC that is in contains a value that is defined by the version of QUIC that is in
use. use.
The quic_transport_parameters extension is carried in the ClientHello The quic_transport_parameters extension is carried in the ClientHello
and the EncryptedExtensions messages during the handshake. Endpoints and the EncryptedExtensions messages during the handshake. Endpoints
MUST send the quic_transport_parameters extension; endpoints that MUST send the quic_transport_parameters extension; endpoints that
receive ClientHello or EncryptedExtensions messages without the receive ClientHello or EncryptedExtensions messages without the
quic_transport_parameters extension MUST close the connection with an quic_transport_parameters extension MUST close the connection with an
error of type 0x16d (equivalent to a fatal TLS missing_extension error of type 0x16d (equivalent to a fatal TLS missing_extension
alert, see Section 4.10). alert, see Section 4.8).
While the transport parameters are technically available prior to the While the transport parameters are technically available prior to the
completion of the handshake, they cannot be fully trusted until the completion of the handshake, they cannot be fully trusted until the
handshake completes, and reliance on them should be minimized. handshake completes, and reliance on them should be minimized.
However, any tampering with the parameters will cause the handshake However, any tampering with the parameters will cause the handshake
to fail. to fail.
Endpoints MUST NOT send this extension in a TLS connection that does Endpoints MUST NOT send this extension in a TLS connection that does
not use QUIC (such as the use of TLS with TCP defined in [TLS13]). A not use QUIC (such as the use of TLS with TCP defined in [TLS13]). A
fatal unsupported_extension alert MUST be sent by an implementation fatal unsupported_extension alert MUST be sent by an implementation
skipping to change at page 41, line 20 skipping to change at page 44, line 36
QUIC is not vulnerable to replay attack, except via the application QUIC is not vulnerable to replay attack, except via the application
protocol information it might carry. The management of QUIC protocol protocol information it might carry. The management of QUIC protocol
state based on the frame types defined in [QUIC-TRANSPORT] is not state based on the frame types defined in [QUIC-TRANSPORT] is not
vulnerable to replay. Processing of QUIC frames is idempotent and vulnerable to replay. Processing of QUIC frames is idempotent and
cannot result in invalid connection states if frames are replayed, cannot result in invalid connection states if frames are replayed,
reordered or lost. QUIC connections do not produce effects that last reordered or lost. QUIC connections do not produce effects that last
beyond the lifetime of the connection, except for those produced by beyond the lifetime of the connection, except for those produced by
the application protocol that QUIC serves. the application protocol that QUIC serves.
Note: TLS session tickets and address validation tokens are used to Note: TLS session tickets and address validation tokens are used to
carry QUIC configuration information between connections. These carry QUIC configuration information between connections.
MUST NOT be used to carry application semantics. The potential Specifically, to enable a server to efficiently recover state that
for reuse of these tokens means that they require stronger is used in connection establishment and address validation. These
protections against replay. MUST NOT be used to communicate application semantics between
endpoints; clients MUST treat them as opaque values. The
potential for reuse of these tokens means that they require
stronger protections against replay.
A server that accepts 0-RTT on a connection incurs a higher cost than A server that accepts 0-RTT on a connection incurs a higher cost than
accepting a connection without 0-RTT. This includes higher accepting a connection without 0-RTT. This includes higher
processing and computation costs. Servers need to consider the processing and computation costs. Servers need to consider the
probability of replay and all associated costs when accepting 0-RTT. probability of replay and all associated costs when accepting 0-RTT.
Ultimately, the responsibility for managing the risks of replay Ultimately, the responsibility for managing the risks of replay
attacks with 0-RTT lies with an application protocol. An application attacks with 0-RTT lies with an application protocol. An application
protocol that uses QUIC MUST describe how the protocol uses 0-RTT and protocol that uses QUIC MUST describe how the protocol uses 0-RTT and
the measures that are employed to protect against replay attack. An the measures that are employed to protect against replay attack. An
skipping to change at page 42, line 8 skipping to change at page 45, line 29
9.3. Packet Reflection Attack Mitigation 9.3. Packet Reflection Attack Mitigation
A small ClientHello that results in a large block of handshake A small ClientHello that results in a large block of handshake
messages from a server can be used in packet reflection attacks to messages from a server can be used in packet reflection attacks to
amplify the traffic generated by an attacker. amplify the traffic generated by an attacker.
QUIC includes three defenses against this attack. First, the packet QUIC includes three defenses against this attack. First, the packet
containing a ClientHello MUST be padded to a minimum size. Second, containing a ClientHello MUST be padded to a minimum size. Second,
if responding to an unverified source address, the server is if responding to an unverified source address, the server is
forbidden to send more than three UDP datagrams in its first flight forbidden to send more than three times as many bytes as the number
(see Section 8.1 of [QUIC-TRANSPORT]). Finally, because of bytes it has received (see Section 8.1 of [QUIC-TRANSPORT]).
acknowledgements of Handshake packets are authenticated, a blind Finally, because acknowledgements of Handshake packets are
attacker cannot forge them. Put together, these defenses limit the authenticated, a blind attacker cannot forge them. Put together,
level of amplification. these defenses limit the level of amplification.
9.4. Header Protection Analysis 9.4. Header Protection Analysis
[NAN] analyzes authenticated encryption algorithms which provide [NAN] analyzes authenticated encryption algorithms that provide nonce
nonce privacy, referred to as "Hide Nonce" (HN) transforms. The privacy, referred to as "Hide Nonce" (HN) transforms. The general
general header protection construction in this document is one of header protection construction in this document is one of those
those algorithms (HN1). Header protection uses the output of the algorithms (HN1). Header protection uses the output of the packet
packet protection AEAD to derive "sample", and then encrypts the protection AEAD to derive "sample", and then encrypts the header
header field using a pseudorandom function (PRF) as follows: field using a pseudorandom function (PRF) as follows:
protected_field = field XOR PRF(hp_key, sample) protected_field = field XOR PRF(hp_key, sample)
The header protection variants in this document use a pseudorandom The header protection variants in this document use a pseudorandom
permutation (PRP) in place of a generic PRF. However, since all PRPs permutation (PRP) in place of a generic PRF. However, since all PRPs
are also PRFs [IMC], these variants do not deviate from the HN1 are also PRFs [IMC], these variants do not deviate from the HN1
construction. construction.
As "hp_key" is distinct from the packet protection key, it follows As "hp_key" is distinct from the packet protection key, it follows
that header protection achieves AE2 security as defined in [NAN] and that header protection achieves AE2 security as defined in [NAN] and
skipping to change at page 43, line 9 skipping to change at page 46, line 29
To prevent an attacker from modifying packet headers, the header is To prevent an attacker from modifying packet headers, the header is
transitively authenticated using packet protection; the entire packet transitively authenticated using packet protection; the entire packet
header is part of the authenticated additional data. Protected header is part of the authenticated additional data. Protected
fields that are falsified or modified can only be detected once the fields that are falsified or modified can only be detected once the
packet protection is removed. packet protection is removed.
9.5. Header Protection Timing Side-Channels 9.5. Header Protection Timing Side-Channels
An attacker could guess values for packet numbers or Key Phase and An attacker could guess values for packet numbers or Key Phase and
have an endpoint confirm guesses through timing side channels. have an endpoint confirm guesses through timing side channels.
Similarly, guesses for the packet number length can be trialed and Similarly, guesses for the packet number length can be tried and
exposed. If the recipient of a packet discards packets with exposed. If the recipient of a packet discards packets with
duplicate packet numbers without attempting to remove packet duplicate packet numbers without attempting to remove packet
protection they could reveal through timing side-channels that the protection they could reveal through timing side-channels that the
packet number matches a received packet. For authentication to be packet number matches a received packet. For authentication to be
free from side-channels, the entire process of header protection free from side-channels, the entire process of header protection
removal, packet number recovery, and packet protection removal MUST removal, packet number recovery, and packet protection removal MUST
be applied together without timing and other side-channels. be applied together without timing and other side-channels.
For the sending of packets, construction and protection of packet For the sending of packets, construction and protection of packet
payloads and packet numbers MUST be free from side-channels that payloads and packet numbers MUST be free from side-channels that
skipping to change at page 44, line 26 skipping to change at page 47, line 47
This document does not create any new IANA registries, but it This document does not create any new IANA registries, but it
registers the values in the following registries: registers the values in the following registries:
* TLS ExtensionType Values Registry [TLS-REGISTRIES] - IANA is to * TLS ExtensionType Values Registry [TLS-REGISTRIES] - IANA is to
register the quic_transport_parameters extension found in register the quic_transport_parameters extension found in
Section 8.2. The Recommended column is to be marked Yes. The TLS Section 8.2. The Recommended column is to be marked Yes. The TLS
1.3 Column is to include CH and EE. 1.3 Column is to include CH and EE.
* QUIC Transport Error Codes Registry [QUIC-TRANSPORT] - IANA is to * QUIC Transport Error Codes Registry [QUIC-TRANSPORT] - IANA is to
register the KEY_UPDATE_ERROR (0xE), as described in Section 6.7. register the KEY_UPDATE_ERROR (0xe), as described in Section 6.7.
11. References 11. References
11.1. Normative References 11.1. Normative References
[AEAD] McGrew, D., "An Interface and Algorithms for Authenticated [AEAD] McGrew, D., "An Interface and Algorithms for Authenticated
Encryption", RFC 5116, DOI 10.17487/RFC5116, January 2008, Encryption", RFC 5116, DOI 10.17487/RFC5116, January 2008,
<https://www.rfc-editor.org/info/rfc5116>. <https://www.rfc-editor.org/info/rfc5116>.
[AES] "Advanced encryption standard (AES)", [AES] "Advanced encryption standard (AES)",
skipping to change at page 45, line 5 skipping to change at page 48, line 23
[ALPN] Friedl, S., Popov, A., Langley, A., and E. Stephan, [ALPN] Friedl, S., Popov, A., Langley, A., and E. Stephan,
"Transport Layer Security (TLS) Application-Layer Protocol "Transport Layer Security (TLS) Application-Layer Protocol
Negotiation Extension", RFC 7301, DOI 10.17487/RFC7301, Negotiation Extension", RFC 7301, DOI 10.17487/RFC7301,
July 2014, <https://www.rfc-editor.org/info/rfc7301>. July 2014, <https://www.rfc-editor.org/info/rfc7301>.
[CHACHA] Nir, Y. and A. Langley, "ChaCha20 and Poly1305 for IETF [CHACHA] Nir, Y. and A. Langley, "ChaCha20 and Poly1305 for IETF
Protocols", RFC 8439, DOI 10.17487/RFC8439, June 2018, Protocols", RFC 8439, DOI 10.17487/RFC8439, June 2018,
<https://www.rfc-editor.org/info/rfc8439>. <https://www.rfc-editor.org/info/rfc8439>.
[HKDF] Krawczyk, H. and P. Eronen, "HMAC-based Extract-and-Expand
Key Derivation Function (HKDF)", RFC 5869,
DOI 10.17487/RFC5869, May 2010,
<https://www.rfc-editor.org/info/rfc5869>.
[QUIC-RECOVERY] [QUIC-RECOVERY]
Iyengar, J., Ed. and I. Swett, Ed., "QUIC Loss Detection Iyengar, J., Ed. and I. Swett, Ed., "QUIC Loss Detection
and Congestion Control", Work in Progress, Internet-Draft, and Congestion Control", Work in Progress, Internet-Draft,
draft-ietf-quic-recovery-29, 9 June 2020, draft-ietf-quic-recovery-30, September 10, 2020,
<https://tools.ietf.org/html/draft-ietf-quic-recovery-29>. <https://tools.ietf.org/html/draft-ietf-quic-recovery-30>.
[QUIC-TRANSPORT] [QUIC-TRANSPORT]
Iyengar, J., Ed. and M. Thomson, Ed., "QUIC: A UDP-Based Iyengar, J., Ed. and M. Thomson, Ed., "QUIC: A UDP-Based
Multiplexed and Secure Transport", Work in Progress, Multiplexed and Secure Transport", Work in Progress,
Internet-Draft, draft-ietf-quic-transport-29, 9 June 2020, Internet-Draft, draft-ietf-quic-transport-30, September
<https://tools.ietf.org/html/draft-ietf-quic-transport- 10, 2020, <https://tools.ietf.org/html/draft-ietf-quic-
29>. transport-30>.
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119, Requirement Levels", BCP 14, RFC 2119,
DOI 10.17487/RFC2119, March 1997, DOI 10.17487/RFC2119, March 1997,
<https://www.rfc-editor.org/info/rfc2119>. <https://www.rfc-editor.org/info/rfc2119>.
[RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC
2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174,
May 2017, <https://www.rfc-editor.org/info/rfc8174>. May 2017, <https://www.rfc-editor.org/info/rfc8174>.
skipping to change at page 45, line 44 skipping to change at page 49, line 22
and DTLS", RFC 8447, DOI 10.17487/RFC8447, August 2018, and DTLS", RFC 8447, DOI 10.17487/RFC8447, August 2018,
<https://www.rfc-editor.org/info/rfc8447>. <https://www.rfc-editor.org/info/rfc8447>.
[TLS13] Rescorla, E., "The Transport Layer Security (TLS) Protocol [TLS13] Rescorla, E., "The Transport Layer Security (TLS) Protocol
Version 1.3", RFC 8446, DOI 10.17487/RFC8446, August 2018, Version 1.3", RFC 8446, DOI 10.17487/RFC8446, August 2018,
<https://www.rfc-editor.org/info/rfc8446>. <https://www.rfc-editor.org/info/rfc8446>.
11.2. Informative References 11.2. Informative References
[AEBounds] Luykx, A. and K. Paterson, "Limits on Authenticated [AEBounds] Luykx, A. and K. Paterson, "Limits on Authenticated
Encryption Use in TLS", 8 March 2016, Encryption Use in TLS", March 8, 2016,
<http://www.isg.rhul.ac.uk/~kp/TLS-AEbounds.pdf>. <http://www.isg.rhul.ac.uk/~kp/TLS-AEbounds.pdf>.
[CCM-ANALYSIS] [CCM-ANALYSIS]
Jonsson, J., "On the Security of CTR + CBC-MAC", Jonsson, J., "On the Security of CTR + CBC-MAC",
DOI 10.1007/3-540-36492-7_7, Selected Areas in DOI 10.1007/3-540-36492-7_7, Selected Areas in
Cryptography pp. 76-93, 2003, Cryptography pp. 76-93, 2003,
<https://doi.org/10.1007/3-540-36492-7_7>. <https://doi.org/10.1007/3-540-36492-7_7>.
[COMPRESS] Ghedini, A. and V. Vasiliev, "TLS Certificate
Compression", Work in Progress, Internet-Draft, draft-
ietf-tls-certificate-compression-10, January 6, 2020,
<http://www.ietf.org/internet-drafts/draft-ietf-tls-
certificate-compression-10.txt>.
[GCM-MU] Hoang, V., Tessaro, S., and A. Thiruvengadam, "The Multi-
user Security of GCM, Revisited",
DOI 10.1145/3243734.3243816, Proceedings of the 2018 ACM
SIGSAC Conference on Computer and Communications Security,
January 2018, <https://doi.org/10.1145/3243734.3243816>.
[HTTP2-TLS13] [HTTP2-TLS13]
Benjamin, D., "Using TLS 1.3 with HTTP/2", RFC 8740, Benjamin, D., "Using TLS 1.3 with HTTP/2", RFC 8740,
DOI 10.17487/RFC8740, February 2020, DOI 10.17487/RFC8740, February 2020,
<https://www.rfc-editor.org/info/rfc8740>. <https://www.rfc-editor.org/info/rfc8740>.
[IMC] Katz, J. and Y. Lindell, "Introduction to Modern [IMC] Katz, J. and Y. Lindell, "Introduction to Modern
Cryptography, Second Edition", ISBN 978-1466570269, 6 Cryptography, Second Edition", ISBN 978-1466570269,
November 2014. November 6, 2014.
[NAN] Bellare, M., Ng, R., and B. Tackmann, "Nonces Are Noticed: [NAN] Bellare, M., Ng, R., and B. Tackmann, "Nonces Are Noticed:
AEAD Revisited", DOI 10.1007/978-3-030-26948-7_9, Advances AEAD Revisited", DOI 10.1007/978-3-030-26948-7_9, Advances
in Cryptology - CRYPTO 2019 pp. 235-265, 2019, in Cryptology - CRYPTO 2019 pp. 235-265, 2019,
<https://doi.org/10.1007/978-3-030-26948-7_9>. <https://doi.org/10.1007/978-3-030-26948-7_9>.
[QUIC-HTTP] [QUIC-HTTP]
Bishop, M., Ed., "Hypertext Transfer Protocol Version 3 Bishop, M., Ed., "Hypertext Transfer Protocol Version 3
(HTTP/3)", Work in Progress, Internet-Draft, draft-ietf- (HTTP/3)", Work in Progress, Internet-Draft, draft-ietf-
quic-http-29, 9 June 2020, quic-http-30, September 10, 2020,
<https://tools.ietf.org/html/draft-ietf-quic-http-29>. <https://tools.ietf.org/html/draft-ietf-quic-http-30>.
[RFC2818] Rescorla, E., "HTTP Over TLS", RFC 2818, [RFC2818] Rescorla, E., "HTTP Over TLS", RFC 2818,
DOI 10.17487/RFC2818, May 2000, DOI 10.17487/RFC2818, May 2000,
<https://www.rfc-editor.org/info/rfc2818>. <https://www.rfc-editor.org/info/rfc2818>.
[RFC5280] Cooper, D., Santesson, S., Farrell, S., Boeyen, S., [RFC5280] Cooper, D., Santesson, S., Farrell, S., Boeyen, S.,
Housley, R., and W. Polk, "Internet X.509 Public Key Housley, R., and W. Polk, "Internet X.509 Public Key
Infrastructure Certificate and Certificate Revocation List Infrastructure Certificate and Certificate Revocation List
(CRL) Profile", RFC 5280, DOI 10.17487/RFC5280, May 2008, (CRL) Profile", RFC 5280, DOI 10.17487/RFC5280, May 2008,
<https://www.rfc-editor.org/info/rfc5280>. <https://www.rfc-editor.org/info/rfc5280>.
[ROBUST] Fischlin, M., Günther, F., and C. Janson, "Robust [ROBUST] Fischlin, M., Günther, F., and C. Janson, "Robust
Channels: Handling Unreliable Networks in the Record Channels: Handling Unreliable Networks in the Record
Layers of QUIC and DTLS", 21 February 2020, Layers of QUIC and DTLS 1.3", May 16, 2020,
<https://www.felixguenther.info/docs/ <https://eprint.iacr.org/2020/718>.
QUIPS2020_RobustChannels.pdf>.
Appendix A. Sample Packet Protection Appendix A. Sample Packet Protection
This section shows examples of packet protection so that This section shows examples of packet protection so that
implementations can be verified incrementally. Samples of Initial implementations can be verified incrementally. Samples of Initial
packets from both client and server, plus a Retry packet are defined. packets from both client and server, plus a Retry packet are defined.
These packets use an 8-byte client-chosen Destination Connection ID These packets use an 8-byte client-chosen Destination Connection ID
of 0x8394c8f03e515708. Some intermediate values are included. All of 0x8394c8f03e515708. Some intermediate values are included. All
values are shown in hexadecimal. values are shown in hexadecimal.
skipping to change at page 48, line 25 skipping to change at page 52, line 5
hp = HKDF-Expand-Label(server_initial_secret, "quic hp", _, 16) hp = HKDF-Expand-Label(server_initial_secret, "quic hp", _, 16)
= c0c499a65a60024a18a250974ea01dfa = c0c499a65a60024a18a250974ea01dfa
A.2. Client Initial A.2. Client Initial
The client sends an Initial packet. The unprotected payload of this The client sends an Initial packet. The unprotected payload of this
packet contains the following CRYPTO frame, plus enough PADDING packet contains the following CRYPTO frame, plus enough PADDING
frames to make a 1162 byte payload: frames to make a 1162 byte payload:
060040c4010000c003036660261ff947 cea49cce6cfad687f457cf1b14531ba1 060040f1010000ed0303ebf8fa56f129 39b9584a3896472ec40bb863cfd3e868
4131a0e8f309a1d0b9c4000006130113 031302010000910000000b0009000006 04fe3a47f06a2b69484c000004130113 02010000c000000010000e00000b6578
736572766572ff01000100000a001400 12001d00170018001901000101010201 616d706c652e636f6dff01000100000a 00080006001d00170018001000070005
03010400230000003300260024001d00 204cfdfcd178b784bf328cae793b136f 04616c706e0005000501000000000033 00260024001d00209370b2c9caa47fba
2aedce005ff183d7bb14952072366470 37002b0003020304000d0020001e0403 baf4559fedba753de171fa71f50f1ce1 5d43e994ec74d748002b000302030400
05030603020308040805080604010501 060102010402050206020202002d0002 0d0010000e0403050306030203080408 050806002d00020101001c00024001ff
0101001c00024001 a500320408ffffffffffffffff050480 00ffff07048000ffff08011001048000
75300901100f088394c8f03e51570806 048000ffff
The unprotected header includes the connection ID and a 4 byte packet The unprotected header includes the connection ID and a 4-byte packet
number encoding for a packet number of 2: number encoding for a packet number of 2:
c3ff00001d088394c8f03e5157080000449e00000002 c3ff00001d088394c8f03e5157080000449e00000002
Protecting the payload produces output that is sampled for header Protecting the payload produces output that is sampled for header
protection. Because the header uses a 4 byte packet number encoding, protection. Because the header uses a 4-byte packet number encoding,
the first 16 bytes of the protected payload is sampled, then applied the first 16 bytes of the protected payload is sampled, then applied
to the header: to the header:
sample = fb66bc5f93032b7ddd89fe0ff15d9c4f sample = fb66bc6a93032b50dd8973972d149421
mask = AES-ECB(hp, sample)[0..4] mask = AES-ECB(hp, sample)[0..4]
= d64a952459 = 1e9cdb9909
header[0] ^= mask[0] & 0x0f header[0] ^= mask[0] & 0x0f
= c5 = cd
header[18..21] ^= mask[1..4] header[18..21] ^= mask[1..4]
= 4a95245b = 9cdb990b
header = c5ff00001d088394c8f03e5157080000449e4a95245b header = cdff00001d088394c8f03e5157080000449e9cdb990b
The resulting protected packet is: The resulting protected packet is:
c5ff00001d088394c8f03e5157080000 449e4a95245bfb66bc5f93032b7ddd89 cdff00001d088394c8f03e5157080000 449e9cdb990bfb66bc6a93032b50dd89
fe0ff15d9c4f7050fccdb71c1cd80512 d4431643a53aafa1b0b518b44968b18b 73972d149421874d3849e3708d71354e a33bcdc356f3ea6e2a1a1bd7c3d14003
8d3e7a4d04c30b3ed9410325b2abb2da fb1c12f8b70479eb8df98abcaf95dd8f 8d3e784d04c30a2cdb40c32523aba2da fe1c1bf3d27a6be38fe38ae033fbb071
3d1c78660fbc719f88b23c8aef6771f3 d50e10fdfb4c9d92386d44481b6c52d5 3c1c73661bb6639795b42b97f77068ea d51f11fbf9489af2501d09481e6c64d4
9e5538d3d3942de9f13a7f8b702dc317 24180da9df22714d01003fc5e3d165c9 b8551cd3cea70d830ce2aeeec789ef55 1a7fbe36b3f7e1549a9f8d8e153b3fac
50e630b8540fbd81c9df0ee63f949970 26c4f2e1887a2def79050ac2d86ba318 3fb7b7812c9ed7c20b4be190ebd89956 26e7f0fc887925ec6f0606c5d36aa81b
e0b3adc4c5aa18bcf63c7cf8e85f5692 49813a2236a7e72269447cd1c755e451 ebb7aacdc4a31bb5f23d55faef5c5190 5783384f375a43235b5c742c78ab1bae
f5e77470eb3de64c8849d29282069802 9cfa18e5d66176fe6e5ba4ed18026f90 0a188b75efbde6b3774ed61282f9670a 9dea19e1566103ce675ab4e21081fb58
900a5b4980e2f58e39151d5cd685b109 29636d4f02e7fad2a5a458249f5c0298 60340a1e88e4f10e39eae25cd685b109 29636d4f02e7fad2a5a458249f5c0298
a6d53acbe41a7fc83fa7cc01973f7a74 d1237a51974e097636b6203997f921d0 a6d53acbe41a7fc83fa7cc01973f7a74 d1237a51974e097636b6203997f921d0
7bc1940a6f2d0de9f5a11432946159ed 6cc21df65c4ddd1115f86427259a196c 7bc1940a6f2d0de9f5a11432946159ed 6cc21df65c4ddd1115f86427259a196c
7148b25b6478b0dc7766e1c4d1b1f515 9f90eabc61636226244642ee148b464c 7148b25b6478b0dc7766e1c4d1b1f515 9f90eabc61636226244642ee148b464c
9e619ee50a5e3ddc836227cad938987c 4ea3c1fa7c75bbf88d89e9ada642b2b8 9e619ee50a5e3ddc836227cad938987c 4ea3c1fa7c75bbf88d89e9ada642b2b8
8fe8107b7ea375b1b64889a4e9e5c38a 1c896ce275a5658d250e2d76e1ed3a34 8fe8107b7ea375b1b64889a4e9e5c38a 1c896ce275a5658d250e2d76e1ed3a34
ce7e3a3f383d0c996d0bed106c2899ca 6fc263ef0455e74bb6ac1640ea7bfedc ce7e3a3f383d0c996d0bed106c2899ca 6fc263ef0455e74bb6ac1640ea7bfedc
59f03fee0e1725ea150ff4d69a7660c5 542119c71de270ae7c3ecfd1af2c4ce5 59f03fee0e1725ea150ff4d69a7660c5 542119c71de270ae7c3ecfd1af2c4ce5
51986949cc34a66b3e216bfe18b347e6 c05fd050f85912db303a8f054ec23e38 51986949cc34a66b3e216bfe18b347e6 c05fd050f85912db303a8f054ec23e38
f44d1c725ab641ae929fecc8e3cefa56 19df4231f5b4c009fa0c0bbc60bc75f7 f44d1c725ab641ae929fecc8e3cefa56 19df4231f5b4c009fa0c0bbc60bc75f7
6d06ef154fc8577077d9d6a1d2bd9bf0 81dc783ece60111bea7da9e5a9748069 6d06ef154fc8577077d9d6a1d2bd9bf0 81dc783ece60111bea7da9e5a9748069
skipping to change at page 49, line 43 skipping to change at page 53, line 42
1da2304d6a0fd5d07d08372202369661 59bef3cf904d722324dd852513df39ae 1da2304d6a0fd5d07d08372202369661 59bef3cf904d722324dd852513df39ae
030d8173908da6364786d3c1bfcb19ea 77a63b25f1e7fc661def480c5d00d444 030d8173908da6364786d3c1bfcb19ea 77a63b25f1e7fc661def480c5d00d444
56269ebd84efd8e3a8b2c257eec76060 682848cbf5194bc99e49ee75e4d0d254 56269ebd84efd8e3a8b2c257eec76060 682848cbf5194bc99e49ee75e4d0d254
bad4bfd74970c30e44b65511d4ad0e6e c7398e08e01307eeeea14e46ccd87cf3 bad4bfd74970c30e44b65511d4ad0e6e c7398e08e01307eeeea14e46ccd87cf3
6b285221254d8fc6a6765c524ded0085 dca5bd688ddf722e2c0faf9d0fb2ce7a 6b285221254d8fc6a6765c524ded0085 dca5bd688ddf722e2c0faf9d0fb2ce7a
0c3f2cee19ca0ffba461ca8dc5d2c817 8b0762cf67135558494d2a96f1a139f0 0c3f2cee19ca0ffba461ca8dc5d2c817 8b0762cf67135558494d2a96f1a139f0
edb42d2af89a9c9122b07acbc29e5e72 2df8615c343702491098478a389c9872 edb42d2af89a9c9122b07acbc29e5e72 2df8615c343702491098478a389c9872
a10b0c9875125e257c7bfdf27eef4060 bd3d00f4c14fd3e3496c38d3c5d1a566 a10b0c9875125e257c7bfdf27eef4060 bd3d00f4c14fd3e3496c38d3c5d1a566
8c39350effbc2d16ca17be4ce29f02ed 969504dda2a8c6b9ff919e693ee79e09 8c39350effbc2d16ca17be4ce29f02ed 969504dda2a8c6b9ff919e693ee79e09
089316e7d1d89ec099db3b2b268725d8 88536a4b8bf9aee8fb43e82a4d919d48 089316e7d1d89ec099db3b2b268725d8 88536a4b8bf9aee8fb43e82a4d919d48
43b1ca70a2d8d3f725ead1391377dcc0 1802771a449b30f3fa2289852607b660
A.3. Server Initial A.3. Server Initial
The server sends the following payload in response, including an ACK The server sends the following payload in response, including an ACK
frame, a CRYPTO frame, and no PADDING frames: frame, a CRYPTO frame, and no PADDING frames:
0d0000000018410a020000560303eefc e7f7b37ba1d1632e96677825ddf73988 02000000000600405a020000560303ee fce7f7b37ba1d1632e96677825ddf739
cfc79825df566dc5430b9a045a120013 0100002e00330024001d00209d3c940d 88cfc79825df566dc5430b9a045a1200 130100002e00330024001d00209d3c94
89690b84d08a60993c144eca684d1081 287c834d5311bcf32bb9da1a002b0002 0d89690b84d08a60993c144eca684d10 81287c834d5311bcf32bb9da1a002b00
0304 020304
The header from the server includes a new connection ID and a 2-byte The header from the server includes a new connection ID and a 2-byte
packet number encoding for a packet number of 1: packet number encoding for a packet number of 1:
c1ff00001d0008f067a5502a4262b50040740001 c1ff00001d0008f067a5502a4262b50040740001
As a result, after protection, the header protection sample is taken As a result, after protection, the header protection sample is taken
starting from the third protected octet: starting from the third protected octet:
sample = 823a5d3a1207c86ee49132824f046524 sample = 823a5d3a1207c86ee49132824f046524
mask = abaaf34fdc mask = abaaf34fdc
header = caff00001d0008f067a5502a4262b5004074aaf2 header = caff00001d0008f067a5502a4262b5004074aaf2
The final protected packet is then: The final protected packet is then:
caff00001d0008f067a5502a4262b500 4074aaf2f007823a5d3a1207c86ee491 c7ff00001d0008f067a5502a4262b500 4075fb12ff07823a5d24534d906ce4c7
32824f0465243d082d868b107a38092b c80528664cbf9456ebf27673fb5fa506 6782a2167e3479c0f7f6395dc2c91676 302fe6d70bb7cbeb117b4ddb7d173498
1ab573c9f001b81da028a00d52ab00b1 5bebaa70640e106cf2acd043e9c6b441 44fd61dae200b8338e1b932976b61d91 e64a02e9e0ee72e3a6f63aba4ceeeec5
1c0a79637134d8993701fe779e58c2fe 753d14b0564021565ea92e57bc6faf56 be2f24f2d86027572943533846caa13e 6f163fb257473dcca25396e88724f1e5
dfc7a40870e6 d964dedee9b633
A.4. Retry A.4. Retry
This shows a Retry packet that might be sent in response to the This shows a Retry packet that might be sent in response to the
Initial packet in Appendix A.2. The integrity check includes the Initial packet in Appendix A.2. The integrity check includes the
client-chosen connection ID value of 0x8394c8f03e515708, but that client-chosen connection ID value of 0x8394c8f03e515708, but that
value is not included in the final Retry packet: value is not included in the final Retry packet:
ffff00001d0008f067a5502a4262b574 6f6b656ed16926d81f6f9ca2953a8aa4 ffff00001d0008f067a5502a4262b574 6f6b656ed16926d81f6f9ca2953a8aa4
575e1e49 575e1e49
skipping to change at page 52, line 5 skipping to change at page 56, line 5
sample = 5e5cd55c41f69080575d7999c25a5bfb sample = 5e5cd55c41f69080575d7999c25a5bfb
mask = aefefe7d03 mask = aefefe7d03
header = 4cfe4189 header = 4cfe4189
The protected packet is the smallest possible packet size of 21 The protected packet is the smallest possible packet size of 21
bytes. bytes.
packet = 4cfe4189655e5cd55c41f69080575d7999c25a5bfb packet = 4cfe4189655e5cd55c41f69080575d7999c25a5bfb
Appendix B. Analysis of Limits on AEAD_AES_128_CCM Usage Appendix B. AEAD Algorithm Analysis
TLS [TLS13] and [AEBounds] do not specify limits on usage for
AEAD_AES_128_CCM. However, any AEAD that is used with QUIC requires
limits on use that ensure that both confidentiality and integrity are
preserved. This section documents that analysis.
[CCM-ANALYSIS] is used as the basis of this analysis. The results of
that analysis are used to derive usage limits that are based on those
chosen in [TLS13].
This analysis uses symbols for multiplication (*), division (/), and This section documents analyses used in deriving AEAD algorithm
exponentiation (^), plus parentheses for establishing precedence. limits for AEAD_AES_128_GCM, AEAD_AES_128_CCM, and AEAD_AES_256_GCM.
The following symbols are also used: The analyses that follow use symbols for multiplication (*), division
(/), and exponentiation (^), plus parentheses for establishing
precedence. The following symbols are also used:
t: The size of the authentication tag in bits. For this cipher, t t: The size of the authentication tag in bits. For this cipher, t
is 128. is 128.
n: The size of the block function in bits. For this cipher, n is n: The size of the block function in bits. For this cipher, n is
128. 128.
l: The number of blocks in each packet (see below). l: The number of blocks in each packet (see below).
q: The number of genuine packets created and protected by endpoints. q: The number of genuine packets created and protected by endpoints.
This value is the bound on the number of packets that can be This value is the bound on the number of packets that can be
protected before updating keys. protected before updating keys.
v: The number of forged packets that endpoints will accept. This v: The number of forged packets that endpoints will accept. This
value is the bound on the number of forged packets that an value is the bound on the number of forged packets that an
endpoint can reject before updating keys. endpoint can reject before updating keys.
The analysis of AEAD_AES_128_CCM relies on a count of the number of o: The amount of offline ideal cipher queries made by an adversary.
block operations involved in producing each message. For simplicity,
and to match the analysis of other AEAD functions in [AEBounds], this The analyses that follow rely on a count of the number of block
analysis assumes a packet length of 2^10 blocks and a packet size operations involved in producing each message. For simplicity, and
limit of 2^14. to match the analysis of other AEAD functions in [AEBounds], this
analysis assumes a packet length of 2^10 blocks; that is, a packet
size limit of 2^14 bytes.
For AEAD_AES_128_CCM, the total number of block cipher operations is For AEAD_AES_128_CCM, the total number of block cipher operations is
the sum of: the length of the associated data in blocks, the length the sum of: the length of the associated data in blocks, the length
of the ciphertext in blocks, the length of the plaintext in blocks, of the ciphertext in blocks, the length of the plaintext in blocks,
plus 1. In this analysis, this is simplified to a value of twice the plus 1. In this analysis, this is simplified to a value of twice the
length of the packet in blocks (that is, "2l = 2^11"). This length of the packet in blocks (that is, "2l = 2^11"). This
simplification is based on the packet containing all of the simplification is based on the packet containing all of the
associated data and ciphertext. This results in a negligible 1 to 3 associated data and ciphertext. This results in a negligible 1 to 3
block overestimation of the number of operations. block overestimation of the number of operations.
B.1. Confidentiality Limits B.1. Analysis of AEAD_AES_128_GCM and AEAD_AES_256_GCM Usage Limits
[GCM-MU] specify concrete bounds for AEAD_AES_128_GCM and
AEAD_AES_256_GCM as used in TLS 1.3 and QUIC. This section documents
this analysis using several simplifying assumptions:
* The number of ciphertext blocks an attacker uses in forgery
attempts is bounded by v * l, the number of forgery attempts and
the size of each packet (in blocks).
* The amount of offline work done by an attacker does not dominate
other factors in the analysis.
The bounds in [GCM-MU] are tighter and more complete than those used
in [AEBounds], which allows for larger limits than those described in
[TLS13].
B.1.1. Confidentiality Limit
For confidentiality, Theorum (4.3) in [GCM-MU] establishes that - for
a single user that does not repeat nonces - the dominant term in
determining the distinguishing advantage between a real and random
AEAD algorithm gained by an attacker is:
2 * (q * l)^2 / 2^128
For a target advantage of 2^-57, this results in the relation:
q <= 2^25
Thus, endpoints cannot protect more than 2^25 packets in a single
connection without causing an attacker to gain an larger advantage
than the target of 2^-57.
B.1.2. Integrity Limit
For integrity, Theorem (4.3) in [GCM-MU] establishes that an attacker
gains an advantage in successfully forging a packet of no more than:
(1 / 2^(8 * n)) + ((2 * v) / 2^(2 * n))
+ ((2 * o * v) / 2^(k + n)) + (n * (v + (v * l)) / 2^k)
The goal is to limit this advantage to 2^-57. For AEAD_AES_128_GCM,
the fourth term in this inequality dominates the rest, so the others
can be removed without significant effect on the result. This
produces the following approximation:
v <= 2^54
For AEAD_AES_256_GCM, the second and fourth terms dominate the rest,
so the others can be removed without affecting the result. This
produces the following approximation:
v <= 2^182
This is substantially larger than the limit for AEAD_AES_128_GCM.
However, this document recommends that the same limit be applied to
both functions as either limit is acceptably large.
B.2. Analysis of AEAD_AES_128_CCM Usage Limits
TLS [TLS13] and [AEBounds] do not specify limits on usage for
AEAD_AES_128_CCM. However, any AEAD that is used with QUIC requires
limits on use that ensure that both confidentiality and integrity are
preserved. This section documents that analysis.
[CCM-ANALYSIS] is used as the basis of this analysis. The results of
that analysis are used to derive usage limits that are based on those
chosen in [TLS13].
B.2.1. Confidentiality Limits
For confidentiality, Theorem 2 in [CCM-ANALYSIS] establishes that an For confidentiality, Theorem 2 in [CCM-ANALYSIS] establishes that an
attacker gains a distinguishing advantage over an ideal pseudorandom attacker gains a distinguishing advantage over an ideal pseudorandom
permutation (PRP) of no more than: permutation (PRP) of no more than:
(2l * q)^2 / 2^n (2l * q)^2 / 2^n
For a target advantage of 2^-60, which matches that used by [TLS13], For a target advantage of 2^-57, this results in the relation:
this results in the relation:
q <= 2^23 q <= 2^24.5
That is, endpoints cannot protect more than 2^23 packets with the That is, endpoints cannot protect more than 2^23 packets with the
same set of keys without causing an attacker to gain an larger same set of keys without causing an attacker to gain a larger
advantage than the target of 2^-60. advantage than the target of 2^-57. Note however that the integrity
limits further constrain this value.
B.2. Integrity Limits B.2.2. Integrity Limits
For integrity, Theorem 1 in [CCM-ANALYSIS] establishes that an For integrity, Theorem 1 in [CCM-ANALYSIS] establishes that an
attacker gains an advantage over an ideal PRP of no more than: attacker gains an advantage over an ideal PRP of no more than:
v / 2^t + (2l * (v + q))^2 / 2^n v / 2^t + (2l * (v + q))^2 / 2^n
The goal is to limit this advantage to 2^-57, to match the target in The goal is to limit this advantage to 2^-57. As "t" and "n" are
[TLS13]. As "t" and "n" are both 128, the first term is negligible both 128, the first term is negligible relative to the second, so
relative to the second, so that term can be removed without a that term can be removed without a significant effect on the result.
significant effect on the result. This produces the relation: This produces the relation:
v + q <= 2^24.5 v + q <= 2^24.5
Assuming "q = v", endpoints cannot attempt to protect or authenticate
Using the previously-established value of 2^23 for "q" and rounding, more than 2^23.5 packets with the same set of keys without causing an
this leads to an upper limit on "v" of 2^23.5. That is, endpoints attacker to gain a larger advantage in forging packets than the
cannot attempt to authenticate more than 2^23.5 packets with the same target of 2^-57.
set of keys without causing an attacker to gain an larger advantage
than the target of 2^-57.
Appendix C. Change Log Appendix C. Change Log
*RFC Editor's Note:* Please remove this section prior to *RFC Editor's Note:* Please remove this section prior to
publication of a final version of this document. publication of a final version of this document.
Issue and pull request numbers are listed with a leading octothorp. Issue and pull request numbers are listed with a leading octothorp.
C.1. Since draft-ietf-quic-tls-28 C.1. Since draft-ietf-quic-tls-29
* Updated limits on packet protection (#3788, #3789)
* Allow for packet processing to continue while waiting for TLS to
provide keys (#3821, #3874)
C.2. Since draft-ietf-quic-tls-28
* Defined limits on the number of packets that can be protected with * Defined limits on the number of packets that can be protected with
a single key and limits on the number of packets that can fail a single key and limits on the number of packets that can fail
authentication (#3619, #3620) authentication (#3619, #3620)
C.2. Since draft-ietf-quic-tls-27 * Update Initial salt, Retry keys, and samples (#3711)
C.3. Since draft-ietf-quic-tls-27
* Allowed CONNECTION_CLOSE in any packet number space, with * Allowed CONNECTION_CLOSE in any packet number space, with
restrictions on use of the application-specific variant (#3430, restrictions on use of the application-specific variant (#3430,
#3435, #3440) #3435, #3440)
* Prohibit the use of the compatibility mode from TLS 1.3 (#3594, * Prohibit the use of the compatibility mode from TLS 1.3 (#3594,
#3595) #3595)
C.3. Since draft-ietf-quic-tls-26 C.4. Since draft-ietf-quic-tls-26
* No changes * No changes
C.4. Since draft-ietf-quic-tls-25 C.5. Since draft-ietf-quic-tls-25
* No changes * No changes
C.5. Since draft-ietf-quic-tls-24 C.6. Since draft-ietf-quic-tls-24
* Rewrite key updates (#3050) * Rewrite key updates (#3050)
- Allow but don't recommend deferring key updates (#2792, #3263) - Allow but don't recommend deferring key updates (#2792, #3263)
- More completely define received behavior (#2791) - More completely define received behavior (#2791)
- Define the label used with HKDF-Expand-Label (#3054) - Define the label used with HKDF-Expand-Label (#3054)
C.6. Since draft-ietf-quic-tls-23 C.7. Since draft-ietf-quic-tls-23
* Key update text update (#3050): * Key update text update (#3050):
- Recommend constant-time key replacement (#2792) - Recommend constant-time key replacement (#2792)
- Provide explicit labels for key update key derivation (#3054) - Provide explicit labels for key update key derivation (#3054)
* Allow first Initial from a client to span multiple packets (#2928, * Allow first Initial from a client to span multiple packets (#2928,
#3045) #3045)
* PING can be sent at any encryption level (#3034, #3035) * PING can be sent at any encryption level (#3034, #3035)
C.7. Since draft-ietf-quic-tls-22 C.8. Since draft-ietf-quic-tls-22
* Update the salt used for Initial secrets (#2887, #2980) * Update the salt used for Initial secrets (#2887, #2980)
C.8. Since draft-ietf-quic-tls-21 C.9. Since draft-ietf-quic-tls-21
* No changes * No changes
C.9. Since draft-ietf-quic-tls-20 C.10. Since draft-ietf-quic-tls-20
* Mandate the use of the QUIC transport parameters extension (#2528, * Mandate the use of the QUIC transport parameters extension (#2528,
#2560) #2560)
* Define handshake completion and confirmation; define clearer rules * Define handshake completion and confirmation; define clearer rules
when it encryption keys should be discarded (#2214, #2267, #2673) when it encryption keys should be discarded (#2214, #2267, #2673)
C.10. Since draft-ietf-quic-tls-18 C.11. Since draft-ietf-quic-tls-18
* Increased the set of permissible frames in 0-RTT (#2344, #2355) * Increased the set of permissible frames in 0-RTT (#2344, #2355)
* Transport parameter extension is mandatory (#2528, #2560) * Transport parameter extension is mandatory (#2528, #2560)
C.11. Since draft-ietf-quic-tls-17 C.12. Since draft-ietf-quic-tls-17
* Endpoints discard initial keys as soon as handshake keys are * Endpoints discard initial keys as soon as handshake keys are
available (#1951, #2045) available (#1951, #2045)
* Use of ALPN or equivalent is mandatory (#2263, #2284) * Use of ALPN or equivalent is mandatory (#2263, #2284)
C.12. Since draft-ietf-quic-tls-14 C.13. Since draft-ietf-quic-tls-14
* Update the salt used for Initial secrets (#1970) * Update the salt used for Initial secrets (#1970)
* Clarify that TLS_AES_128_CCM_8_SHA256 isn't supported (#2019) * Clarify that TLS_AES_128_CCM_8_SHA256 isn't supported (#2019)
* Change header protection * Change header protection
- Sample from a fixed offset (#1575, #2030) - Sample from a fixed offset (#1575, #2030)
- Cover part of the first byte, including the key phase (#1322, - Cover part of the first byte, including the key phase (#1322,
skipping to change at page 56, line 5 skipping to change at page 61, line 28
* TLS provides an AEAD and KDF function (#2046) * TLS provides an AEAD and KDF function (#2046)
- Clarify that the TLS KDF is used with TLS (#1997) - Clarify that the TLS KDF is used with TLS (#1997)
- Change the labels for calculation of QUIC keys (#1845, #1971, - Change the labels for calculation of QUIC keys (#1845, #1971,
#1991) #1991)
* Initial keys are discarded once Handshake keys are available * Initial keys are discarded once Handshake keys are available
(#1951, #2045) (#1951, #2045)
C.13. Since draft-ietf-quic-tls-13 C.14. Since draft-ietf-quic-tls-13
* Updated to TLS 1.3 final (#1660) * Updated to TLS 1.3 final (#1660)
C.14. Since draft-ietf-quic-tls-12 C.15. Since draft-ietf-quic-tls-12
* Changes to integration of the TLS handshake (#829, #1018, #1094, * Changes to integration of the TLS handshake (#829, #1018, #1094,
#1165, #1190, #1233, #1242, #1252, #1450) #1165, #1190, #1233, #1242, #1252, #1450)
- The cryptographic handshake uses CRYPTO frames, not stream 0 - The cryptographic handshake uses CRYPTO frames, not stream 0
- QUIC packet protection is used in place of TLS record - QUIC packet protection is used in place of TLS record
protection protection
- Separate QUIC packet number spaces are used for the handshake - Separate QUIC packet number spaces are used for the handshake
- Changed Retry to be independent of the cryptographic handshake - Changed Retry to be independent of the cryptographic handshake
- Limit the use of HelloRetryRequest to address TLS needs (like - Limit the use of HelloRetryRequest to address TLS needs (like
key shares) key shares)
* Changed codepoint of TLS extension (#1395, #1402) * Changed codepoint of TLS extension (#1395, #1402)
C.15. Since draft-ietf-quic-tls-11 C.16. Since draft-ietf-quic-tls-11
* Encrypted packet numbers. * Encrypted packet numbers.
C.16. Since draft-ietf-quic-tls-10 C.17. Since draft-ietf-quic-tls-10
* No significant changes. * No significant changes.
C.17. Since draft-ietf-quic-tls-09 C.18. Since draft-ietf-quic-tls-09
* Cleaned up key schedule and updated the salt used for handshake * Cleaned up key schedule and updated the salt used for handshake
packet protection (#1077) packet protection (#1077)
C.18. Since draft-ietf-quic-tls-08 C.19. Since draft-ietf-quic-tls-08
* Specify value for max_early_data_size to enable 0-RTT (#942) * Specify value for max_early_data_size to enable 0-RTT (#942)
* Update key derivation function (#1003, #1004) * Update key derivation function (#1003, #1004)
C.19. Since draft-ietf-quic-tls-07 C.20. Since draft-ietf-quic-tls-07
* Handshake errors can be reported with CONNECTION_CLOSE (#608, * Handshake errors can be reported with CONNECTION_CLOSE (#608,
#891) #891)
C.20. Since draft-ietf-quic-tls-05 C.21. Since draft-ietf-quic-tls-05
No significant changes. No significant changes.
C.21. Since draft-ietf-quic-tls-04 C.22. Since draft-ietf-quic-tls-04
* Update labels used in HKDF-Expand-Label to match TLS 1.3 (#642) * Update labels used in HKDF-Expand-Label to match TLS 1.3 (#642)
C.22. Since draft-ietf-quic-tls-03 C.23. Since draft-ietf-quic-tls-03
No significant changes. No significant changes.
C.23. Since draft-ietf-quic-tls-02 C.24. Since draft-ietf-quic-tls-02
* Updates to match changes in transport draft * Updates to match changes in transport draft
C.24. Since draft-ietf-quic-tls-01 C.25. Since draft-ietf-quic-tls-01
* Use TLS alerts to signal TLS errors (#272, #374) * Use TLS alerts to signal TLS errors (#272, #374)
* Require ClientHello to fit in a single packet (#338) * Require ClientHello to fit in a single packet (#338)
* The second client handshake flight is now sent in the clear (#262, * The second client handshake flight is now sent in the clear (#262,
#337) #337)
* The QUIC header is included as AEAD Associated Data (#226, #243, * The QUIC header is included as AEAD Associated Data (#226, #243,
#302) #302)
skipping to change at page 57, line 46 skipping to change at page 63, line 21
* Require at least TLS 1.3 (#138) * Require at least TLS 1.3 (#138)
* Define transport parameters as a TLS extension (#122) * Define transport parameters as a TLS extension (#122)
* Define handling for protected packets before the handshake * Define handling for protected packets before the handshake
completes (#39) completes (#39)
* Decouple QUIC version and ALPN (#12) * Decouple QUIC version and ALPN (#12)
C.25. Since draft-ietf-quic-tls-00 C.26. Since draft-ietf-quic-tls-00
* Changed bit used to signal key phase * Changed bit used to signal key phase
* Updated key phase markings during the handshake * Updated key phase markings during the handshake
* Added TLS interface requirements section * Added TLS interface requirements section
* Moved to use of TLS exporters for key derivation * Moved to use of TLS exporters for key derivation
* Moved TLS error code definitions into this document * Moved TLS error code definitions into this document
C.26. Since draft-thomson-quic-tls-01 C.27. Since draft-thomson-quic-tls-01
* Adopted as base for draft-ietf-quic-tls * Adopted as base for draft-ietf-quic-tls
* Updated authors/editors list * Updated authors/editors list
* Added status note * Added status note
Contributors Contributors
The IETF QUIC Working Group received an enormous amount of support The IETF QUIC Working Group received an enormous amount of support
 End of changes. 166 change blocks. 
459 lines changed or deleted 675 lines changed or added

This html diff was produced by rfcdiff 1.45. The latest version is available from http://tools.ietf.org/tools/rfcdiff/