draft-ietf-quic-tls-20.txt   draft-ietf-quic-tls-latest.txt 
QUIC Working Group M. Thomson, Ed. QUIC Working Group M. Thomson, Ed.
Internet-Draft Mozilla Internet-Draft Mozilla
Intended status: Standards Track S. Turner, Ed. Intended status: Standards Track S. Turner, Ed.
Expires: October 25, 2019 sn3rd Expires: December 7, 2019 sn3rd
April 23, 2019 June 5, 2019
Using TLS to Secure QUIC Using TLS to Secure QUIC
draft-ietf-quic-tls-20 draft-ietf-quic-tls-latest
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), which is archived at mailing list (quic@ietf.org), which is archived at
skipping to change at page 1, line 42 skipping to change at page 1, line 42
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 October 25, 2019. This Internet-Draft will expire on December 7, 2019.
Copyright Notice Copyright Notice
Copyright (c) 2019 IETF Trust and the persons identified as the Copyright (c) 2019 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 Provisions Relating to IETF Documents
(https://trustee.ietf.org/license-info) in effect on the date of (https://trustee.ietf.org/license-info) in effect on the date of
publication of this document. Please review these documents publication of this document. Please review these documents
skipping to change at page 2, line 21 skipping to change at page 2, line 21
include Simplified BSD License text as described in Section 4.e of include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as the Trust Legal Provisions and are provided without warranty as
described in the Simplified BSD License. described in the Simplified BSD License.
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3
2. Notational Conventions . . . . . . . . . . . . . . . . . . . 4 2. Notational Conventions . . . . . . . . . . . . . . . . . . . 4
2.1. TLS Overview . . . . . . . . . . . . . . . . . . . . . . 4 2.1. TLS Overview . . . . . . . . . . . . . . . . . . . . . . 4
3. Protocol Overview . . . . . . . . . . . . . . . . . . . . . . 6 3. Protocol Overview . . . . . . . . . . . . . . . . . . . . . . 6
4. Carrying TLS Messages . . . . . . . . . . . . . . . . . . . . 7 4. Carrying TLS Messages . . . . . . . . . . . . . . . . . . . . 8
4.1. Interface to TLS . . . . . . . . . . . . . . . . . . . . 9 4.1. Interface to TLS . . . . . . . . . . . . . . . . . . . . 9
4.1.1. Sending and Receiving Handshake Messages . . . . . . 9 4.1.1. Handshake Complete . . . . . . . . . . . . . . . . . 10
4.1.2. Encryption Level Changes . . . . . . . . . . . . . . 11 4.1.2. Handshake Confirmed . . . . . . . . . . . . . . . . . 10
4.1.3. TLS Interface Summary . . . . . . . . . . . . . . . . 12 4.1.3. Sending and Receiving Handshake Messages . . . . . . 10
4.1.4. Encryption Level Changes . . . . . . . . . . . . . . 12
4.1.5. TLS Interface Summary . . . . . . . . . . . . . . . . 13
4.2. TLS Version . . . . . . . . . . . . . . . . . . . . . . . 13 4.2. TLS Version . . . . . . . . . . . . . . . . . . . . . . . 13
4.3. ClientHello Size . . . . . . . . . . . . . . . . . . . . 14 4.3. ClientHello Size . . . . . . . . . . . . . . . . . . . . 14
4.4. Peer Authentication . . . . . . . . . . . . . . . . . . . 14 4.4. Peer Authentication . . . . . . . . . . . . . . . . . . . 14
4.5. Enabling 0-RTT . . . . . . . . . . . . . . . . . . . . . 15 4.5. Enabling 0-RTT . . . . . . . . . . . . . . . . . . . . . 15
4.6. Rejecting 0-RTT . . . . . . . . . . . . . . . . . . . . . 15 4.6. Rejecting 0-RTT . . . . . . . . . . . . . . . . . . . . . 15
4.7. HelloRetryRequest . . . . . . . . . . . . . . . . . . . . 15 4.7. HelloRetryRequest . . . . . . . . . . . . . . . . . . . . 16
4.8. TLS Errors . . . . . . . . . . . . . . . . . . . . . . . 16 4.8. TLS Errors . . . . . . . . . . . . . . . . . . . . . . . 16
4.9. Discarding Unused Keys . . . . . . . . . . . . . . . . . 16 4.9. Discarding Unused Keys . . . . . . . . . . . . . . . . . 16
4.10. Discarding Initial Keys . . . . . . . . . . . . . . . . . 17 4.9.1. Discarding Initial Keys . . . . . . . . . . . . . . . 17
4.9.2. Discarding Handshake Keys . . . . . . . . . . . . . . 17
4.9.3. Discarding 0-RTT Keys . . . . . . . . . . . . . . . . 17
5. Packet Protection . . . . . . . . . . . . . . . . . . . . . . 18 5. Packet Protection . . . . . . . . . . . . . . . . . . . . . . 18
5.1. Packet Protection Keys . . . . . . . . . . . . . . . . . 18 5.1. Packet Protection Keys . . . . . . . . . . . . . . . . . 18
5.2. Initial Secrets . . . . . . . . . . . . . . . . . . . . . 18 5.2. Initial Secrets . . . . . . . . . . . . . . . . . . . . . 18
5.3. AEAD Usage . . . . . . . . . . . . . . . . . . . . . . . 19 5.3. AEAD Usage . . . . . . . . . . . . . . . . . . . . . . . 19
5.4. Header Protection . . . . . . . . . . . . . . . . . . . . 20 5.4. Header Protection . . . . . . . . . . . . . . . . . . . . 21
5.4.1. Header Protection Application . . . . . . . . . . . . 21 5.4.1. Header Protection Application . . . . . . . . . . . . 21
5.4.2. Header Protection Sample . . . . . . . . . . . . . . 22 5.4.2. Header Protection Sample . . . . . . . . . . . . . . 23
5.4.3. AES-Based Header Protection . . . . . . . . . . . . . 23 5.4.3. AES-Based Header Protection . . . . . . . . . . . . . 24
5.4.4. ChaCha20-Based Header Protection . . . . . . . . . . 24 5.4.4. ChaCha20-Based Header Protection . . . . . . . . . . 24
5.5. Receiving Protected Packets . . . . . . . . . . . . . . . 24 5.5. Receiving Protected Packets . . . . . . . . . . . . . . . 24
5.6. Use of 0-RTT Keys . . . . . . . . . . . . . . . . . . . . 24 5.6. Use of 0-RTT Keys . . . . . . . . . . . . . . . . . . . . 25
5.7. Receiving Out-of-Order Protected Frames . . . . . . . . . 25 5.7. Receiving Out-of-Order Protected Frames . . . . . . . . . 25
6. Key Update . . . . . . . . . . . . . . . . . . . . . . . . . 25 6. Key Update . . . . . . . . . . . . . . . . . . . . . . . . . 26
7. Security of Initial Messages . . . . . . . . . . . . . . . . 27 7. Security of Initial Messages . . . . . . . . . . . . . . . . 28
8. QUIC-Specific Additions to the TLS Handshake . . . . . . . . 28 8. QUIC-Specific Additions to the TLS Handshake . . . . . . . . 29
8.1. Protocol and Version Negotiation . . . . . . . . . . . . 28 8.1. Protocol and Version Negotiation . . . . . . . . . . . . 29
8.2. QUIC Transport Parameters Extension . . . . . . . . . . . 28 8.2. QUIC Transport Parameters Extension . . . . . . . . . . . 30
8.3. Removing the EndOfEarlyData Message . . . . . . . . . . . 29 8.3. Removing the EndOfEarlyData Message . . . . . . . . . . . 30
9. Security Considerations . . . . . . . . . . . . . . . . . . . 31
9. Security Considerations . . . . . . . . . . . . . . . . . . . 29 9.1. Replay Attacks with 0-RTT . . . . . . . . . . . . . . . . 31
9.1. Replay Attacks with 0-RTT . . . . . . . . . . . . . . . . 30 9.2. Packet Reflection Attack Mitigation . . . . . . . . . . . 32
9.2. Packet Reflection Attack Mitigation . . . . . . . . . . . 31 9.3. Peer Denial of Service . . . . . . . . . . . . . . . . . 32
9.3. Peer Denial of Service . . . . . . . . . . . . . . . . . 31 9.4. Header Protection Analysis . . . . . . . . . . . . . . . 33
9.4. Header Protection Analysis . . . . . . . . . . . . . . . 31 9.5. Key Diversity . . . . . . . . . . . . . . . . . . . . . . 34
9.5. Key Diversity . . . . . . . . . . . . . . . . . . . . . . 32 10. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 34
10. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 33 11. References . . . . . . . . . . . . . . . . . . . . . . . . . 34
11. References . . . . . . . . . . . . . . . . . . . . . . . . . 33 11.1. Normative References . . . . . . . . . . . . . . . . . . 34
11.1. Normative References . . . . . . . . . . . . . . . . . . 33 11.2. Informative References . . . . . . . . . . . . . . . . . 35
11.2. Informative References . . . . . . . . . . . . . . . . . 34 11.3. URIs . . . . . . . . . . . . . . . . . . . . . . . . . . 36
11.3. URIs . . . . . . . . . . . . . . . . . . . . . . . . . . 35 Appendix A. Sample Initial Packet Protection . . . . . . . . . . 36
Appendix A. Sample Initial Packet Protection . . . . . . . . . . 35 A.1. Keys . . . . . . . . . . . . . . . . . . . . . . . . . . 36
A.1. Keys . . . . . . . . . . . . . . . . . . . . . . . . . . 35 A.2. Client Initial . . . . . . . . . . . . . . . . . . . . . 37
A.2. Client Initial . . . . . . . . . . . . . . . . . . . . . 36 A.3. Server Initial . . . . . . . . . . . . . . . . . . . . . 39
A.3. Server Initial . . . . . . . . . . . . . . . . . . . . . 38 Appendix B. Change Log . . . . . . . . . . . . . . . . . . . . . 40
Appendix B. Change Log . . . . . . . . . . . . . . . . . . . . . 39 B.1. Since draft-ietf-quic-tls-18 . . . . . . . . . . . . . . 40
B.1. Since draft-ietf-quic-tls-18 . . . . . . . . . . . . . . 39 B.2. Since draft-ietf-quic-tls-17 . . . . . . . . . . . . . . 40
B.2. Since draft-ietf-quic-tls-17 . . . . . . . . . . . . . . 39 B.3. Since draft-ietf-quic-tls-14 . . . . . . . . . . . . . . 40
B.3. Since draft-ietf-quic-tls-14 . . . . . . . . . . . . . . 39 B.4. Since draft-ietf-quic-tls-13 . . . . . . . . . . . . . . 41
B.4. Since draft-ietf-quic-tls-13 . . . . . . . . . . . . . . 40 B.5. Since draft-ietf-quic-tls-12 . . . . . . . . . . . . . . 41
B.5. Since draft-ietf-quic-tls-12 . . . . . . . . . . . . . . 40 B.6. Since draft-ietf-quic-tls-11 . . . . . . . . . . . . . . 41
B.6. Since draft-ietf-quic-tls-11 . . . . . . . . . . . . . . 40 B.7. Since draft-ietf-quic-tls-10 . . . . . . . . . . . . . . 41
B.7. Since draft-ietf-quic-tls-10 . . . . . . . . . . . . . . 40 B.8. Since draft-ietf-quic-tls-09 . . . . . . . . . . . . . . 42
B.8. Since draft-ietf-quic-tls-09 . . . . . . . . . . . . . . 41 B.9. Since draft-ietf-quic-tls-08 . . . . . . . . . . . . . . 42
B.9. Since draft-ietf-quic-tls-08 . . . . . . . . . . . . . . 41 B.10. Since draft-ietf-quic-tls-07 . . . . . . . . . . . . . . 42
B.10. Since draft-ietf-quic-tls-07 . . . . . . . . . . . . . . 41 B.11. Since draft-ietf-quic-tls-05 . . . . . . . . . . . . . . 42
B.11. Since draft-ietf-quic-tls-05 . . . . . . . . . . . . . . 41 B.12. Since draft-ietf-quic-tls-04 . . . . . . . . . . . . . . 42
B.12. Since draft-ietf-quic-tls-04 . . . . . . . . . . . . . . 41 B.13. Since draft-ietf-quic-tls-03 . . . . . . . . . . . . . . 42
B.13. Since draft-ietf-quic-tls-03 . . . . . . . . . . . . . . 41 B.14. Since draft-ietf-quic-tls-02 . . . . . . . . . . . . . . 42
B.14. Since draft-ietf-quic-tls-02 . . . . . . . . . . . . . . 41 B.15. Since draft-ietf-quic-tls-01 . . . . . . . . . . . . . . 42
B.15. Since draft-ietf-quic-tls-01 . . . . . . . . . . . . . . 41 B.16. Since draft-ietf-quic-tls-00 . . . . . . . . . . . . . . 43
B.16. Since draft-ietf-quic-tls-00 . . . . . . . . . . . . . . 42 B.17. Since draft-thomson-quic-tls-01 . . . . . . . . . . . . . 43
B.17. Since draft-thomson-quic-tls-01 . . . . . . . . . . . . . 42 Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . 43
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . 42 Contributors . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Contributors . . . . . . . . . . . . . . . . . . . . . . . . . . 42 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 43
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 42
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 9, line 32 skipping to change at page 10, line 4
Section 17 of [QUIC-TRANSPORT] shows how packets at the various Section 17 of [QUIC-TRANSPORT] shows how packets at the various
encryption levels fit into the handshake process. encryption levels fit into the handshake process.
4.1. Interface to TLS 4.1. Interface to TLS
As shown in Figure 2, the interface from QUIC to TLS consists of As shown in Figure 2, the interface from QUIC to TLS consists of
three primary functions: three primary functions:
o Sending and receiving handshake messages o Sending and receiving handshake messages
o Rekeying (both transmit and receive) o Rekeying (both transmit and receive)
o Handshake state updates o Handshake state updates
Additional functions might be needed to configure TLS. Additional functions might be needed to configure TLS.
4.1.1. Sending and Receiving Handshake Messages 4.1.1. Handshake Complete
In this document, the TLS handshake is considered complete when the
TLS stack has reported that the handshake is complete. This happens
when the TLS stack has both sent a Finished message and verified the
peer's Finished message. Verifying the peer's Finished provides the
endpoints with an assurance that previous handshake messages have not
been modified. Note that the handshake does not complete at both
endpoints simultaneously. Consequently, any requirement that is
based on the completion of the handshake depends on the perspective
of the endpoint in question.
4.1.2. Handshake Confirmed
In this document, the TLS handshake is considered confirmed at an
endpoint when the following two conditions are met: the handshake is
complete, and the endpoint has received an acknowledgment for a
packet sent with 1-RTT keys. This second condition can be
implemented by recording the lowest packet number sent with 1-RTT
keys, and the highest value of the Largest Acknowledged field in any
received 1-RTT ACK frame: once the latter is higher than or equal to
the former, the handshake is confirmed.
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 handshake packets.
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.
skipping to change at page 11, line 12 skipping to change at page 12, line 10
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.
Important: Until the handshake is reported as complete, the 4.1.4. Encryption Level Changes
connection and key exchange are not properly authenticated at the
server. Even though 1-RTT keys are available to a server after
receiving the first handshake messages from a client, the server
cannot consider the client to be authenticated until it receives
and validates the client's Finished message. A server MUST NOT
process 1-RTT packets until the handshake is complete. A server
MAY buffer or discard 1-RTT packets that it cannot read.
The requirement for the server to wait for the client Finished
message creates a dependency on that message being delivered. A
client can avoid the potential for head-of-line blocking that this
implies by sending a copy of the CRYPTO frame that carries the
Finished message in multiple packets. This enables immediate
server processing for those packets.
4.1.2. Encryption Level Changes
As keys for new encryption levels become available, TLS provides QUIC As keys for new encryption levels become available, TLS provides QUIC
with those keys. Separately, as TLS starts using keys at a given with those keys. Separately, as TLS starts using keys at a given
encryption level, TLS indicates to QUIC that it is now reading or encryption level, TLS indicates to QUIC that it is now reading or
writing with keys at that encryption level. These events are not writing with keys at that encryption level. These events are not
asynchronous; they always occur immediately after TLS is provided asynchronous; they always occur immediately after TLS is provided
with new handshake bytes, or after TLS produces handshake bytes. with new handshake bytes, or after TLS produces handshake bytes.
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:
skipping to change at page 12, line 27 skipping to change at page 13, line 8
higher and lower encryption levels than the current encryption level higher and lower encryption levels than the current encryption level
used by TLS. used by TLS.
In particular, server implementations need to be able to read packets In particular, server implementations need to be able to read packets
at the Handshake encryption level at the same time as the 0-RTT at the Handshake encryption level at the same time as the 0-RTT
encryption level. A client could interleave ACK frames that are encryption level. A client could interleave ACK frames that are
protected with Handshake keys with 0-RTT data and the server needs to protected with Handshake keys with 0-RTT data and the server needs to
process those acknowledgments in order to detect lost Handshake process those acknowledgments in order to detect lost Handshake
packets. packets.
4.1.3. TLS Interface Summary 4.1.5. TLS Interface Summary
Figure 3 summarizes the exchange between QUIC and TLS for both client Figure 3 summarizes the exchange between QUIC and TLS for both client
and server. Each arrow is tagged with the encryption level used for and server. Each arrow is tagged with the encryption level used for
that transmission. that transmission.
Client Server Client Server
Get Handshake Get Handshake
Initial -------------> Initial ------------->
Install tx 0-RTT Keys Install tx 0-RTT Keys
skipping to change at page 16, line 25 skipping to change at page 16, line 35
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. QUIC CONNECTION_CLOSE frame.
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.
4.9. 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). Initial packet protection keys are treated specially, Section 6.
see Section 4.10.
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
acknowledgements for packets at the same encryption level as the acknowledgements for packets at the same encryption level as the
packet being acknowledged. Thus, it is possible that keys for a packet being acknowledged. Thus, it is possible that keys for a
lower encryption level are needed for a short time after keys for a lower encryption level are needed for a short time after keys for a
newer encryption level are available. newer encryption level are available.
An endpoint cannot discard keys for a given encryption level unless An endpoint cannot discard keys for a given encryption level unless
it has both received and acknowledged all CRYPTO frames for that it has both received and acknowledged all CRYPTO frames for that
encryption level and when all CRYPTO frames for that encryption level encryption level and when all CRYPTO frames for that encryption level
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.
After all CRYPTO frames for a given encryption level have been sent
and all expected CRYPTO frames received, and all the corresponding
acknowledgments have been received or sent, an endpoint starts a
timer. For 0-RTT keys, which do not carry CRYPTO frames, this timer
starts when the first packets protected with 1-RTT are sent or
received. To limit the effect of packet loss around a change in
keys, endpoints MUST retain packet protection keys for that
encryption level for at least three times the current Probe Timeout
(PTO) interval as defined in [QUIC-RECOVERY]. Retaining keys for
this interval allows packets containing CRYPTO or ACK frames at that
encryption level to be sent if packets are determined to be lost or
new packets require acknowledgment.
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.
Once this timer expires, an endpoint MUST NOT either accept or 4.9.1. Discarding Initial Keys
generate new packets using those packet protection keys. An endpoint
can discard packet protection keys for that encryption level.
Key updates (see Section 6) can be used to update 1-RTT keys before
keys from other encryption levels are discarded. In that case,
packets protected with the newest packet protection keys and packets
sent two updates prior will appear to use the same keys. After the
handshake is complete, endpoints only need to maintain the two latest
sets of packet protection keys and MAY discard older keys. Updating
keys multiple times rapidly can cause packets to be effectively lost
if packets are significantly delayed. Because key updates can only
be performed once per round trip time, only packets that are delayed
by more than a round trip will be lost as a result of changing keys;
such packets will be marked as lost before this, as they leave a gap
in the sequence of packet numbers.
4.10. 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.9.2. Discarding Handshake Keys
An endpoint MUST NOT discard its handshake keys until the TLS
handshake is confirmed (Section 4.1.2). An endpoint SHOULD discard
its handshake keys as soon as it has confirmed the handshake. Most
application protocols will send data after the handshake, resulting
in acknowledgements that allow both endpoints to discard their
handshake keys promptly. Endpoints that do not have reason to send
immediately after completing the handshake MAY send ack-eliciting
frames, such as PING, which will cause the handshake to be confirmed
when they are acknowledged.
4.9.3. Discarding 0-RTT Keys
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
(Section 5.6).
Therefore, a client SHOULD discard 0-RTT keys as soon as it installs
1-RTT keys, since they have no use after that moment.
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
could arrive after a 1-RTT packet. Servers MAY temporarily retain
0-RTT keys to allow decrypting reordered packets without requiring
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;
the RECOMMENDED time period is three times the Probe Timeout (PTO,
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
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 negotiated by TLS.
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.
skipping to change at page 18, line 30 skipping to change at page 18, line 41
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 IV; see Section 5.3. The header protection key uses
the "quic hp" label, see Section 5.4. Using these labels provides the "quic hp" label; see Section 5.4. Using these labels provides
key separation between QUIC and TLS, see Section 9.5. key separation between QUIC and TLS; see Section 9.5.
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 are protected with a secret derived from the
Destination Connection ID field from the client's first Initial Destination Connection ID field from the client's first Initial
packet of the connection. Specifically: packet of the connection. Specifically:
initial_salt = 0xef4fb0abb47470c41befcf8031334fae485e09a0 initial_salt = 0x7fbcdb0e7c66bbe9193a96cd21519ebd7a02644a
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)
skipping to change at page 20, line 8 skipping to change at page 20, line 19
All QUIC packets other than Version Negotiation and Retry packets are All QUIC packets other than Version Negotiation and Retry packets are
protected with an AEAD algorithm [AEAD]. Prior to establishing a protected with an AEAD algorithm [AEAD]. Prior to establishing a
shared secret, packets are protected with AEAD_AES_128_GCM and a key shared secret, packets are protected with AEAD_AES_128_GCM and a key
derived from the Destination Connection ID in the client's first derived from the Destination Connection ID in the client's first
Initial packet (see Section 5.2). This provides protection against Initial packet (see Section 5.2). This provides protection against
off-path attackers and robustness against QUIC version unaware off-path attackers and robustness against QUIC version unaware
middleboxes, but not against on-path attackers. 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 ciphersuites defined in [TLS13] with the
exception of TLS_AES_128_CCM_8_SHA256. The AEAD for that exception of TLS_AES_128_CCM_8_SHA256. A ciphersuite MUST NOT be
ciphersuite, AEAD_AES_128_CCM_8 [CCM], does not produce a large negotiated unless a header protection scheme is defined for the
enough authentication tag for use with the header protection designs ciphersuite. This document defines a header protection scheme for
provided (see Section 5.4). All other ciphersuites defined in all ciphersuites defined in [TLS13] aside from
[TLS13] have a 16-byte authentication tag and produce an output 16 TLS_AES_128_CCM_8_SHA256. These ciphersuites have a 16-byte
bytes larger than their input. authentication tag and produce an output 16 bytes larger than their
input.
Note: An endpoint MUST NOT reject a ClientHello that offers a
ciphersuite that it does not support, or it would be impossible to
deploy a new ciphersuite. This also applies to
TLS_AES_128_CCM_8_SHA256.
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 flags byte in either the short or long
skipping to change at page 22, line 35 skipping to change at page 23, line 4
| Sampled part of Protected Payload (128) ... | Sampled part of Protected Payload (128) ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Protected Payload Remainder (*) ... | Protected Payload Remainder (*) ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 5: Header Protection and Ciphertext Sample Figure 5: Header Protection and Ciphertext Sample
Before a TLS ciphersuite can be used with QUIC, a header protection Before a TLS ciphersuite 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 ciphersuite.
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, AEAD_AES_256_CCM (all AES AEADs AEAD_AES_128_CCM, AEAD_AES_256_GCM (all AES AEADs are defined in
are defined in [AEAD]), and AEAD_CHACHA20_POLY1305 [CHACHA]. Prior [AEAD]), and AEAD_CHACHA20_POLY1305 [CHACHA]. Prior to TLS selecting
to TLS selecting a ciphersuite, AES header protection is used a ciphersuite, AES header protection is used (Section 5.4.3),
(Section 5.4.3), matching the AEAD_AES_128_GCM packet protection. 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. For the AEAD functions defined in [TLS13], for header protection. The ciphersuites defined in [TLS13] - other
which have 16-byte expansions and 16-byte header protection samples, than TLS_AES_128_CCM_8_SHA256, for which a header protection scheme
this results in needing at least 3 bytes of frames in the unprotected is not defined in this document - have 16-byte expansions and 16-byte
payload if the packet number is encoded on a single byte, or 2 bytes header protection samples. This results in needing at least 3 bytes
of frames for a 2-byte packet number encoding. 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
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
skipping to change at page 23, line 41 skipping to change at page 24, line 17
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, AEAD_AES_256_GCM, and AEAD_AES_128_GCM, AEAD_AES_128_CCM, and AEAD_AES_256_GCM.
AEAD_AES_256_CCM. AEAD_AES_128_GCM and AEAD_AES_128_CCM use 128-bit AEAD_AES_128_GCM and AEAD_AES_128_CCM use 128-bit AES [AES] in
AES [AES] in electronic code-book (ECB) mode. AEAD_AES_256_GCM, and electronic code-book (ECB) mode. AEAD_AES_256_GCM uses 256-bit AES
AEAD_AES_256_CCM use 256-bit AES in ECB mode. in ECB mode.
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 25, line 12 skipping to change at page 25, line 34
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
accepted by a server can send 0-RTT data until it receives all of the accepted by a server can send 0-RTT data until it receives all of the
server's handshake messages. A client SHOULD stop sending 0-RTT data server's handshake messages. A client SHOULD stop sending 0-RTT data
if it receives an indication that 0-RTT data has been rejected. if it receives an indication that 0-RTT data has been rejected.
A server MUST NOT use 0-RTT keys to protect packets; it uses 1-RTT A server MUST NOT use 0-RTT keys to protect packets; it uses 1-RTT
keys to protect acknowledgements of 0-RTT packets. A client MUST NOT keys to protect acknowledgements of 0-RTT packets. A client MUST NOT
attempt to decrypt 0-RTT packets it receives and instead MUST discard attempt to decrypt 0-RTT packets it receives and instead MUST discard
them. them.
Once a client has installed 1-RTT keys, it MUST NOT send any more
0-RTT packets.
Note: 0-RTT data can be acknowledged by the server as it receives Note: 0-RTT data can be acknowledged by the server as it receives
it, but any packets containing acknowledgments of 0-RTT data it, but any packets containing acknowledgments of 0-RTT data
cannot have packet protection removed by the client until the TLS cannot have packet protection removed by the client until the TLS
handshake is complete. The 1-RTT keys necessary to remove packet handshake is complete. The 1-RTT keys necessary to remove packet
protection cannot be derived until the client receives all server protection cannot be derived until the client receives all server
handshake messages. handshake messages.
5.7. Receiving Out-of-Order Protected Frames 5.7. Receiving Out-of-Order Protected Frames
Due to reordering and loss, protected packets might be received by an Due to reordering and loss, protected packets might be received by an
endpoint before the final TLS handshake messages are received. A endpoint before the final TLS handshake messages are received. A
client will be unable to decrypt 1-RTT packets from the server, client will be unable to decrypt 1-RTT packets from the server,
whereas a server will be able to decrypt 1-RTT packets from the whereas a server will be able to decrypt 1-RTT packets from the
client. client.
However, a server MUST NOT process data from incoming 1-RTT protected Even though 1-RTT keys are available to a server after receiving the
packets before verifying either the client Finished message or - in first handshake messages from a client, it is missing assurances on
the case that the server has chosen to use a pre-shared key - the the client state:
pre-shared key binder (see Section 4.2.11 of [TLS13]). Verifying
these values provides the server with an assurance that the o The client is not authenticated, unless the server has chosen to
ClientHello has not been modified. Packets protected with 1-RTT keys use a pre-shared key and validated the client's pre-shared key
MAY be stored and later decrypted and used once the handshake is binder; see Section 4.2.11 of [TLS13].
complete.
o The client has not demonstrated liveness, unless a RETRY packet
was used.
o Any received 0-RTT data that the server responds to might be due
to a replay attack.
Therefore, the server's use of 1-RTT keys is limited before the
handshake is complete. A server MUST NOT process data from incoming
1-RTT protected packets before the TLS handshake is complete.
Because sending acknowledgments indicates that all frames in a packet
have been processed, a server cannot send acknowledgments for 1-RTT
packets until the TLS handshake is complete. Received packets
protected with 1-RTT keys MAY be stored and later decrypted and used
once the handshake is complete.
The requirement for the server to wait for the client Finished
message creates a dependency on that message being delivered. A
client can avoid the potential for head-of-line blocking that this
implies by sending its 1-RTT packets coalesced with a handshake
packet containing a copy of the CRYPTO frame that carries the
Finished message, until one of the handshake packets is acknowledged.
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.
6. Key Update 6. Key Update
Once the 1-RTT keys are established and the short header is in use, Once the handshake is confirmed, it is possible to update the keys.
it is possible to update the keys. The KEY_PHASE bit in the short The KEY_PHASE bit in the short header is used to indicate whether key
header is used to indicate whether key updates have occurred. The updates have occurred. The KEY_PHASE bit is initially set to 0 and
KEY_PHASE bit is initially set to 0 and then inverted with each key then inverted with each 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 necessarily needing to receive the first packet that material without necessarily needing to receive the first packet that
triggered the change. An endpoint that notices a changed KEY_PHASE triggered the change. An endpoint that notices a changed KEY_PHASE
bit can update keys and decrypt the packet that contains the changed bit can update keys and decrypt the packet that contains the changed
bit. bit.
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.8). Section 4.8).
An endpoint MUST NOT initiate more than one key update at a time. A An endpoint MUST NOT initiate the first key update until the
new key cannot be used until the endpoint has received and handshake is confirmed (Section 4.1.2). An endpoint MUST NOT
successfully decrypted a packet with a matching KEY_PHASE. initiate a subsequent key update until it has received an
acknowledgment for a packet sent at the current KEY_PHASE. This can
be implemented by tracking the lowest packet number sent with each
KEY_PHASE, and the highest acknowledged packet number in the 1-RTT
space: once the latter is higher than or equal to the former, another
key update can be initiated.
Endpoints MAY limit the number of keys they retain to two sets for
removing packet protection and one set for protecting packets. Older
keys can be discarded. Updating keys multiple times rapidly can
cause packets to be effectively lost if packets are significantly
reordered. Therefore, an endpoint SHOULD NOT initiate a key update
for some time after it has last updated keys; the RECOMMENDED time
period is three times the PTO. This avoids valid reordered packets
being dropped by the peer as a result of the peer discarding older
keys.
A receiving endpoint detects an update when the KEY_PHASE bit does A receiving endpoint detects an update when the KEY_PHASE bit does
not match what it is expecting. It creates a new secret (see not match what it is expecting. It creates a new secret (see
Section 7.2 of [TLS13]) and the corresponding read key and IV using Section 7.2 of [TLS13]) and the corresponding read key and IV using
the KDF function provided by TLS. The header protection key is not the KDF function provided by TLS. The header protection key is not
updated. updated.
If the packet can be decrypted and authenticated using the updated If the packet can be decrypted and authenticated using the updated
key and IV, then the keys the endpoint uses for packet protection are key and IV, then the keys the endpoint uses for packet protection are
also updated. The next packet sent by the endpoint will then use the also updated. The next packet sent by the endpoint MUST then use the
new keys. new keys. Once an endpoint has sent a packet encrypted with a given
key phase, it MUST NOT send a packet encrypted with an older key
phase.
An endpoint does not always need to send packets when it detects that An endpoint does not always need to send packets when it detects that
its peer has updated keys. The next packet that it sends will simply its peer has updated keys. The next packet that it sends will simply
use the new keys. If an endpoint detects a second update before it use the new keys. If an endpoint detects a second update before it
has sent any packets with updated keys, it indicates that its peer has sent any packets with updated keys, it indicates that its peer
has updated keys twice without awaiting a reciprocal update. An has updated keys twice without awaiting a reciprocal update. An
endpoint MUST treat consecutive key updates as a fatal error and endpoint MUST treat consecutive key updates as a fatal error and
abort the connection. abort the connection.
An endpoint SHOULD retain old keys for a period of no more than three An endpoint SHOULD retain old keys for a period of no more than three
times the Probe Timeout (PTO, see [QUIC-RECOVERY]). After this times the PTO. After this period, old keys and their corresponding
period, old keys and their corresponding secrets SHOULD be discarded. secrets SHOULD be discarded. Retaining keys allow endpoints to
Retaining keys allow endpoints to process packets that were sent with process packets that were sent with old keys and delayed in the
old keys and delayed in the network. Packets with higher packet network. Packets with higher packet numbers always use the updated
numbers always use the updated keys and MUST NOT be decrypted with keys and MUST NOT be decrypted with old keys.
old keys.
This ensures that once the handshake is complete, packets with the This ensures that once the handshake is complete, packets with the
same KEY_PHASE will have the same packet protection keys, unless same KEY_PHASE will have the same packet protection keys, unless
there are multiple key updates in a short time frame succession and there are multiple key updates in a short time frame succession and
significant packet reordering. significant packet reordering.
Initiating Peer Responding Peer Initiating Peer Responding Peer
@M QUIC Frames @M QUIC Frames
New Keys -> @N New Keys -> @N
skipping to change at page 29, line 16 skipping to change at page 30, line 24
quic_transport_parameters(0xffa5), (65535) quic_transport_parameters(0xffa5), (65535)
} ExtensionType; } ExtensionType;
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. The quic_transport_parameters extension carries a use. The quic_transport_parameters extension carries a
TransportParameters struct when the version of QUIC defined in TransportParameters struct when the version of QUIC defined in
[QUIC-TRANSPORT] is used. [QUIC-TRANSPORT] is used.
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. and the EncryptedExtensions messages during the handshake. Endpoints
MUST send the quic_transport_parameters extension; endpoints that
receive ClientHello or EncryptedExtensions messages without the
quic_transport_parameters extension MUST terminate the TLS handshake
with a fatal missing_extension alert (an error of 0x16d).
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 33, line 43 skipping to change at page 35, line 7
[AES] "Advanced encryption standard (AES)", National Institute [AES] "Advanced encryption standard (AES)", National Institute
of Standards and Technology report, of Standards and Technology report,
DOI 10.6028/nist.fips.197, November 2001. DOI 10.6028/nist.fips.197, November 2001.
[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>.
[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", draft-ietf-quic-recovery-20 (work and Congestion Control", draft-ietf-quic-recovery-latest
in progress). (work in progress).
[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", draft-ietf-quic- Multiplexed and Secure Transport", draft-ietf-quic-
transport-20 (work in progress). transport-latest (work in progress).
[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>.
[RFC7301] Friedl, S., Popov, A., Langley, A., and E. Stephan, [RFC7301] 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>.
skipping to change at page 34, line 39 skipping to change at page 35, line 49
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] [AEBounds]
Luykx, A. and K. Paterson, "Limits on Authenticated Luykx, A. and K. Paterson, "Limits on Authenticated
Encryption Use in TLS", March 2016, Encryption Use in TLS", March 2016,
<http://www.isg.rhul.ac.uk/~kp/TLS-AEbounds.pdf>. <http://www.isg.rhul.ac.uk/~kp/TLS-AEbounds.pdf>.
[CCM] McGrew, D. and D. Bailey, "AES-CCM Cipher Suites for
Transport Layer Security (TLS)", RFC 6655,
DOI 10.17487/RFC6655, July 2012,
<https://www.rfc-editor.org/info/rfc6655>.
[IMC] Katz, J. and Y. Lindell, "Introduction to Modern [IMC] Katz, J. and Y. Lindell, "Introduction to Modern
Cryptography, Second Edition", ISBN 978-1466570269, Cryptography, Second Edition", ISBN 978-1466570269,
November 2014. November 2014.
[QUIC-HTTP] [QUIC-HTTP]
Bishop, M., Ed., "Hypertext Transfer Protocol (HTTP) over Bishop, M., Ed., "Hypertext Transfer Protocol (HTTP) over
QUIC", draft-ietf-quic-http-20 (work in progress). QUIC", draft-ietf-quic-http-latest (work in progress).
[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>.
skipping to change at page 36, line 52 skipping to change at page 38, line 16
4131a0e8f309a1d0b9c4000006130113 031302010000910000000b0009000006 4131a0e8f309a1d0b9c4000006130113 031302010000910000000b0009000006
736572766572ff01000100000a001400 12001d00170018001901000101010201 736572766572ff01000100000a001400 12001d00170018001901000101010201
03010400230000003300260024001d00 204cfdfcd178b784bf328cae793b136f 03010400230000003300260024001d00 204cfdfcd178b784bf328cae793b136f
2aedce005ff183d7bb14952072366470 37002b0003020304000d0020001e0403 2aedce005ff183d7bb14952072366470 37002b0003020304000d0020001e0403
05030603020308040805080604010501 060102010402050206020202002d0002 05030603020308040805080604010501 060102010402050206020202002d0002
0101001c00024001 0101001c00024001
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:
c3ff000012508394c8f03e51570800449f00000002 c3ff000015508394c8f03e51570800449f00000002
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 = 0000f3a694c75775b4e546172ce9e047 sample = 65f354ebb400418b614f73765009c016
mask = AES-ECB(hp, sample)[0..4] mask = AES-ECB(hp, sample)[0..4]
= 020dbc1958 = 519bd343ff
header[0] ^= mask[0] & 0x0f header[0] ^= mask[0] & 0x0f
= c1 = c2
header[17..20] ^= mask[1..4] header[17..20] ^= mask[1..4]
= 0dbc195a = 9bd343fd
header = c1ff000012508394c8f03e51570800449f0dbc195a header = c2ff000015508394c8f03e51570800449f9bd343fd
The resulting protected packet is: The resulting protected packet is:
c1ff000012508394c8f03e5157080044 9f0dbc195a0000f3a694c75775b4e546 c2ff000015508394c8f03e5157080044 9f9bd343fd65f354ebb400418b614f73
172ce9e047cd0b5bee5181648c727adc 87f7eae54473ec6cba6bdad4f5982317 765009c0162d594777f9e6ddeb32fba3 865cffd7e26e3724d4997cdde8df34f8
4b769f12358abd292d4f3286934484fb 8b239c38732e1f3bbbc6a003056487eb 868772fed2412d43046f44dc7c6adf5e e10da456d56c892c8f69594594e8dcab
8b5c88b9fd9279ffff3b0f4ecf95c462 4db6d65d4113329ee9b0bf8cdd7c8a8d edb10d591130ca464588f2834eab931b 10feb963c1947a05f57062692c242248
72806d55df25ecb66488bc119d7c9a29 abaf99bb33c56b08ad8c26995f838bb3 ad0133b31f6dcc585ba344ca5beb382f b619272e65dfccae59c08eb00b7d2a5b
b7a3d5c1858b8ec06b839db2dcf918d5 ea9317f1acd6b663cc8925868e2f6a1b bccd888582df1d1aee040aea76ab4dfd cae126791e71561b1f58312edb31c164
da546695f3c3f33175944db4a11a346a fb07e78489e509b02add51b7b203eda5 ff1341fd2820e2399946bad901e425da e58a9859ef1825e7d757a6291d9ba6ee
c330b03641179a31fbba9b56ce00f3d5 b5e3d7d9c5429aebb9576f2f7eacbe27 1a8c836dc0027cd705bd2bc67f56bad0 024efaa3819cbb5d46cefdb7e0df3ad9
bc1b8082aaf68fb69c921aa5d33ec0c8 510410865a178d86d7e54122d55ef2c2 2b0689650e2b49ac29e6398bedc75554 1a3f3865bc4759bec74d721a28a0452c
bbc040be46d7fece73fe8a1b24495ec1 60df2da9b20a7ba2f26dfa2a44366dbc 1260189e8e92f844c91b27a00fc5ed6d 14d8fceb5a848bea0a3208162c7a9578
63de5cd7d7c94c57172fe6d79c901f02 5c0010b02c89b395402c009f62dc053b 2fcf9a045b20b76710a2565372f25411 81030e4350e199e62fa4e2e0bba19ff6
8067a1e0ed0a1e0cf5087d7f78cbd94a fe0c3dd55d2d4b1a5cfe2b68b86264e3 6662ab8cc6815eeaa20b80d5f31c41e5 51f558d2c836a215ccff4e8afd2fec4b
51d1dcd858783a240f893f008ceed743 d969b8f735a1677ead960b1fb1ecc5ac fcb9ea9d051d12162f1b14842489b69d 72a307d9144fced64fc4aa21ebd310f8
83c273b49288d02d7286207e663c45e1 a7baf50640c91e762941cf380ce8d79f 97cf00062e90dad5dbf04186622e6c12 96d388176585fdb395358ecfec4d95db
3e86767fbbcd25b42ef70ec334835a3a 6d792e170a432ce0cb7bde9aaa1e7563 4429f4473a76210866fd180eaeb60da4 33500c74c00aef24d77eae81755faa03
7c1c34ae5fef4338f53db8b13a4d2df5 94efbfa08784543815c9c0d487bddfa1 e71a8879937b32d31be2ba51d41b5d7a 1fbb4d952b10dd2d6ec171a3187cf3f6
539bc252cf43ec3686e9802d651cfd2a 829a06a9f332a733a4a8aed80efe3478 4d520afad796e4188bc32d153241c083 f225b6e6b845ce9911bd3fe1eb4737b7
093fbc69c8608146b3f16f1a5c4eac93 20da49f1afa5f538ddecbbe7888f4355 1c8d55e3962871b73657b1e2cce368c7 400658d47cfd9290ed16cdc2a6e3e7dc
12d0dd74fd9b8c99e3145ba84410d8ca 9a36dd884109e76e5fb8222a52e1473d ea77fb5c6459303a32d58f62969d8f46 70ce27f591c7a59cc3e7556eda4c58a3
a168519ce7a8a3c32e9149671b16724c 6c5c51bb5cd64fb591e567fb78b10f9f 2e9f53fd7f9d60a9c05cd6238c71e3c8 2d2efabd3b5177670b8d595151d7eb44
6fee62c276f282a7df6bcf7c17747bc9 a81e6c9c3b032fdd0e1c3ac9eaa5077d aa401fe3b5b87bdb88dffb2bfb6d1d0d 8868a41ba96265ca7a68d06fc0b74bcc
e3ded18b2ed4faf328f49875af2e36ad 5ce5f6cc99ef4b60e57b3b5b9c9fcbcd ac55b038f8362b84d47f52744323d08b 46bfec8c421f991e1394938a546a7482
4cfb3975e70ce4c2506bcd71fef0e535 92461504e3d42c885caab21b782e2629 a17c72be109ea4b0c71abc7d9c0ac096 0327754e1043f18a32b9fb402fc33fdc
4c6a9d61118cc40a26f378441ceb48f3 1a362bf8502a723a36c63502229a462c b6a0b4fdbbddbdf0d85779879e98ef21 1d104a5271f22823f16942cfa8ace68d
c2a3796279a5e3a7f81a68c7f81312c3 81cc16a4ab03513a51ad5b54306ec1d7 0c9e5b52297da9702d8f1de24bcd0628 4ac8aa1068fa21a82abbca7e7454b848
8a5e47e2b15e5b7a1438e5b8b2882dbd ad13d6a4a8c3558cae043501b68eb3b0 d7de8c3d43560541a362ff4f6be06c01 15e3a733bff44417da11ae668857bba2
40067152337c051c40b5af809aca2856 986fd1c86a4ade17d254b6262ac1bc07 c53ba17db8c100f1b5c7c9ea960d3f3d 3b9e77c16c31a222b498a7384e286b9b
7343b52bf89fa27d73e3c6f3118c9961 f0bebe68a5c323c2d84b8c29a2807df6 7c45167d5703de715f9b06708403562d cff77fdf2793f94e294888cebe8da4ee
63635223242a2ce9828d4429ac270aab 5f1841e8e49cf433b1547989f419caa3 88a53e38f2430addc161e8b2e2f2d405 41d10cda9a7aa518ac14d0195d8c2012
c758fff96ded40cf3427f0761b678daa 1a9e5554465d46b7a917493fc70f9ec5 0b4f1d47d6d0909e69c4a0e641b83c1a d4fff85af4751035bc5698b6141ecc3f
e4e5d786ca501730898aaa1151dcd318 29641e29428d90e6065511c24d3109f7 bffcf2f55036880071ba118927400796 7f64468172854d140d229320d689f576
cba32225d4accfc54fec42b733f95852 52ee36fa5ea0c656934385b468eee245 60f6c445e629d15ff2dcdff4b71a41ec 0c24bd2fd8f5ad13b2c3688e0fdb8dbc
315146b8c047ed27c519b2c0a52d33ef e72c186ffe0a230f505676c5324baa6a ce42e6cf49cf60d022ccd5b19b4fd5d9 8dc10d9ce3a626851b1fdd23e1fa3a96
e006a73e13aa8c39ab173ad2b2778eea 0b34c46f2b3beae2c62a2c8db238bf58 1f9b0333ab8d632e48c944b82bdd9e80 0fa2b2b9e31e96aee54b40edaf6b79ec
fc7c27bdceb96c56d29deec87c12351b fd5962497418716a4b915d334ffb5b92 211fdc95d95ef552aa532583d76a539e 988e416a0a10df2550cdeacafc3d61b0
ca94ffe1e4f78967042638639a9de325 357f5f08f6435061e5a274703936c06f b0a79337960a0be8cf6169e4d55fa6e7 a9c2e8efabab3da008f5bcc38c1bbabd
c56af92c420797499ca431a7abaa4618 63bca656facfad564e6274d4a741033a b6c10368723da0ae83c4b1819ff54946 e7806458d80d7be2c867d46fe1f029c5
ca1e31bf63200df41cdf41c10b912bec e952eb19ded16fabb19980480eb0fbcd
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 0d0000000018410a020000560303eefc e7f7b37ba1d1632e96677825ddf73988
cfc79825df566dc5430b9a045a120013 0100002e00330024001d00209d3c940d cfc79825df566dc5430b9a045a120013 0100002e00330024001d00209d3c940d
89690b84d08a60993c144eca684d1081 287c834d5311bcf32bb9da1a002b0002 89690b84d08a60993c144eca684d1081 287c834d5311bcf32bb9da1a002b0002
0304 0304
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:
c1ff00001205f067a5502a4262b50040740001 c1ff00001505f067a5502a4262b50040740001
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 = c4c2a2303d297e3c519bf6b22386e3d0 sample = 6176fa3b713f272a9bf03ee28d3c8add
mask = 75f7ec8b62 mask = 5bd74a846c
header = c4ff00001205f067a5502a4262b5004074f7ed header = caff00001505f067a5502a4262b5004074d74b
The final protected packet is then: The final protected packet is then:
c4ff00001205f067a5502a4262b50040 74f7ed5f01c4c2a2303d297e3c519bf6 caff00001505f067a5502a4262b50040 74d74b7e486176fa3b713f272a9bf03e
b22386e3d0bd6dfc6612167729803104 1bb9a79c9f0f9d4c5877270a660f5da3 e28d3c8addb4e805b3a110b663122a75 eee93c9177ac6b7a6b548e15a7b8f884
6207d98b73839b2fdf2ef8e7df5a51b1 7b8c68d864fd3e708c6c1b71a98a3318 65e9eab253a760779b2e6a2c574882b4 8d3a3eed696e50d04d5ec59af85261e4
15599ef5014ea38c44bdfd387c03b527 5c35e009b6238f831420047c7271281c cdbe264bd65f2b076760c69beef23aa7 14c9a174d69034c09a2863e1e1863508
cb54df7884 8d4afdeab9
Appendix B. Change Log Appendix B. 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.
B.1. Since draft-ietf-quic-tls-18 B.1. Since draft-ietf-quic-tls-18
 End of changes. 45 change blocks. 
221 lines changed or deleted 279 lines changed or added

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