< draft-ietf-quic-tls-06.txt   draft-ietf-quic-tls-07.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: March 26, 2018 sn3rd Expires: April 16, 2018 sn3rd
September 22, 2017 October 13, 2017
Using Transport Layer Security (TLS) to Secure QUIC Using Transport Layer Security (TLS) to Secure QUIC
draft-ietf-quic-tls-06 draft-ietf-quic-tls-07
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
https://mailarchive.ietf.org/arch/search/?email_list=quic . https://mailarchive.ietf.org/arch/search/?email_list=quic [1].
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 [2]; 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 [3].
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 http://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 March 26, 2018. This Internet-Draft will expire on April 16, 2018.
Copyright Notice Copyright Notice
Copyright (c) 2017 IETF Trust and the persons identified as the Copyright (c) 2017 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
(http://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
carefully, as they describe your rights and restrictions with respect carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must to this document. Code Components extracted from this document must
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
skipping to change at page 2, line 37 skipping to change at page 2, line 37
4.2.3. Key Ready Events . . . . . . . . . . . . . . . . . . 11 4.2.3. Key Ready Events . . . . . . . . . . . . . . . . . . 11
4.2.4. Secret Export . . . . . . . . . . . . . . . . . . . . 12 4.2.4. Secret Export . . . . . . . . . . . . . . . . . . . . 12
4.2.5. TLS Interface Summary . . . . . . . . . . . . . . . . 12 4.2.5. TLS Interface Summary . . . . . . . . . . . . . . . . 12
4.3. TLS Version . . . . . . . . . . . . . . . . . . . . . . . 13 4.3. TLS Version . . . . . . . . . . . . . . . . . . . . . . . 13
4.4. ClientHello Size . . . . . . . . . . . . . . . . . . . . 13 4.4. ClientHello Size . . . . . . . . . . . . . . . . . . . . 13
4.5. Peer Authentication . . . . . . . . . . . . . . . . . . . 13 4.5. Peer Authentication . . . . . . . . . . . . . . . . . . . 13
4.6. TLS Errors . . . . . . . . . . . . . . . . . . . . . . . 14 4.6. TLS Errors . . . . . . . . . . . . . . . . . . . . . . . 14
5. QUIC Packet Protection . . . . . . . . . . . . . . . . . . . 14 5. QUIC Packet Protection . . . . . . . . . . . . . . . . . . . 14
5.1. Installing New Keys . . . . . . . . . . . . . . . . . . . 14 5.1. Installing New Keys . . . . . . . . . . . . . . . . . . . 14
5.2. QUIC Key Expansion . . . . . . . . . . . . . . . . . . . 15 5.2. QUIC Key Expansion . . . . . . . . . . . . . . . . . . . 15
5.2.1. 0-RTT Secret . . . . . . . . . . . . . . . . . . . . 15 5.2.1. Cleartext Packet Secrets . . . . . . . . . . . . . . 15
5.2.2. 1-RTT Secrets . . . . . . . . . . . . . . . . . . . . 15 5.2.2. 0-RTT Secret . . . . . . . . . . . . . . . . . . . . 16
5.2.3. Packet Protection Key and IV . . . . . . . . . . . . 17 5.2.3. 1-RTT Secrets . . . . . . . . . . . . . . . . . . . . 16
5.3. QUIC AEAD Usage . . . . . . . . . . . . . . . . . . . . . 17 5.2.4. Packet Protection Key and IV . . . . . . . . . . . . 17
5.4. Packet Numbers . . . . . . . . . . . . . . . . . . . . . 18 5.3. QUIC AEAD Usage . . . . . . . . . . . . . . . . . . . . . 18
5.4. Packet Numbers . . . . . . . . . . . . . . . . . . . . . 19
5.5. Receiving Protected Packets . . . . . . . . . . . . . . . 19 5.5. Receiving Protected Packets . . . . . . . . . . . . . . . 19
5.6. Packet Number Gaps . . . . . . . . . . . . . . . . . . . 19 5.6. Packet Number Gaps . . . . . . . . . . . . . . . . . . . 20
6. Unprotected Packets . . . . . . . . . . . . . . . . . . . . . 19 6. Key Phases . . . . . . . . . . . . . . . . . . . . . . . . . 20
6.1. Integrity Check Processing . . . . . . . . . . . . . . . 19 6.1. Packet Protection for the TLS Handshake . . . . . . . . . 20
6.2. The 64-bit FNV-1a Algorithm . . . . . . . . . . . . . . . 20 6.1.1. Initial Key Transitions . . . . . . . . . . . . . . . 21
7. Key Phases . . . . . . . . . . . . . . . . . . . . . . . . . 20 6.1.2. Retransmission and Acknowledgment of Unprotected
7.1. Packet Protection for the TLS Handshake . . . . . . . . . 21 Packets . . . . . . . . . . . . . . . . . . . . . . . 21
7.1.1. Initial Key Transitions . . . . . . . . . . . . . . . 21 6.2. Key Update . . . . . . . . . . . . . . . . . . . . . . . 22
7.1.2. Retransmission and Acknowledgment of Unprotected 7. Client Address Validation . . . . . . . . . . . . . . . . . . 24
Packets . . . . . . . . . . . . . . . . . . . . . . . 22 7.1. HelloRetryRequest Address Validation . . . . . . . . . . 24
7.2. Key Update . . . . . . . . . . . . . . . . . . . . . . . 23 7.1.1. Stateless Address Validation . . . . . . . . . . . . 25
7.1.2. Sending HelloRetryRequest . . . . . . . . . . . . . . 25
8. Client Address Validation . . . . . . . . . . . . . . . . . . 24 7.2. NewSessionTicket Address Validation . . . . . . . . . . . 25
8.1. HelloRetryRequest Address Validation . . . . . . . . . . 25 7.3. Address Validation Token Integrity . . . . . . . . . . . 26
8.1.1. Stateless Address Validation . . . . . . . . . . . . 25 8. Pre-handshake QUIC Messages . . . . . . . . . . . . . . . . . 26
8.1.2. Sending HelloRetryRequest . . . . . . . . . . . . . . 26 8.1. Unprotected Packets Prior to Handshake Completion . . . . 27
8.2. NewSessionTicket Address Validation . . . . . . . . . . . 26 8.1.1. STREAM Frames . . . . . . . . . . . . . . . . . . . . 27
8.3. Address Validation Token Integrity . . . . . . . . . . . 27 8.1.2. ACK Frames . . . . . . . . . . . . . . . . . . . . . 28
9. Pre-handshake QUIC Messages . . . . . . . . . . . . . . . . . 27 8.1.3. Updates to Data and Stream Limits . . . . . . . . . . 28
9.1. Unprotected Packets Prior to Handshake Completion . . . . 28 8.1.4. Denial of Service with Unprotected Packets . . . . . 29
9.1.1. STREAM Frames . . . . . . . . . . . . . . . . . . . . 28 8.2. Use of 0-RTT Keys . . . . . . . . . . . . . . . . . . . . 29
9.1.2. ACK Frames . . . . . . . . . . . . . . . . . . . . . 28 8.3. Receiving Out-of-Order Protected Frames . . . . . . . . . 30
9.1.3. Updates to Data and Stream Limits . . . . . . . . . . 29 9. QUIC-Specific Additions to the TLS Handshake . . . . . . . . 30
9.1.4. Denial of Service with Unprotected Packets . . . . . 29 9.1. Protocol and Version Negotiation . . . . . . . . . . . . 30
9.2. Use of 0-RTT Keys . . . . . . . . . . . . . . . . . . . . 30 9.2. QUIC Transport Parameters Extension . . . . . . . . . . . 31
9.3. Receiving Out-of-Order Protected Frames . . . . . . . . . 30 9.3. Priming 0-RTT . . . . . . . . . . . . . . . . . . . . . . 31
10. QUIC-Specific Additions to the TLS Handshake . . . . . . . . 31 10. Security Considerations . . . . . . . . . . . . . . . . . . . 32
10.1. Protocol and Version Negotiation . . . . . . . . . . . . 31 10.1. Packet Reflection Attack Mitigation . . . . . . . . . . 32
10.2. QUIC Transport Parameters Extension . . . . . . . . . . 32 10.2. Peer Denial of Service . . . . . . . . . . . . . . . . . 32
10.3. Priming 0-RTT . . . . . . . . . . . . . . . . . . . . . 32 11. Error Codes . . . . . . . . . . . . . . . . . . . . . . . . . 33
11. Security Considerations . . . . . . . . . . . . . . . . . . . 33 12. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 33
11.1. Packet Reflection Attack Mitigation . . . . . . . . . . 33 13. References . . . . . . . . . . . . . . . . . . . . . . . . . 34
11.2. Peer Denial of Service . . . . . . . . . . . . . . . . . 33 13.1. Normative References . . . . . . . . . . . . . . . . . . 34
12. Error codes . . . . . . . . . . . . . . . . . . . . . . . . . 34 13.2. Informative References . . . . . . . . . . . . . . . . . 35
13. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 34 13.3. URIs . . . . . . . . . . . . . . . . . . . . . . . . . . 36
14. References . . . . . . . . . . . . . . . . . . . . . . . . . 34
14.1. Normative References . . . . . . . . . . . . . . . . . . 34
14.2. Informative References . . . . . . . . . . . . . . . . . 35
Appendix A. Contributors . . . . . . . . . . . . . . . . . . . . 36 Appendix A. Contributors . . . . . . . . . . . . . . . . . . . . 36
Appendix B. Acknowledgments . . . . . . . . . . . . . . . . . . 36 Appendix B. Acknowledgments . . . . . . . . . . . . . . . . . . 36
Appendix C. Change Log . . . . . . . . . . . . . . . . . . . . . 36 Appendix C. Change Log . . . . . . . . . . . . . . . . . . . . . 36
C.1. Since draft-ietf-quic-tls-05 . . . . . . . . . . . . . . 36 C.1. Since draft-ietf-quic-tls-06 . . . . . . . . . . . . . . 36
C.2. Since draft-ietf-quic-tls-04 . . . . . . . . . . . . . . 36 C.2. Since draft-ietf-quic-tls-05 . . . . . . . . . . . . . . 36
C.3. Since draft-ietf-quic-tls-03 . . . . . . . . . . . . . . 36 C.3. Since draft-ietf-quic-tls-04 . . . . . . . . . . . . . . 37
C.4. Since draft-ietf-quic-tls-02 . . . . . . . . . . . . . . 36 C.4. Since draft-ietf-quic-tls-03 . . . . . . . . . . . . . . 37
C.5. Since draft-ietf-quic-tls-01 . . . . . . . . . . . . . . 37 C.5. Since draft-ietf-quic-tls-02 . . . . . . . . . . . . . . 37
C.6. Since draft-ietf-quic-tls-00 . . . . . . . . . . . . . . 37 C.6. Since draft-ietf-quic-tls-01 . . . . . . . . . . . . . . 37
C.7. Since draft-thomson-quic-tls-01 . . . . . . . . . . . . . 37 C.7. Since draft-ietf-quic-tls-00 . . . . . . . . . . . . . . 37
C.8. Since draft-thomson-quic-tls-01 . . . . . . . . . . . . . 38
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 38 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 38
1. Introduction 1. Introduction
This document describes how QUIC [QUIC-TRANSPORT] is secured using This document describes how QUIC [QUIC-TRANSPORT] is secured using
Transport Layer Security (TLS) version 1.3 [I-D.ietf-tls-tls13]. TLS Transport Layer Security (TLS) version 1.3 [I-D.ietf-tls-tls13]. TLS
1.3 provides critical latency improvements for connection 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 7, line 29 skipping to change at page 7, line 29
o A pre-shared key mode can be used for subsequent handshakes to o A pre-shared key mode can be used for subsequent handshakes to
reduce the number of public key operations. This is the basis for reduce the number of public key operations. This is the basis for
0-RTT data, even if the remainder of the connection is protected 0-RTT data, even if the remainder of the connection is protected
by a new Diffie-Hellman exchange. by a new Diffie-Hellman exchange.
4. TLS Usage 4. TLS Usage
QUIC reserves stream 0 for a TLS connection. Stream 0 contains a QUIC reserves stream 0 for a TLS connection. Stream 0 contains a
complete TLS connection, which includes the TLS record layer. Other complete TLS connection, which includes the TLS record layer. Other
than the definition of a QUIC-specific extension (see Section 10.2), than the definition of a QUIC-specific extension (see Section 9.2),
TLS is unmodified for this use. This means that TLS will apply TLS is unmodified for this use. This means that TLS will apply
confidentiality and integrity protection to its records. In confidentiality and integrity protection to its records. In
particular, TLS record protection is what provides confidentiality particular, TLS record protection is what provides confidentiality
protection for the TLS handshake messages sent by the server. protection for the TLS handshake messages sent by the server.
QUIC permits a client to send frames on streams starting from the QUIC permits a client to send frames on streams starting from the
first packet. The initial packet from a client contains a stream first packet. The initial packet from a client contains a stream
frame for stream 0 that contains the first TLS handshake messages frame for stream 0 that contains the first TLS handshake messages
from the client. This allows the TLS handshake to start with the from the client. This allows the TLS handshake to start with the
first packet that a client sends. first packet that a client sends.
skipping to change at page 9, line 28 skipping to change at page 9, line 28
protection. These keys are not exported from the TLS connection for protection. These keys are not exported from the TLS connection for
use in QUIC. QUIC packets from the server are sent in the clear use in QUIC. QUIC packets from the server are sent in the clear
until the final transition to 1-RTT keys. until the final transition to 1-RTT keys.
The client transitions from cleartext (@C) to 0-RTT keys (@0) when The client transitions from cleartext (@C) to 0-RTT keys (@0) when
sending 0-RTT data, and subsequently to to 1-RTT keys (@1) after its sending 0-RTT data, and subsequently to to 1-RTT keys (@1) after its
second flight of TLS handshake messages. This creates the potential second flight of TLS handshake messages. This creates the potential
for unprotected packets to be received by a server in close proximity for unprotected packets to be received by a server in close proximity
to packets that are protected with 1-RTT keys. to packets that are protected with 1-RTT keys.
More information on key transitions is included in Section 7.1. More information on key transitions is included in Section 6.1.
4.2. Interface to TLS 4.2. Interface to TLS
As shown in Figure 1, the interface from QUIC to TLS consists of four As shown in Figure 1, the interface from QUIC to TLS consists of four
primary functions: Handshake, Source Address Validation, Key Ready primary functions: Handshake, Source Address Validation, Key Ready
Events, and Secret Export. Events, and Secret Export.
Additional functions might be needed to configure TLS. Additional functions might be needed to configure TLS.
4.2.1. Handshake Interface 4.2.1. Handshake Interface
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 on stream 0. There are two basic and receive handshake messages on stream 0. There are two basic
functions on this interface: one where QUIC requests handshake functions on this interface: one where QUIC requests handshake
messages and one where QUIC provides handshake packets. messages and one 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 10.2) that it wishes to carry. parameters (see Section 9.2) that it wishes to carry.
A QUIC client starts TLS by requesting TLS handshake octets from TLS. A QUIC client starts TLS by requesting TLS handshake octets from TLS.
The client acquires handshake octets before sending its first packet. The client acquires handshake octets before sending its first packet.
A QUIC server starts the process by providing TLS with stream 0 A QUIC server starts the process by providing TLS with stream 0
octets. octets.
Each time that an endpoint receives data on stream 0, it delivers the Each time that an endpoint receives data on stream 0, it delivers the
octets to TLS if it is able. Each time that TLS is provided with new octets to TLS if it is able. Each time that TLS is provided with new
data, new handshake octets are requested from TLS. TLS might not data, new handshake octets are requested from TLS. TLS might not
skipping to change at page 11, line 35 skipping to change at page 11, line 35
makes a second address validation request of QUIC, including the makes a second address validation request of QUIC, including the
value extracted from the cookie extension. In response to this value extracted from the cookie extension. In response to this
request, QUIC cannot ask for client address validation, it can only request, QUIC cannot ask for client address validation, it can only
abort or permit the connection attempt to proceed. abort or permit the connection attempt to proceed.
QUIC can provide a new address validation token for use in session QUIC can provide a new address validation token for use in session
resumption at any time after the handshake is complete. Each time a resumption at any time after the handshake is complete. Each time a
new token is provided TLS generates a NewSessionTicket message, with new token is provided TLS generates a NewSessionTicket message, with
the token included in the ticket. the token included in the ticket.
See Section 8 for more details on client address validation. See Section 7 for more details on client address validation.
4.2.3. Key Ready Events 4.2.3. Key Ready Events
TLS provides QUIC with signals when 0-RTT and 1-RTT keys are ready TLS provides QUIC with signals when 0-RTT and 1-RTT keys are ready
for use. These events are not asynchronous, they always occur for use. These events are not asynchronous, they always occur
immediately after TLS is provided with new handshake octets, or after immediately after TLS is provided with new handshake octets, or after
TLS produces handshake octets. TLS produces handshake octets.
When TLS completed its handshake, 1-RTT keys can be provided to QUIC. When TLS completed its handshake, 1-RTT keys can be provided to QUIC.
On both client and server, this occurs after sending the TLS Finished On both client and server, this occurs after sending the TLS Finished
skipping to change at page 14, line 47 skipping to change at page 14, line 47
additional overhead is small. additional overhead is small.
5.1. Installing New Keys 5.1. Installing New Keys
As TLS reports the availability of keying material, the packet As TLS reports the availability of keying material, the packet
protection keys and initialization vectors (IVs) are updated (see protection keys and initialization vectors (IVs) are updated (see
Section 5.2). The selection of AEAD function is also updated to Section 5.2). The selection of AEAD function is also updated to
match the AEAD negotiated by TLS. match the AEAD negotiated by TLS.
For packets other than any unprotected handshake packets (see For packets other than any unprotected handshake packets (see
Section 7.1), once a change of keys has been made, packets with Section 6.1), once a change of keys has been made, packets with
higher packet numbers MUST be sent with the new keying material. The higher packet numbers MUST be sent with the new keying material. The
KEY_PHASE bit on these packets is inverted each time new keys are KEY_PHASE bit on these packets is inverted each time new keys are
installed to signal the use of the new keys to the recipient (see installed to signal the use of the new keys to the recipient (see
Section 7 for details). Section 6 for details).
An endpoint retransmits stream data in a new packet. New packets An endpoint retransmits stream data in a new packet. New packets
have new packet numbers and use the latest packet protection keys. have new packet numbers and use the latest packet protection keys.
This simplifies key management when there are key updates (see This simplifies key management when there are key updates (see
Section 7.2). Section 6.2).
5.2. QUIC Key Expansion 5.2. QUIC Key Expansion
QUIC uses a system of packet protection secrets, keys and IVs that QUIC uses a system of packet protection secrets, keys and IVs that
are modelled on the system used in TLS [I-D.ietf-tls-tls13]. The are modelled on the system used in TLS [I-D.ietf-tls-tls13]. The
secrets that QUIC uses as the basis of its key schedule are obtained secrets that QUIC uses as the basis of its key schedule are obtained
using TLS exporters (see Section 7.5 of [I-D.ietf-tls-tls13]). using TLS exporters (see Section 7.5 of [I-D.ietf-tls-tls13]).
QUIC uses HKDF with the same hash function negotiated by TLS for key QUIC uses HKDF with the same hash function negotiated by TLS for key
derivation. For example, if TLS is using the TLS_AES_128_GCM_SHA256, derivation. For example, if TLS is using the TLS_AES_128_GCM_SHA256,
the SHA-256 hash function is used. the SHA-256 hash function is used.
5.2.1. 0-RTT Secret 5.2.1. Cleartext Packet Secrets
Cleartext packets are protected with secrets derived from the
client's connection ID. Specifically:
quic_version_1_salt = afc824ec5fc77eca1e9d36f37fb2d46518c36639
cleartext_secret = HKDF-Extract(quic_version_1_salt,
client_connection_id)
client_cleartext_secret =
HKDF-Expand-Label(cleartext_secret,
"QUIC client cleartext Secret",
"", Hash.length)
server_cleartext_secret =
HKDF-Expand-Label(cleartext_secret,
"QUIC server cleartext Secret",
"", Hash.length)
The HKDF for the cleartext packet protection keys uses the SHA-256
hash function [FIPS180].
The salt value is a 20 octet sequence shown in the figure in
hexadecimal notation. Future versions of QUIC SHOULD generate a new
salt value, thus ensuring that the keys are different for each
version of QUIC. This prevents a middlebox that only recognizes one
version of QUIC from seeing or modifying the contents of cleartext
packets from future versions.
5.2.2. 0-RTT Secret
0-RTT keys are those keys that are used in resumed connections prior 0-RTT keys are those keys that are used in resumed connections prior
to the completion of the TLS handshake. Data sent using 0-RTT keys to the completion of the TLS handshake. Data sent using 0-RTT keys
might be replayed and so has some restrictions on its use, see might be replayed and so has some restrictions on its use, see
Section 9.2. 0-RTT keys are used after sending or receiving a Section 8.2. 0-RTT keys are used after sending or receiving a
ClientHello. ClientHello.
The secret is exported from TLS using the exporter label "EXPORTER- The secret is exported from TLS using the exporter label "EXPORTER-
QUIC 0-RTT Secret" and an empty context. The size of the secret MUST QUIC 0-RTT Secret" and an empty context. The size of the secret MUST
be the size of the hash output for the PRF hash function negotiated be the size of the hash output for the PRF hash function negotiated
by TLS. This uses the TLS early_exporter_secret. The QUIC 0-RTT by TLS. This uses the TLS early_exporter_secret. The QUIC 0-RTT
secret is only used for protection of packets sent by the client. secret is only used for protection of packets sent by the client.
client_0rtt_secret client_0rtt_secret
= TLS-Exporter("EXPORTER-QUIC 0-RTT Secret" = TLS-Exporter("EXPORTER-QUIC 0-RTT Secret"
"", Hash.length) "", Hash.length)
5.2.2. 1-RTT Secrets 5.2.3. 1-RTT Secrets
1-RTT keys are used by both client and server after the TLS handshake 1-RTT keys are used by both client and server after the TLS handshake
completes. There are two secrets used at any time: one is used to completes. There are two secrets used at any time: one is used to
derive packet protection keys for packets sent by the client, the derive packet protection keys for packets sent by the client, the
other for packet protection keys on packets sent by the server. other for packet protection keys on packets sent by the server.
The initial client packet protection secret is exported from TLS The initial client packet protection secret is exported from TLS
using the exporter label "EXPORTER-QUIC client 1-RTT Secret"; the using the exporter label "EXPORTER-QUIC client 1-RTT Secret"; the
initial server packet protection secret uses the exporter label initial server packet protection secret uses the exporter label
"EXPORTER-QUIC server 1-RTT Secret". Both exporters use an empty "EXPORTER-QUIC server 1-RTT Secret". Both exporters use an empty
skipping to change at page 16, line 15 skipping to change at page 16, line 47
client_pp_secret_0 client_pp_secret_0
= TLS-Exporter("EXPORTER-QUIC client 1-RTT Secret" = TLS-Exporter("EXPORTER-QUIC client 1-RTT Secret"
"", Hash.length) "", Hash.length)
server_pp_secret_0 server_pp_secret_0
= TLS-Exporter("EXPORTER-QUIC server 1-RTT Secret" = TLS-Exporter("EXPORTER-QUIC server 1-RTT Secret"
"", Hash.length) "", Hash.length)
These secrets are used to derive the initial client and server packet These secrets are used to derive the initial client and server packet
protection keys. protection keys.
After a key update (see Section 7.2), these secrets are updated using After a key update (see Section 6.2), these secrets are updated using
the HKDF-Expand-Label function defined in Section 7.1 of the HKDF-Expand-Label function defined in Section 7.1 of
[I-D.ietf-tls-tls13]. HKDF-Expand-Label uses the PRF hash function [I-D.ietf-tls-tls13]. HKDF-Expand-Label uses the PRF hash function
negotiated by TLS. The replacement secret is derived using the negotiated by TLS. The replacement secret is derived using the
existing Secret, a Label of "QUIC client 1-RTT Secret" for the client existing Secret, a Label of "QUIC client 1-RTT Secret" for the client
and "QUIC server 1-RTT Secret" for the server, an empty HashValue, and "QUIC server 1-RTT Secret" for the server, an empty HashValue,
and the same output Length as the hash function selected by TLS for and the same output Length as the hash function selected by TLS for
its PRF. its PRF.
client_pp_secret_<N+1> client_pp_secret_<N+1>
= HKDF-Expand-Label(client_pp_secret_<N>, = HKDF-Expand-Label(client_pp_secret_<N>,
skipping to change at page 17, line 8 skipping to change at page 17, line 38
opaque label<10..255> = "tls13 " + Label; opaque label<10..255> = "tls13 " + Label;
uint8 hashLength; // Always 0 uint8 hashLength; // Always 0
} HkdfLabel; } HkdfLabel;
For example, the client packet protection secret uses an info For example, the client packet protection secret uses an info
parameter of: parameter of:
info = (HashLen / 256) || (HashLen % 256) || 0x1f || info = (HashLen / 256) || (HashLen % 256) || 0x1f ||
"tls13 QUIC client 1-RTT secret" || 0x00 "tls13 QUIC client 1-RTT secret" || 0x00
5.2.3. Packet Protection Key and IV 5.2.4. Packet Protection Key and IV
The complete key expansion uses an identical process for key The complete key expansion uses an identical process for key
expansion as defined in Section 7.3 of [I-D.ietf-tls-tls13], using expansion as defined in Section 7.3 of [I-D.ietf-tls-tls13], using
different values for the input secret. QUIC uses the AEAD function different values for the input secret. QUIC uses the AEAD function
negotiated by TLS. negotiated by TLS.
The packet protection key and IV used to protect the 0-RTT packets The packet protection key and IV used to protect the 0-RTT packets
sent by a client are derived from the QUIC 0-RTT secret. The packet sent by a client are derived from the QUIC 0-RTT secret. The packet
protection keys and IVs for 1-RTT packets sent by the client and protection keys and IVs for 1-RTT packets sent by the client and
server are derived from the current generation of client_pp_secret server are derived from the current generation of client_pp_secret
skipping to change at page 17, line 22 skipping to change at page 18, line 4
different values for the input secret. QUIC uses the AEAD function different values for the input secret. QUIC uses the AEAD function
negotiated by TLS. negotiated by TLS.
The packet protection key and IV used to protect the 0-RTT packets The packet protection key and IV used to protect the 0-RTT packets
sent by a client are derived from the QUIC 0-RTT secret. The packet sent by a client are derived from the QUIC 0-RTT secret. The packet
protection keys and IVs for 1-RTT packets sent by the client and protection keys and IVs for 1-RTT packets sent by the client and
server are derived from the current generation of client_pp_secret server are derived from the current generation of client_pp_secret
and server_pp_secret respectively. The length of the output is and server_pp_secret respectively. The length of the output is
determined by the requirements of the AEAD function selected by TLS. determined by the requirements of the AEAD function selected by TLS.
The key length is the AEAD key size. As defined in Section 5.3 of The key length is the AEAD key size. As defined in Section 5.3 of
[I-D.ietf-tls-tls13], the IV length is the larger of 8 or N_MIN (see [I-D.ietf-tls-tls13], the IV length is the larger of 8 or N_MIN (see
Section 4 of [RFC5116]). For any secret S, the corresponding key and Section 4 of [RFC5116]). For any secret S, the corresponding key and
IV are derived as shown below: IV are derived as shown below:
key = HKDF-Expand-Label(S, "key", "", key_length) key = HKDF-Expand-Label(S, "key", "", key_length)
iv = HKDF-Expand-Label(S, "iv", "", iv_length) iv = HKDF-Expand-Label(S, "iv", "", iv_length)
The QUIC record protection initially starts without keying material. The QUIC record protection initially starts without keying material.
When the TLS state machine reports that the ClientHello has been When the TLS state machine reports that the ClientHello has been
sent, the 0-RTT keys can be generated and installed for writing. sent, the 0-RTT keys can be generated and installed for writing.
When the TLS state machine reports completion of the handshake, the When the TLS state machine reports completion of the handshake, the
1-RTT keys can be generated and installed for writing. 1-RTT keys can be generated and installed for writing.
5.3. QUIC AEAD Usage 5.3. QUIC AEAD Usage
The Authentication Encryption with Associated Data (AEAD) [RFC5116] The Authentication Encryption with Associated Data (AEAD) [RFC5116]
function used for QUIC packet protection is AEAD that is negotiated function used for QUIC packet protection is AEAD that is negotiated
for use with the TLS connection. For example, if TLS is using the 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 used. TLS_AES_128_GCM_SHA256, the AEAD_AES_128_GCM function is used.
Regular QUIC packets are protected by an AEAD algorithm [RFC5116]. All QUIC packets other than Version Negotiation and Stateless Reset
Version negotiation and public reset packets are not protected. packets are protected with an AEAD algorithm [RFC5116]. Cleartext
packets are protected with AEAD_AES_128_GCM and a key derived from
the client's connection ID (see Section 5.2.1). This provides
protection against off-path attackers and robustness against QUIC
version unaware middleboxes, but not against on-path attackers.
Once TLS has provided a key, the contents of regular QUIC packets Once TLS has provided a key, the contents of regular QUIC packets
immediately after any TLS messages have been sent are protected by immediately after any TLS messages have been sent are protected by
the AEAD selected by TLS. the AEAD selected by TLS.
The key, K, is either the client packet protection key The key, K, is either the client packet protection key
(client_pp_key_n) or the server packet protection key (client_pp_key_n) or the server packet protection key
(server_pp_key_n), derived as defined in Section 5.2. (server_pp_key_n), derived as defined in Section 5.2.
The nonce, N, is formed by combining the packet protection IV (either The nonce, N, is formed by combining the packet protection IV (either
skipping to change at page 18, line 44 skipping to change at page 19, line 31
attacks where packets are dropped in other ways. QUIC is therefore attacks where packets are dropped in other ways. QUIC is therefore
not affected by this form of truncation. not affected by this form of truncation.
The QUIC packet number is not reset and it is not permitted to go The QUIC packet number is not reset and it is not permitted to go
higher than its maximum value of 2^64-1. This establishes a hard higher than its maximum value of 2^64-1. This establishes a hard
limit on the number of packets that can be sent. limit on the number of packets that can be sent.
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 for example [AEBounds]). This might
be lower than the packet number limit. An endpoint MUST initiate a be lower than the packet number limit. An endpoint MUST initiate a
key update (Section 7.2) prior to exceeding any limit set for the key update (Section 6.2) prior to exceeding any limit set for the
AEAD that is in use. AEAD that is in use.
TLS maintains a separate sequence number that is used for record TLS maintains a separate sequence number that is used for record
protection on the connection that is hosted on stream 0. This protection on the connection that is hosted on stream 0. This
sequence number is not visible to QUIC. sequence number is not visible to QUIC.
5.5. Receiving Protected Packets 5.5. Receiving Protected Packets
Once an endpoint successfully receives a packet with a given packet Once an endpoint successfully receives a packet with a given packet
number, it MUST discard all packets with higher packet numbers if number, it MUST discard all packets with higher packet numbers if
they cannot be successfully unprotected with either the same key, or they cannot be successfully unprotected with either the same key, or
- if there is a key update - the next packet protection key (see - if there is a key update - the next packet protection key (see
Section 7.2). Similarly, a packet that appears to trigger a key Section 6.2). Similarly, a packet that appears to trigger a key
update, but cannot be unprotected successfully MUST be discarded. update, but cannot be unprotected 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. Packet Number Gaps 5.6. Packet Number Gaps
[QUIC-TRANSPORT]; Section 7.5.1.1 also requires a secret to compute Section 7.5.1.1 of [QUIC-TRANSPORT] also requires a secret to compute
packet number gaps on connection ID transitions. That secret is packet number gaps on connection ID transitions. That secret is
computed as: computed as:
packet_number_secret packet_number_secret
= TLS-Exporter("EXPORTER-QUIC Packet Number Secret" = TLS-Exporter("EXPORTER-QUIC Packet Number Secret"
"", Hash.length) "", Hash.length)
6. Unprotected Packets 6. Key Phases
QUIC adds an integrity check to all cleartext packets. Cleartext
packets are not protected by the negotiated AEAD (see Section 5), but
instead include an integrity check. This check does not prevent the
packet from being altered, it exists for added resilience against
data corruption and to provide added assurance that the sender
intends to use QUIC.
Cleartext packets all use the long form of the QUIC header and so
will include a version number. For this version of QUIC, the
integrity check uses the 64-bit FNV-1a hash (see Section 6.2). The
output of this hash is appended to the payload of the packet.
The integrity check algorithm MAY change for other versions of the
protocol.
6.1. Integrity Check Processing
An endpoint sending a packet that has a long header and a type that
does not indicate that the packet will be protected (that is, 0-RTT
Encrypted (0x05), 1-RTT Encrypted (key phase 0) (0x06), or 1-RTT
Encrypted (key phase 1) (0x07)) first constructs the packet that it
sends without the integrity check.
The sender then calculates the integrity check over the entire
packet, starting from the type field. The output of the hash is
appended to the packet.
A receiver that receives an unprotected packet first checks that the
version is correct, then removes the trailing 8 octets. It
calculates the integrity check over the remainder of the packet.
Unprotected packets that do not contain a valid integrity check MUST
be discarded.
6.2. The 64-bit FNV-1a Algorithm
QUIC uses the 64-bit version of the alternative Fowler/Noll/Vo hash
(FNV-1a) [FNV].
FNV-1a can be expressed in pseudocode as:
hash := offset basis
for each input octet:
hash := hash XOR input octet
hash := hash * prime
That is, a 64-bit unsigned integer is initialized with an offset
basis. Then, for each octet of the input, the exclusive binary OR of
the value is taken, then multiplied by a prime. Any overflow from
multiplication is discarded.
The offset basis for the 64-bit FNV-1a is the decimal value
14695981039346656037 (in hex, 0xcbf29ce484222325). The prime is
1099511628211 (in hex, 0x100000001b3; or as an expression 2^40 + 2^8
+ 0xb3).
Once all octets have been processed in this fashion, the final
integer value is encoded as 8 octets in network byte order.
7. Key Phases
As TLS reports the availability of 0-RTT and 1-RTT keys, new keying As TLS reports the availability of 0-RTT and 1-RTT keys, new keying
material can be exported from TLS and used for QUIC packet material can be exported from TLS and used for QUIC packet
protection. At each transition during the handshake a new secret is protection. At each transition during the handshake a new secret is
exported from TLS and packet protection keys are derived from that exported from TLS and packet protection keys are derived from that
secret. secret.
Every time that a new set of keys is used for protecting outbound Every time that a new set of keys is used for protecting outbound
packets, the KEY_PHASE bit in the public flags is toggled. 0-RTT packets, the KEY_PHASE bit in the public flags is toggled. 0-RTT
protected packets use the QUIC long header, they do not use the protected packets use the QUIC long header, they do not use the
KEY_PHASE bit to select the correct keys (see Section 7.1.1). KEY_PHASE bit to select the correct keys (see Section 6.1.1).
Once the connection is fully enabled, the KEY_PHASE bit allows a Once the connection is fully enabled, the KEY_PHASE bit allows a
recipient to detect a change in keying material without necessarily recipient to detect a change in keying material without necessarily
needing to receive the first packet that triggered the change. An needing to receive the first packet that triggered the change. An
endpoint that notices a changed KEY_PHASE bit can update keys and endpoint that notices a changed KEY_PHASE bit can update keys and
decrypt the packet that contains the changed bit, see Section 7.2. decrypt the packet that contains the changed bit, see Section 6.2.
The KEY_PHASE bit is included as the 0x20 bit of the QUIC short The KEY_PHASE bit is included as the 0x20 bit of the QUIC short
header, or is determined by the packet type from the long header (a header, or is determined by the packet type from the long header (a
type of 0x06 indicates a key phase of 0, 0x07 indicates key phase 1). type of 0x06 indicates a key phase of 0, 0x07 indicates key phase 1).
Transitions between keys during the handshake are complicated by the Transitions between keys during the handshake are complicated by the
need to ensure that TLS handshake messages are sent with the correct need to ensure that TLS handshake messages are sent with the correct
packet protection. packet protection.
7.1. Packet Protection for the TLS Handshake 6.1. Packet Protection for the TLS Handshake
The initial exchange of packets are sent without protection. These
packets use a cleartext packet type.
TLS handshake messages MUST NOT be protected using QUIC packet The initial exchange of packets are sent using a cleartext packet
protection. All TLS handshake messages up to the TLS Finished type and AEAD-protected using the cleartext key generated as
message sent by either endpoint use cleartext packets. described in Section 5.2.1. All TLS handshake messages up to the TLS
Finished message sent by either endpoint use cleartext packets.
Any TLS handshake messages that are sent after completing the TLS Any TLS handshake messages that are sent after completing the TLS
handshake do not need special packet protection rules. Packets handshake do not need special packet protection rules. Packets
containing these messages use the packet protection keys that are containing these messages use the packet protection keys that are
current at the time of sending (or retransmission). current at the time of sending (or retransmission).
Like the client, a server MUST send retransmissions of its Like the client, a server MUST send retransmissions of its
unprotected handshake messages or acknowledgments for unprotected unprotected handshake messages or acknowledgments for unprotected
handshake messages sent by the client in cleartext packets. handshake messages sent by the client in cleartext packets.
7.1.1. Initial Key Transitions 6.1.1. Initial Key Transitions
Once the TLS handshake is complete, keying material is exported from Once the TLS handshake is complete, keying material is exported from
TLS and QUIC packet protection commences. TLS and used to protect QUIC packets.
Packets protected with 1-RTT keys initially have a KEY_PHASE bit set Packets protected with 1-RTT keys initially have a KEY_PHASE bit set
to 0. This bit inverts with each subsequent key update (see to 0. This bit inverts with each subsequent key update (see
Section 7.2). Section 6.2).
If the client sends 0-RTT data, it uses the 0-RTT packet type. The If the client sends 0-RTT data, it uses the 0-RTT packet type. The
packet that contains the TLS EndOfEarlyData and Finished messages are packet that contains the TLS EndOfEarlyData and Finished messages are
sent in cleartext packets. sent in cleartext packets.
Using distinct packet types during the handshake for handshake Using distinct packet types during the handshake for handshake
messages, 0-RTT data, and 1-RTT data ensures that the server is able messages, 0-RTT data, and 1-RTT data ensures that the server is able
to distinguish between the different keys used to remove packet to distinguish between the different keys used to remove packet
protection. All of these packets can arrive concurrently at a protection. All of these packets can arrive concurrently at a
server. server.
A server might choose to retain 0-RTT packets that arrive before a A server might choose to retain 0-RTT packets that arrive before a
TLS ClientHello. The server can then use those packets once the TLS ClientHello. The server can then use those packets once the
ClientHello arrives. However, the potential for denial of service ClientHello arrives. However, the potential for denial of service
from buffering 0-RTT packets is significant. These packets cannot be from buffering 0-RTT packets is significant. These packets cannot be
authenticated and so might be employed by an attacker to exhaust authenticated and so might be employed by an attacker to exhaust
server resources. Limiting the number of packets that are saved server resources. Limiting the number of packets that are saved
might be necessary. might be necessary.
The server transitions to using 1-RTT keys after sending its first The server transitions to using 1-RTT keys after sending its first
flight of TLS handshake messages. From this point, the server flight of TLS handshake messages, ending in the Finished. From this
protects all packets with 1-RTT keys. Future packets are therefore point, the server protects all packets with 1-RTT keys. Future
protected with 1-RTT keys. Initially, these are marked with a packets are therefore protected with 1-RTT keys. Initially, these
KEY_PHASE of 0. are marked with a KEY_PHASE of 0.
7.1.2. Retransmission and Acknowledgment of Unprotected Packets 6.1.2. Retransmission and Acknowledgment of Unprotected Packets
TLS handshake messages from both client and server are critical to TLS handshake messages from both client and server are critical to
the key exchange. The contents of these messages determines the keys the key exchange. The contents of these messages determines the keys
used to protect later messages. If these handshake messages are used to protect later messages. If these handshake messages are
included in packets that are protected with these keys, they will be included in packets that are protected with these keys, they will be
indecipherable to the recipient. indecipherable to the recipient.
Even though newer keys could be available when retransmitting, Even though newer keys could be available when retransmitting,
retransmissions of these handshake messages MUST be sent in cleartext retransmissions of these handshake messages MUST be sent in cleartext
packets. An endpoint MUST generate ACK frames for these messages and packets. An endpoint MUST generate ACK frames for these messages and
skipping to change at page 23, line 4 skipping to change at page 22, line 25
HelloRetryRequest. HelloRetryRequest.
The packet type ensures that protected packets are clearly The packet type ensures that protected packets are clearly
distinguished from unprotected packets. Loss or reordering might distinguished from unprotected packets. Loss or reordering might
cause unprotected packets to arrive once 1-RTT keys are in use, cause unprotected packets to arrive once 1-RTT keys are in use,
unprotected packets are easily distinguished from 1-RTT packets using unprotected packets are easily distinguished from 1-RTT packets using
the packet type. the packet type.
Once 1-RTT keys are available to an endpoint, it no longer needs the Once 1-RTT keys are available to an endpoint, it no longer needs the
TLS handshake messages that are carried in unprotected packets. TLS handshake messages that are carried in unprotected packets.
However, a server might need to retransmit its TLS handshake messages However, a server might need to retransmit its TLS handshake messages
in response to receiving an unprotected packet that contains ACK in response to receiving an unprotected packet that contains ACK
frames. A server MUST process ACK frames in unprotected packets frames. A server MUST process ACK frames in unprotected packets
until the TLS handshake is reported as complete, or it receives an until the TLS handshake is reported as complete, or it receives an
ACK frame in a protected packet that acknowledges all of its ACK frame in a protected packet that acknowledges all of its
handshake messages. handshake messages.
To limit the number of key phases that could be active, an endpoint To limit the number of key phases that could be active, an endpoint
MUST NOT initiate a key update while there are any unacknowledged MUST NOT initiate a key update while there are any unacknowledged
handshake messages, see Section 7.2. handshake messages, see Section 6.2.
7.2. Key Update 6.2. Key Update
Once the TLS handshake is complete, the KEY_PHASE bit allows for Once the TLS handshake is complete, the KEY_PHASE bit allows for
refreshes of keying material by either peer. Endpoints start using refreshes of keying material by either peer. Endpoints start using
updated keys immediately without additional signaling; the change in updated keys immediately without additional signaling; the change in
the KEY_PHASE bit indicates that a new key is in use. the KEY_PHASE bit indicates that a new key is in use.
An endpoint MUST NOT initiate more than one key update at a time. A An endpoint MUST NOT initiate more than one key update at a time. A
new key cannot be used until the endpoint has received and new key cannot be used until the endpoint has received and
successfully decrypted a packet with a matching KEY_PHASE. Note that successfully decrypted a packet with a matching KEY_PHASE. Note that
when 0-RTT is attempted the value of the KEY_PHASE bit will be when 0-RTT is attempted the value of the KEY_PHASE bit will be
skipping to change at page 24, line 30 skipping to change at page 24, line 4
New Keys -> @N New Keys -> @N
QUIC Frames @N QUIC Frames @N
<-------- <--------
Figure 5: Key Update Figure 5: Key Update
As shown in Figure 3 and Figure 5, there is never a situation where As shown in Figure 3 and Figure 5, there is never a situation where
there are more than two different sets of keying material that might there are more than two different sets of keying material that might
be received by a peer. Once both sending and receiving keys have be received by a peer. Once both sending and receiving keys have
been updated, been updated,
A server cannot initiate a key update until it has received the A server cannot initiate a key update until it has received the
client's Finished message. Otherwise, packets protected by the client's Finished message. Otherwise, packets protected by the
updated keys could be confused for retransmissions of handshake updated keys could be confused for retransmissions of handshake
messages. A client cannot initiate a key update until all of its messages. A client cannot initiate a key update until all of its
handshake messages have been acknowledged by the server. handshake messages have been acknowledged by the server.
A packet that triggers a key update could arrive after successfully A packet that triggers a key update could arrive after successfully
processing a packet with a higher packet number. This is only processing a packet with a higher packet number. This is only
possible if there is a key compromise and an attack, or if the peer possible if there is a key compromise and an attack, or if the peer
is incorrectly reverting to use of old keys. Because the latter is incorrectly reverting to use of old keys. Because the latter
cannot be differentiated from an attack, an endpoint MUST immediately cannot be differentiated from an attack, an endpoint MUST immediately
terminate the connection if it detects this condition. terminate the connection if it detects this condition.
8. Client Address Validation 7. Client Address Validation
Two tools are provided by TLS to enable validation of client source Two tools are provided by TLS to enable validation of client source
addresses at a server: the cookie in the HelloRetryRequest message, addresses at a server: the cookie in the HelloRetryRequest message,
and the ticket in the NewSessionTicket message. and the ticket in the NewSessionTicket message.
8.1. HelloRetryRequest Address Validation 7.1. HelloRetryRequest Address Validation
The cookie extension in the TLS HelloRetryRequest message allows a The cookie extension in the TLS HelloRetryRequest message allows a
server to perform source address validation during the handshake. server to perform source address validation during the handshake.
When QUIC requests address validation during the processing of the When QUIC requests address validation during the processing of the
first ClientHello, the token it provides is included in the cookie first ClientHello, the token it provides is included in the cookie
extension of a HelloRetryRequest. As long as the cookie cannot be extension of a HelloRetryRequest. As long as the cookie cannot be
successfully guessed by a client, the server can be assured that the successfully guessed by a client, the server can be assured that the
client received the HelloRetryRequest if it includes the value in a client received the HelloRetryRequest if it includes the value in a
second ClientHello. second ClientHello.
skipping to change at page 25, line 44 skipping to change at page 25, line 14
If TLS needs to send a HelloRetryRequest for other reasons, it needs If TLS needs to send a HelloRetryRequest for other reasons, it needs
to ensure that it can correctly identify the reason that the to ensure that it can correctly identify the reason that the
HelloRetryRequest was generated. During the processing of a second HelloRetryRequest was generated. During the processing of a second
ClientHello, TLS does not need to consult the transport protocol ClientHello, TLS does not need to consult the transport protocol
regarding address validation if address validation was not requested regarding address validation if address validation was not requested
originally. In such cases, the cookie extension could either be originally. In such cases, the cookie extension could either be
absent or it could indicate that an address validation token is not absent or it could indicate that an address validation token is not
present. present.
8.1.1. Stateless Address Validation 7.1.1. Stateless Address Validation
A server can use the cookie extension to store all state necessary to A server can use the cookie extension to store all state necessary to
continue the connection. This allows a server to avoid committing continue the connection. This allows a server to avoid committing
state for clients that have unvalidated source addresses. state for clients that have unvalidated source addresses.
For instance, a server could use a statically-configured key to For instance, a server could use a statically-configured key to
encrypt the information that it requires and include that information encrypt the information that it requires and include that information
in the cookie. In addition to address validation information, a in the cookie. In addition to address validation information, a
server that uses encryption also needs to be able recover the hash of server that uses encryption also needs to be able recover the hash of
the ClientHello and its length, plus any information it needs in the ClientHello and its length, plus any information it needs in
order to reconstruct the HelloRetryRequest. order to reconstruct the HelloRetryRequest.
8.1.2. Sending HelloRetryRequest 7.1.2. Sending HelloRetryRequest
A server does not need to maintain state for the connection when A server does not need to maintain state for the connection when
sending a HelloRetryRequest message. This might be necessary to sending a HelloRetryRequest message. This might be necessary to
avoid creating a denial of service exposure for the server. However, avoid creating a denial of service exposure for the server. However,
this means that information about the transport will be lost at the this means that information about the transport will be lost at the
server. This includes the stream offset of stream 0, the packet server. This includes the stream offset of stream 0, the packet
number that the server selects, and any opportunity to measure round number that the server selects, and any opportunity to measure round
trip time. trip time.
A server MUST send a TLS HelloRetryRequest in a Server Stateless A server MUST send a TLS HelloRetryRequest in a Server Stateless
Retry packet. Using a Server Stateless Retry packet causes the Retry packet. Using a Server Stateless Retry packet causes the
client to reset stream offsets. It also avoids the need for the client to reset stream offsets. It also avoids the need for the
server select an initial packet number, which would need to be server select an initial packet number, which would need to be
remembered so that subsequent packets could be correctly numbered. remembered so that subsequent packets could be correctly numbered.
A HelloRetryRequest message MUST NOT be split between multiple Server A HelloRetryRequest message MUST NOT be split between multiple Server
Stateless Retry packets. This means that HelloRetryRequest is Stateless Retry packets. This means that HelloRetryRequest is
subject to the same size constraints as a ClientHello (see subject to the same size constraints as a ClientHello (see
Section 4.4). Section 4.4).
8.2. NewSessionTicket Address Validation 7.2. NewSessionTicket Address Validation
The ticket in the TLS NewSessionTicket message allows a server to The ticket in the TLS NewSessionTicket message allows a server to
provide a client with a similar sort of token. When a client resumes provide a client with a similar sort of token. When a client resumes
a TLS connection - whether or not 0-RTT is attempted - it includes a TLS connection - whether or not 0-RTT is attempted - it includes
the ticket in the handshake message. As with the HelloRetryRequest the ticket in the handshake message. As with the HelloRetryRequest
cookie, the server includes the address validation token in the cookie, the server includes the address validation token in the
ticket. TLS provides the token it extracts from the session ticket ticket. TLS provides the token it extracts from the session ticket
to the transport when it asks whether source address validation is to the transport when it asks whether source address validation is
needed. needed.
skipping to change at page 27, line 8 skipping to change at page 26, line 26
A server can send a NewSessionTicket message at any time. This A server can send a NewSessionTicket message at any time. This
allows it to update the state - and the address validation token - allows it to update the state - and the address validation token -
that is included in the ticket. This might be done to refresh the that is included in the ticket. This might be done to refresh the
ticket or token, or it might be generated in response to changes in ticket or token, or it might be generated in response to changes in
the state of the connection. QUIC can request that a the state of the connection. QUIC can request that a
NewSessionTicket be sent by providing a new address validation token. NewSessionTicket be sent by providing a new address validation token.
A server that intends to support 0-RTT SHOULD provide an address A server that intends to support 0-RTT SHOULD provide an address
validation token immediately after completing the TLS handshake. validation token immediately after completing the TLS handshake.
8.3. Address Validation Token Integrity 7.3. Address Validation Token Integrity
TLS MUST provide integrity protection for address validation token TLS MUST provide integrity protection for address validation token
unless the transport guarantees integrity protection by other means. unless the transport guarantees integrity protection by other means.
For a NewSessionTicket that includes confidential information - such For a NewSessionTicket that includes confidential information - such
as the resumption secret - including the token under authenticated as the resumption secret - including the token under authenticated
encryption ensures that the token gains both confidentiality and encryption ensures that the token gains both confidentiality and
integrity protection without duplicating the overheads of that integrity protection without duplicating the overheads of that
protection. protection.
9. Pre-handshake QUIC Messages 8. Pre-handshake QUIC Messages
Implementations MUST NOT exchange data on any stream other than Implementations MUST NOT exchange data on any stream other than
stream 0 without packet protection. QUIC requires the use of several stream 0 without packet protection. QUIC requires the use of several
types of frame for managing loss detection and recovery during this types of frame for managing loss detection and recovery during this
phase. In addition, it might be useful to use the data acquired phase. In addition, it might be useful to use the data acquired
during the exchange of unauthenticated messages for congestion during the exchange of unauthenticated messages for congestion
control. control.
This section generally only applies to TLS handshake messages from This section generally only applies to TLS handshake messages from
both peers and acknowledgments of the packets carrying those both peers and acknowledgments of the packets carrying those
skipping to change at page 28, line 4 skipping to change at page 27, line 24
o use them, but reset any state that is established once the o use them, but reset any state that is established once the
handshake completes handshake completes
o use them and authenticate them afterwards; failing the handshake o use them and authenticate them afterwards; failing the handshake
if they can't be authenticated if they can't be authenticated
o save them and use them when they can be properly authenticated o save them and use them when they can be properly authenticated
o treat them as a fatal error o treat them as a fatal error
Different strategies are appropriate for different types of data. Different strategies are appropriate for different types of data.
This document proposes that all strategies are possible depending on This document proposes that all strategies are possible depending on
the type of message. the type of message.
o Transport parameters are made usable and authenticated as part of o Transport parameters are made usable and authenticated as part of
the TLS handshake (see Section 10.2). the TLS handshake (see Section 9.2).
o Most unprotected messages are treated as fatal errors when o Most unprotected messages are treated as fatal errors when
received except for the small number necessary to permit the received except for the small number necessary to permit the
handshake to complete (see Section 9.1). handshake to complete (see Section 8.1).
o Protected packets can either be discarded or saved and later used o Protected packets can either be discarded or saved and later used
(see Section 9.3). (see Section 8.3).
9.1. Unprotected Packets Prior to Handshake Completion 8.1. Unprotected Packets Prior to Handshake Completion
This section describes the handling of messages that are sent and This section describes the handling of messages that are sent and
received prior to the completion of the TLS handshake. received prior to the completion of the TLS handshake.
Sending and receiving unprotected messages is hazardous. Unless Sending and receiving unprotected messages is hazardous. Unless
expressly permitted, receipt of an unprotected message of any kind expressly permitted, receipt of an unprotected message of any kind
MUST be treated as a fatal error. MUST be treated as a fatal error.
9.1.1. STREAM Frames 8.1.1. STREAM Frames
"STREAM" frames for stream 0 are permitted. These carry the TLS "STREAM" frames for stream 0 are permitted. These carry the TLS
handshake messages. Once 1-RTT keys are available, unprotected handshake messages. Once 1-RTT keys are available, unprotected
"STREAM" frames on stream 0 can be ignored. "STREAM" frames on stream 0 can be ignored.
Receiving unprotected "STREAM" frames for other streams MUST be Receiving unprotected "STREAM" frames for other streams MUST be
treated as a fatal error. treated as a fatal error.
9.1.2. ACK Frames 8.1.2. ACK Frames
"ACK" frames are permitted prior to the handshake being complete. "ACK" frames are permitted prior to the handshake being complete.
Information learned from "ACK" frames cannot be entirely relied upon, Information learned from "ACK" frames cannot be entirely relied upon,
since an attacker is able to inject these packets. Timing and packet since an attacker is able to inject these packets. Timing and packet
retransmission information from "ACK" frames is critical to the retransmission information from "ACK" frames is critical to the
functioning of the protocol, but these frames might be spoofed or functioning of the protocol, but these frames might be spoofed or
altered. altered.
Endpoints MUST NOT use an "ACK" frame in an unprotected packet to Endpoints MUST NOT use an "ACK" frame in an unprotected packet to
acknowledge packets that were protected by 0-RTT or 1-RTT keys. An acknowledge packets that were protected by 0-RTT or 1-RTT keys. An
skipping to change at page 29, line 21 skipping to change at page 28, line 40
An endpoint SHOULD use data from "ACK" frames carried in unprotected An endpoint SHOULD use data from "ACK" frames carried in unprotected
packets or packets protected with 0-RTT keys only during the initial packets or packets protected with 0-RTT keys only during the initial
handshake. All "ACK" frames contained in unprotected packets that handshake. All "ACK" frames contained in unprotected packets that
are received after successful receipt of a packet protected with are received after successful receipt of a packet protected with
1-RTT keys MUST be discarded. An endpoint SHOULD therefore include 1-RTT keys MUST be discarded. An endpoint SHOULD therefore include
acknowledgments for unprotected and any packets protected with 0-RTT acknowledgments for unprotected and any packets protected with 0-RTT
keys until it sees an acknowledgment for a packet that is both keys until it sees an acknowledgment for a packet that is both
protected with 1-RTT keys and contains an "ACK" frame. protected with 1-RTT keys and contains an "ACK" frame.
9.1.3. Updates to Data and Stream Limits 8.1.3. Updates to Data and Stream Limits
"MAX_DATA", "MAX_STREAM_DATA", "BLOCKED", "STREAM_BLOCKED", and "MAX_DATA", "MAX_STREAM_DATA", "BLOCKED", "STREAM_BLOCKED", and
"MAX_STREAM_ID" frames MUST NOT be sent unprotected. "MAX_STREAM_ID" frames MUST NOT be sent unprotected.
Though data is exchanged on stream 0, the initial flow control window Though data is exchanged on stream 0, the initial flow control window
on that stream is sufficiently large to allow the TLS handshake to on that stream is sufficiently large to allow the TLS handshake to
complete. This limits the maximum size of the TLS handshake and complete. This limits the maximum size of the TLS handshake and
would prevent a server or client from using an abnormally large would prevent a server or client from using an abnormally large
certificate chain. certificate chain.
Stream 0 is exempt from the connection-level flow control window. Stream 0 is exempt from the connection-level flow control window.
Consequently, there is no need to signal being blocked on flow Consequently, there is no need to signal being blocked on flow
control. control.
Similarly, there is no need to increase the number of allowed streams Similarly, there is no need to increase the number of allowed streams
until the handshake completes. until the handshake completes.
9.1.4. Denial of Service with Unprotected Packets 8.1.4. Denial of Service with Unprotected Packets
Accepting unprotected - specifically unauthenticated - packets Accepting unprotected - specifically unauthenticated - packets
presents a denial of service risk to endpoints. An attacker that is presents a denial of service risk to endpoints. An attacker that is
able to inject unprotected packets can cause a recipient to drop even able to inject unprotected packets can cause a recipient to drop even
protected packets with a matching sequence number. The spurious protected packets with a matching sequence number. The spurious
packet shadows the genuine packet, causing the genuine packet to be packet shadows the genuine packet, causing the genuine packet to be
ignored as redundant. ignored as redundant.
Once the TLS handshake is complete, both peers MUST ignore Once the TLS handshake is complete, both peers MUST ignore
unprotected packets. From that point onward, unprotected messages unprotected packets. From that point onward, unprotected messages
skipping to change at page 30, line 15 skipping to change at page 29, line 34
Since only TLS handshake packets and acknowledgments are sent in the Since only TLS handshake packets and acknowledgments are sent in the
clear, an attacker is able to force implementations to rely on clear, an attacker is able to force implementations to rely on
retransmission for packets that are lost or shadowed. Thus, an retransmission for packets that are lost or shadowed. Thus, an
attacker that intends to deny service to an endpoint has to drop or attacker that intends to deny service to an endpoint has to drop or
shadow protected packets in order to ensure that their victim shadow protected packets in order to ensure that their victim
continues to accept unprotected packets. The ability to shadow continues to accept unprotected packets. The ability to shadow
packets means that an attacker does not need to be on path. packets means that an attacker does not need to be on path.
In addition to causing valid packets to be dropped, an attacker can In addition to causing valid packets to be dropped, an attacker can
generate packets with an intent of causing the recipient to expend generate packets with an intent of causing the recipient to expend
processing resources. See Section 11.2 for a discussion of these processing resources. See Section 10.2 for a discussion of these
risks. risks.
To avoid receiving TLS packets that contain no useful data, a TLS To avoid receiving TLS packets that contain no useful data, a TLS
implementation MUST reject empty TLS handshake records and any record implementation MUST reject empty TLS handshake records and any record
that is not permitted by the TLS state machine. Any TLS application that is not permitted by the TLS state machine. Any TLS application
data or alerts that is received prior to the end of the handshake data or alerts that is received prior to the end of the handshake
MUST be treated as a fatal error. MUST be treated as a fatal error.
9.2. Use of 0-RTT Keys 8.2. Use of 0-RTT Keys
If 0-RTT keys are available, the lack of replay protection means that If 0-RTT keys are available, the lack of replay protection means that
restrictions on their use are necessary to avoid replay attacks on restrictions on their use are necessary to avoid replay attacks on
the protocol. 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. otherwise treats 0-RTT keys as equivalent to 1-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
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. A server MUST NOT use 0-RTT keys to protect packets.
9.3. Receiving Out-of-Order Protected Frames 8.3. 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.
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. A server MUST NOT use 1-RTT and used once the handshake is complete. A server MUST NOT use 1-RTT
protected packets before verifying either the client Finished message protected packets before verifying either the client Finished message
skipping to change at page 31, line 18 skipping to change at page 30, line 37
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.
Receiving and verifying the TLS Finished message is critical in Receiving and verifying the TLS Finished message is critical in
ensuring the integrity of the TLS handshake. A server MUST NOT use ensuring the integrity of the TLS handshake. A server MUST NOT use
protected packets from the client prior to verifying the client protected packets from the client prior to verifying the client
Finished message if its response depends on client authentication. Finished message if its response depends on client authentication.
10. QUIC-Specific Additions to the TLS Handshake 9. QUIC-Specific Additions to the TLS Handshake
QUIC uses the TLS handshake for more than just negotiation of QUIC uses the TLS handshake for more than just negotiation of
cryptographic parameters. The TLS handshake validates protocol cryptographic parameters. The TLS handshake validates protocol
version selection, provides preliminary values for QUIC transport version selection, provides preliminary values for QUIC transport
parameters, and allows a server to perform return routeability checks parameters, and allows a server to perform return routeability checks
on clients. on clients.
10.1. Protocol and Version Negotiation 9.1. Protocol and Version Negotiation
The QUIC version negotiation mechanism is used to negotiate the The QUIC version negotiation mechanism is used to negotiate the
version of QUIC that is used prior to the completion of the version of QUIC that is used prior to the completion of the
handshake. However, this packet is not authenticated, enabling an handshake. However, this packet is not authenticated, enabling an
active attacker to force a version downgrade. active attacker to force a version downgrade.
To ensure that a QUIC version downgrade is not forced by an attacker, To ensure that a QUIC version downgrade is not forced by an attacker,
version information is copied into the TLS handshake, which provides version information is copied into the TLS handshake, which provides
integrity protection for the QUIC negotiation. This does not prevent integrity protection for the QUIC negotiation. This does not prevent
version downgrade prior to the completion of the handshake, though it version downgrade prior to the completion of the handshake, though it
skipping to change at page 32, line 5 skipping to change at page 31, line 22
select an application protocol. The application-layer protocol MAY select an application protocol. The application-layer protocol MAY
restrict the QUIC versions that it can operate over. Servers MUST restrict the QUIC versions that it can operate over. Servers MUST
select an application protocol compatible with the QUIC version that select an application protocol compatible with the QUIC version that
the client has selected. the client has selected.
If the server cannot select a compatible combination of application If the server cannot select a compatible combination of application
protocol and QUIC version, it MUST abort the connection. A client protocol and QUIC version, it MUST abort the connection. A client
MUST abort a connection if the server picks an incompatible MUST abort a connection if the server picks an incompatible
combination of QUIC version and ALPN identifier. combination of QUIC version and ALPN identifier.
10.2. QUIC Transport Parameters Extension 9.2. QUIC Transport Parameters Extension
QUIC transport parameters are carried in a TLS extension. Different QUIC transport parameters are carried in a TLS extension. Different
versions of QUIC might define a different format for this struct. versions of QUIC might define a different format for this struct.
Including transport parameters in the TLS handshake provides Including transport parameters in the TLS handshake provides
integrity protection for these values. integrity protection for these values.
enum { enum {
quic_transport_parameters(26), (65535) quic_transport_parameters(26), (65535)
} ExtensionType; } ExtensionType;
skipping to change at page 32, line 27 skipping to change at page 31, line 44
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 when the version of QUIC defined in TransportParameters 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. The and the EncryptedExtensions messages during the handshake. The
extension MAY be included in a NewSessionTicket message. extension MAY be included in a NewSessionTicket message.
10.3. Priming 0-RTT 9.3. Priming 0-RTT
QUIC uses TLS without modification. Therefore, it is possible to use QUIC uses TLS without modification. Therefore, it is possible to use
a pre-shared key that was established in a TLS handshake over TCP to a pre-shared key that was established in a TLS handshake over TCP to
enable 0-RTT in QUIC. Similarly, QUIC can provide a pre-shared key enable 0-RTT in QUIC. Similarly, QUIC can provide a pre-shared key
that can be used to enable 0-RTT in TCP. that can be used to enable 0-RTT in TCP.
All the restrictions on the use of 0-RTT apply, with the exception of All the restrictions on the use of 0-RTT apply, with the exception of
the ALPN label, which MUST only change to a label that is explicitly the ALPN label, which MUST only change to a label that is explicitly
designated as being compatible. The client indicates which ALPN designated as being compatible. The client indicates which ALPN
label it has chosen by placing that ALPN label first in the ALPN label it has chosen by placing that ALPN label first in the ALPN
skipping to change at page 33, line 5 skipping to change at page 32, line 22
Source address validation is not completely portable between Source address validation is not completely portable between
different protocol stacks. Even if the source IP address remains different protocol stacks. Even if the source IP address remains
constant, the port number is likely to be different. Packet constant, the port number is likely to be different. Packet
reflection attacks are still possible in this situation, though the reflection attacks are still possible in this situation, though the
set of hosts that can initiate these attacks is greatly reduced. A set of hosts that can initiate these attacks is greatly reduced. A
server might choose to avoid source address validation for such a server might choose to avoid source address validation for such a
connection, or allow an increase to the amount of data that it sends connection, or allow an increase to the amount of data that it sends
toward the client without source validation. toward the client without source validation.
11. Security Considerations 10. Security Considerations
There are likely to be some real clangers here eventually, but the There are likely to be some real clangers here eventually, but the
current set of issues is well captured in the relevant sections of current set of issues is well captured in the relevant sections of
the main text. the main text.
Never assume that because it isn't in the security considerations Never assume that because it isn't in the security considerations
section it doesn't affect security. Most of this document does. section it doesn't affect security. Most of this document does.
11.1. Packet Reflection Attack Mitigation 10.1. 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.
Certificate caching [RFC7924] can reduce the size of the server's Certificate caching [RFC7924] can reduce the size of the server's
handshake messages significantly. handshake messages significantly.
QUIC requires that the packet containing a ClientHello be padded to a QUIC requires that the packet containing a ClientHello be padded to a
minimum size. A server is less likely to generate a packet minimum size. A server is less likely to generate a packet
reflection attack if the data it sends is a small multiple of this reflection attack if the data it sends is a small multiple of this
size. A server SHOULD use a HelloRetryRequest if the size of the size. A server SHOULD use a HelloRetryRequest if the size of the
handshake messages it sends is likely to significantly exceed the handshake messages it sends is likely to significantly exceed the
size of the packet containing the ClientHello. size of the packet containing the ClientHello.
11.2. Peer Denial of Service 10.2. Peer Denial of Service
QUIC, TLS and HTTP/2 all contain a messages that have legitimate uses QUIC, TLS and HTTP/2 all contain a messages that have legitimate uses
in some contexts, but that can be abused to cause a peer to expend in some contexts, but that can be abused to cause a peer to expend
processing resources without having any observable impact on the processing resources without having any observable impact on the
state of the connection. If processing is disproportionately large state of the connection. If processing is disproportionately large
in comparison to the observable effects on bandwidth or state, then in comparison to the observable effects on bandwidth or state, then
this could allow a malicious peer to exhaust processing capacity this could allow a malicious peer to exhaust processing capacity
without consequence. without consequence.
QUIC prohibits the sending of empty "STREAM" frames unless they are QUIC prohibits the sending of empty "STREAM" frames unless they are
skipping to change at page 34, line 9 skipping to change at page 33, line 26
generate unnecessary work. Once the TLS handshake is complete, generate unnecessary work. Once the TLS handshake is complete,
endpoints SHOULD NOT send TLS application data records unless it is endpoints SHOULD NOT send TLS application data records unless it is
to hide the length of QUIC records. QUIC packet protection does not to hide the length of QUIC records. QUIC packet protection does not
include any allowance for padding; padded TLS application data include any allowance for padding; padded TLS application data
records can be used to mask the length of QUIC frames. records can be used to mask the length of QUIC frames.
While there are legitimate uses for some redundant packets, While there are legitimate uses for some redundant packets,
implementations SHOULD track redundant packets and treat excessive implementations SHOULD track redundant packets and treat excessive
volumes of any non-productive packets as indicative of an attack. volumes of any non-productive packets as indicative of an attack.
12. Error codes 11. Error Codes
The portion of the QUIC error code space allocated for the crypto This section defines error codes from the error code space used in
handshake is 0xC0000000-0xFFFFFFFF. The following error codes are [QUIC-TRANSPORT].
defined when TLS is used for the crypto handshake:
TLS_HANDSHAKE_FAILED (0xC000001C): The TLS handshake failed. The following error codes are defined when TLS is used for the crypto
handshake:
TLS_FATAL_ALERT_GENERATED (0xC000001D): A TLS fatal alert was sent, TLS_HANDSHAKE_FAILED (0x201): The TLS handshake failed.
TLS_FATAL_ALERT_GENERATED (0x202): A TLS fatal alert was sent,
causing the TLS connection to end prematurely. causing the TLS connection to end prematurely.
TLS_FATAL_ALERT_RECEIVED (0xC000001E): A TLS fatal alert was TLS_FATAL_ALERT_RECEIVED (0x203): A TLS fatal alert was received,
received, causing the TLS connection to end prematurely. causing the TLS connection to end prematurely.
13. IANA Considerations 12. IANA Considerations
This document does not create any new IANA registries, but it does This document does not create any new IANA registries, but it
utilize the following registries: registers the values in the following registries:
o QUIC Transport Parameter Registry - IANA is to register the three o QUIC Transport Error Codes Registry [QUIC-TRANSPORT] - IANA is to
values found in Section 12. register the three error codes found in Section 11, these are
summarized in Table 1.
o TLS ExtensionsType Registry - IANA is to register the o TLS ExtensionsType Registry [TLS-REGISTRIES] - IANA is to register
quic_transport_parameters extension found in Section 10.2. the quic_transport_parameters extension found in Section 9.2.
Assigning 26 to the extension would be greatly appreciated. The Assigning 26 to the extension would be greatly appreciated. The
Recommended column is to be marked Yes. Recommended column is to be marked Yes.
o TLS Exporter Label Registry - IANA is requested to register o TLS Exporter Label Registry [TLS-REGISTRIES] - IANA is requested
"EXPORTER-QUIC 0-RTT Secret" from Section 5.2.1; "EXPORTER-QUIC to register "EXPORTER-QUIC 0-RTT Secret" from Section 5.2.2;
client 1-RTT Secret" and "EXPORTER-QUIC server 1-RTT Secret" from "EXPORTER-QUIC client 1-RTT Secret" and "EXPORTER-QUIC server
Section 5.2.2; "EXPORTER-QUIC Packet Number Secret" Section 5.6. 1-RTT Secret" from Section 5.2.3; "EXPORTER-QUIC Packet Number
The DTLS column is to be marked No. The Recommended column is to Secret" Section 5.6. The DTLS column is to be marked No. The
be marked Yes. Recommended column is to be marked Yes.
14. References +-------+---------------------------+---------------+---------------+
| Value | Error | Description | Specification |
+-------+---------------------------+---------------+---------------+
| 0x201 | TLS_HANDSHAKE_FAILED | TLS handshake | Section 11 |
| | | failure | |
| | | | |
| 0x202 | TLS_FATAL_ALERT_GENERATED | Sent TLS | Section 11 |
| | | alert | |
| | | | |
| 0x203 | TLS_FATAL_ALERT_RECEIVED | Receives TLS | Section 11 |
| | | alert | |
+-------+---------------------------+---------------+---------------+
14.1. Normative References Table 1: QUIC Transport Error Codes for TLS
13. References
13.1. Normative References
[FIPS180] Department of Commerce, National., "NIST FIPS 180-4,
Secure Hash Standard", March 2012,
<http://csrc.nist.gov/publications/fips/fips180-4/
fips-180-4.pdf>.
[I-D.ietf-tls-tls13] [I-D.ietf-tls-tls13]
Rescorla, E., "The Transport Layer Security (TLS) Protocol Rescorla, E., "The Transport Layer Security (TLS) Protocol
Version 1.3", draft-ietf-tls-tls13-21 (work in progress), Version 1.3", draft-ietf-tls-tls13-21 (work in progress),
July 2017. July 2017.
[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 (work in progress), September 2017. transport-07 (work in progress), October 2017.
[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, <https://www.rfc- DOI 10.17487/RFC2119, March 1997,
editor.org/info/rfc2119>. <https://www.rfc-editor.org/info/rfc2119>.
[RFC5116] McGrew, D., "An Interface and Algorithms for Authenticated [RFC5116] 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>.
[RFC5869] Krawczyk, H. and P. Eronen, "HMAC-based Extract-and-Expand [RFC5869] Krawczyk, H. and P. Eronen, "HMAC-based Extract-and-Expand
Key Derivation Function (HKDF)", RFC 5869, Key Derivation Function (HKDF)", RFC 5869,
DOI 10.17487/RFC5869, May 2010, <https://www.rfc- DOI 10.17487/RFC5869, May 2010,
editor.org/info/rfc5869>. <https://www.rfc-editor.org/info/rfc5869>.
[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>.
14.2. Informative References [TLS-REGISTRIES]
Salowey, J. and S. Turner, "D/TLS IANA Registry Updates",
draft-ietf-tls-iana-registry-updates-01 (work in
progress), April 2017.
13.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>.
[FNV] Fowler, G., Noll, L., Vo, K., Eastlake, D., and T. Hansen,
"The FNV Non-Cryptographic Hash Algorithm", draft-
eastlake-fnv-13 (work in progress), June 2017.
[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 (work in progress), September QUIC", draft-ietf-quic-http-07 (work in progress), October
2017. 2017.
[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 (work in and Congestion Control", draft-ietf-quic-recovery-07 (work
progress), September 2017. in progress), October 2017.
[RFC2818] Rescorla, E., "HTTP Over TLS", RFC 2818, [RFC2818] Rescorla, E., "HTTP Over TLS", RFC 2818,
DOI 10.17487/RFC2818, May 2000, <https://www.rfc- DOI 10.17487/RFC2818, May 2000,
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>.
[RFC7924] Santesson, S. and H. Tschofenig, "Transport Layer Security [RFC7924] Santesson, S. and H. Tschofenig, "Transport Layer Security
(TLS) Cached Information Extension", RFC 7924, (TLS) Cached Information Extension", RFC 7924,
DOI 10.17487/RFC7924, July 2016, <https://www.rfc- DOI 10.17487/RFC7924, July 2016,
editor.org/info/rfc7924>. <https://www.rfc-editor.org/info/rfc7924>.
13.3. URIs
[1] https://mailarchive.ietf.org/arch/search/?email_list=quic
[2] https://github.com/quicwg
[3] https://github.com/quicwg/base-drafts/labels/tls
Appendix A. Contributors Appendix A. Contributors
Ryan Hamilton was originally an author of this specification. Ryan Hamilton was originally an author of this specification.
Appendix B. Acknowledgments Appendix B. Acknowledgments
This document has benefited from input from Dragana Damjanovic, This document has benefited from input from Dragana Damjanovic,
Christian Huitema, Jana Iyengar, Adam Langley, Roberto Peon, Eric Christian Huitema, Jana Iyengar, Adam Langley, Roberto Peon, Eric
Rescorla, Ian Swett, and many others. Rescorla, Ian Swett, and many others.
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-05 C.1. Since draft-ietf-quic-tls-06
Nothing yet.
C.2. Since draft-ietf-quic-tls-05
No significant changes. No significant changes.
C.2. Since draft-ietf-quic-tls-04 C.3. Since draft-ietf-quic-tls-04
o Update labels used in HKDF-Expand-Label to match TLS 1.3 (#642) o Update labels used in HKDF-Expand-Label to match TLS 1.3 (#642)
C.3. Since draft-ietf-quic-tls-03 C.4. Since draft-ietf-quic-tls-03
No significant changes. No significant changes.
C.4. Since draft-ietf-quic-tls-02 C.5. Since draft-ietf-quic-tls-02
o Updates to match changes in transport draft o Updates to match changes in transport draft
C.5. Since draft-ietf-quic-tls-01 C.6. Since draft-ietf-quic-tls-01
o Use TLS alerts to signal TLS errors (#272, #374) o Use TLS alerts to signal TLS errors (#272, #374)
o Require ClientHello to fit in a single packet (#338) o Require ClientHello to fit in a single packet (#338)
o The second client handshake flight is now sent in the clear (#262, o The second client handshake flight is now sent in the clear (#262,
#337) #337)
o The QUIC header is included as AEAD Associated Data (#226, #243, o The QUIC header is included as AEAD Associated Data (#226, #243,
#302) #302)
skipping to change at page 37, line 30 skipping to change at page 37, line 42
o Require at least TLS 1.3 (#138) o Require at least TLS 1.3 (#138)
o Define transport parameters as a TLS extension (#122) o Define transport parameters as a TLS extension (#122)
o Define handling for protected packets before the handshake o Define handling for protected packets before the handshake
completes (#39) completes (#39)
o Decouple QUIC version and ALPN (#12) o Decouple QUIC version and ALPN (#12)
C.6. Since draft-ietf-quic-tls-00 C.7. Since draft-ietf-quic-tls-00
o Changed bit used to signal key phase o Changed bit used to signal key phase
o Updated key phase markings during the handshake o Updated key phase markings during the handshake
o Added TLS interface requirements section o Added TLS interface requirements section
o Moved to use of TLS exporters for key derivation o Moved to use of TLS exporters for key derivation
o Moved TLS error code definitions into this document o Moved TLS error code definitions into this document
C.7. Since draft-thomson-quic-tls-01 C.8. Since draft-thomson-quic-tls-01
o Adopted as base for draft-ietf-quic-tls o Adopted as base for draft-ietf-quic-tls
o Updated authors/editors list o Updated authors/editors list
o Added status note o Added status note
Authors' Addresses Authors' Addresses
Martin Thomson (editor) Martin Thomson (editor)
 End of changes. 95 change blocks. 
230 lines changed or deleted 236 lines changed or added

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