| < draft-ietf-quic-tls-14.txt | draft-ietf-quic-tls-15.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: February 16, 2019 sn3rd | Expires: April 6, 2019 sn3rd | |||
| August 15, 2018 | October 03, 2018 | |||
| Using Transport Layer Security (TLS) to Secure QUIC | Using Transport Layer Security (TLS) to Secure QUIC | |||
| draft-ietf-quic-tls-14 | draft-ietf-quic-tls-15 | |||
| Abstract | Abstract | |||
| This document describes how Transport Layer Security (TLS) is used to | This document describes how Transport Layer Security (TLS) is used to | |||
| secure QUIC. | secure QUIC. | |||
| Note to Readers | Note to Readers | |||
| Discussion of this draft takes place on the QUIC working group | Discussion of this draft takes place on the QUIC working group | |||
| mailing list (quic@ietf.org), which is archived at | mailing list (quic@ietf.org), which is archived at | |||
| skipping to change at page 1, line 42 ¶ | skipping to change at page 1, line 42 ¶ | |||
| Internet-Drafts are working documents of the Internet Engineering | Internet-Drafts are working documents of the Internet Engineering | |||
| Task Force (IETF). Note that other groups may also distribute | Task Force (IETF). Note that other groups may also distribute | |||
| working documents as Internet-Drafts. The list of current Internet- | working documents as Internet-Drafts. The list of current Internet- | |||
| Drafts is at https://datatracker.ietf.org/drafts/current/. | Drafts is at https://datatracker.ietf.org/drafts/current/. | |||
| Internet-Drafts are draft documents valid for a maximum of six months | Internet-Drafts are draft documents valid for a maximum of six months | |||
| and may be updated, replaced, or obsoleted by other documents at any | and may be updated, replaced, or obsoleted by other documents at any | |||
| time. It is inappropriate to use Internet-Drafts as reference | time. It is inappropriate to use Internet-Drafts as reference | |||
| material or to cite them other than as "work in progress." | material or to cite them other than as "work in progress." | |||
| This Internet-Draft will expire on February 16, 2019. | This Internet-Draft will expire on April 6, 2019. | |||
| Copyright Notice | Copyright Notice | |||
| Copyright (c) 2018 IETF Trust and the persons identified as the | Copyright (c) 2018 IETF Trust and the persons identified as the | |||
| document authors. All rights reserved. | document authors. All rights reserved. | |||
| This document is subject to BCP 78 and the IETF Trust's Legal | This document is subject to BCP 78 and the IETF Trust's Legal | |||
| Provisions Relating to IETF Documents | Provisions Relating to IETF Documents | |||
| (https://trustee.ietf.org/license-info) in effect on the date of | (https://trustee.ietf.org/license-info) in effect on the date of | |||
| publication of this document. Please review these documents | publication of this document. Please review these documents | |||
| skipping to change at page 2, line 34 ¶ | skipping to change at page 2, line 34 ¶ | |||
| 4.1.2. Encryption Level Changes . . . . . . . . . . . . . . 11 | 4.1.2. Encryption Level Changes . . . . . . . . . . . . . . 11 | |||
| 4.1.3. TLS Interface Summary . . . . . . . . . . . . . . . . 11 | 4.1.3. TLS Interface Summary . . . . . . . . . . . . . . . . 11 | |||
| 4.2. TLS Version . . . . . . . . . . . . . . . . . . . . . . . 12 | 4.2. TLS Version . . . . . . . . . . . . . . . . . . . . . . . 12 | |||
| 4.3. ClientHello Size . . . . . . . . . . . . . . . . . . . . 13 | 4.3. ClientHello Size . . . . . . . . . . . . . . . . . . . . 13 | |||
| 4.4. Peer Authentication . . . . . . . . . . . . . . . . . . . 13 | 4.4. Peer Authentication . . . . . . . . . . . . . . . . . . . 13 | |||
| 4.5. Enabling 0-RTT . . . . . . . . . . . . . . . . . . . . . 14 | 4.5. Enabling 0-RTT . . . . . . . . . . . . . . . . . . . . . 14 | |||
| 4.6. Rejecting 0-RTT . . . . . . . . . . . . . . . . . . . . . 14 | 4.6. Rejecting 0-RTT . . . . . . . . . . . . . . . . . . . . . 14 | |||
| 4.7. HelloRetryRequest . . . . . . . . . . . . . . . . . . . . 14 | 4.7. HelloRetryRequest . . . . . . . . . . . . . . . . . . . . 14 | |||
| 4.8. TLS Errors . . . . . . . . . . . . . . . . . . . . . . . 15 | 4.8. TLS Errors . . . . . . . . . . . . . . . . . . . . . . . 15 | |||
| 4.9. Discarding Unused Keys . . . . . . . . . . . . . . . . . 15 | 4.9. Discarding Unused Keys . . . . . . . . . . . . . . . . . 15 | |||
| 5. QUIC Packet Protection . . . . . . . . . . . . . . . . . . . 16 | 5. Packet Protection . . . . . . . . . . . . . . . . . . . . . . 16 | |||
| 5.1. QUIC Packet Encryption Keys . . . . . . . . . . . . . . . 16 | 5.1. Packet Protection Keys . . . . . . . . . . . . . . . . . 16 | |||
| 5.1.1. Initial Secrets . . . . . . . . . . . . . . . . . . . 17 | 5.2. Initial Secrets . . . . . . . . . . . . . . . . . . . . . 17 | |||
| 5.2. QUIC AEAD Usage . . . . . . . . . . . . . . . . . . . . . 17 | 5.3. AEAD Usage . . . . . . . . . . . . . . . . . . . . . . . 18 | |||
| 5.3. Packet Number Protection . . . . . . . . . . . . . . . . 18 | 5.4. Packet Number Protection . . . . . . . . . . . . . . . . 19 | |||
| 5.3.1. AES-Based Packet Number Protection . . . . . . . . . 20 | 5.4.1. AES-Based Packet Number Protection . . . . . . . . . 20 | |||
| 5.3.2. ChaCha20-Based Packet Number Protection . . . . . . . 20 | 5.4.2. ChaCha20-Based Packet Number Protection . . . . . . . 20 | |||
| 5.4. Receiving Protected Packets . . . . . . . . . . . . . . . 20 | 5.5. Receiving Protected Packets . . . . . . . . . . . . . . . 20 | |||
| 5.5. Use of 0-RTT Keys . . . . . . . . . . . . . . . . . . . . 21 | 5.6. Use of 0-RTT Keys . . . . . . . . . . . . . . . . . . . . 21 | |||
| 5.6. Receiving Out-of-Order Protected Frames . . . . . . . . . 21 | 5.7. Receiving Out-of-Order Protected Frames . . . . . . . . . 21 | |||
| 6. Key Update . . . . . . . . . . . . . . . . . . . . . . . . . 22 | 6. Key Update . . . . . . . . . . . . . . . . . . . . . . . . . 22 | |||
| 7. Security of Initial Messages . . . . . . . . . . . . . . . . 23 | 7. Security of Initial Messages . . . . . . . . . . . . . . . . 23 | |||
| 8. QUIC-Specific Additions to the TLS Handshake . . . . . . . . 24 | 8. QUIC-Specific Additions to the TLS Handshake . . . . . . . . 24 | |||
| 8.1. Protocol and Version Negotiation . . . . . . . . . . . . 24 | 8.1. Protocol and Version Negotiation . . . . . . . . . . . . 24 | |||
| 8.2. QUIC Transport Parameters Extension . . . . . . . . . . . 24 | 8.2. QUIC Transport Parameters Extension . . . . . . . . . . . 24 | |||
| 8.3. Removing the EndOfEarlyData Message . . . . . . . . . . . 25 | ||||
| 9. Security Considerations . . . . . . . . . . . . . . . . . . . 25 | 9. Security Considerations . . . . . . . . . . . . . . . . . . . 25 | |||
| 9.1. Packet Reflection Attack Mitigation . . . . . . . . . . . 25 | 9.1. Packet Reflection Attack Mitigation . . . . . . . . . . . 25 | |||
| 9.2. Peer Denial of Service . . . . . . . . . . . . . . . . . 25 | 9.2. Peer Denial of Service . . . . . . . . . . . . . . . . . 26 | |||
| 9.3. Packet Number Protection Analysis . . . . . . . . . . . . 26 | 9.3. Packet Number Protection Analysis . . . . . . . . . . . . 26 | |||
| 10. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 27 | 10. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 27 | |||
| 11. References . . . . . . . . . . . . . . . . . . . . . . . . . 27 | 11. References . . . . . . . . . . . . . . . . . . . . . . . . . 27 | |||
| 11.1. Normative References . . . . . . . . . . . . . . . . . . 27 | 11.1. Normative References . . . . . . . . . . . . . . . . . . 27 | |||
| 11.2. Informative References . . . . . . . . . . . . . . . . . 28 | 11.2. Informative References . . . . . . . . . . . . . . . . . 29 | |||
| 11.3. URIs . . . . . . . . . . . . . . . . . . . . . . . . . . 29 | 11.3. URIs . . . . . . . . . . . . . . . . . . . . . . . . . . 29 | |||
| Appendix A. Change Log . . . . . . . . . . . . . . . . . . . . . 29 | Appendix A. Change Log . . . . . . . . . . . . . . . . . . . . . 29 | |||
| A.1. Since draft-ietf-quic-tls-13 . . . . . . . . . . . . . . 29 | A.1. Since draft-ietf-quic-tls-13 . . . . . . . . . . . . . . 29 | |||
| A.2. Since draft-ietf-quic-tls-12 . . . . . . . . . . . . . . 29 | A.2. Since draft-ietf-quic-tls-12 . . . . . . . . . . . . . . 30 | |||
| A.3. Since draft-ietf-quic-tls-11 . . . . . . . . . . . . . . 30 | A.3. Since draft-ietf-quic-tls-11 . . . . . . . . . . . . . . 30 | |||
| A.4. Since draft-ietf-quic-tls-10 . . . . . . . . . . . . . . 30 | A.4. Since draft-ietf-quic-tls-10 . . . . . . . . . . . . . . 30 | |||
| A.5. Since draft-ietf-quic-tls-09 . . . . . . . . . . . . . . 30 | A.5. Since draft-ietf-quic-tls-09 . . . . . . . . . . . . . . 30 | |||
| A.6. Since draft-ietf-quic-tls-08 . . . . . . . . . . . . . . 30 | A.6. Since draft-ietf-quic-tls-08 . . . . . . . . . . . . . . 30 | |||
| A.7. Since draft-ietf-quic-tls-07 . . . . . . . . . . . . . . 30 | A.7. Since draft-ietf-quic-tls-07 . . . . . . . . . . . . . . 30 | |||
| A.8. Since draft-ietf-quic-tls-05 . . . . . . . . . . . . . . 30 | A.8. Since draft-ietf-quic-tls-05 . . . . . . . . . . . . . . 30 | |||
| A.9. Since draft-ietf-quic-tls-04 . . . . . . . . . . . . . . 30 | A.9. Since draft-ietf-quic-tls-04 . . . . . . . . . . . . . . 31 | |||
| A.10. Since draft-ietf-quic-tls-03 . . . . . . . . . . . . . . 30 | A.10. Since draft-ietf-quic-tls-03 . . . . . . . . . . . . . . 31 | |||
| A.11. Since draft-ietf-quic-tls-02 . . . . . . . . . . . . . . 30 | A.11. Since draft-ietf-quic-tls-02 . . . . . . . . . . . . . . 31 | |||
| A.12. Since draft-ietf-quic-tls-01 . . . . . . . . . . . . . . 30 | A.12. Since draft-ietf-quic-tls-01 . . . . . . . . . . . . . . 31 | |||
| A.13. Since draft-ietf-quic-tls-00 . . . . . . . . . . . . . . 31 | A.13. Since draft-ietf-quic-tls-00 . . . . . . . . . . . . . . 31 | |||
| A.14. Since draft-thomson-quic-tls-01 . . . . . . . . . . . . . 31 | A.14. Since draft-thomson-quic-tls-01 . . . . . . . . . . . . . 32 | |||
| Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . 31 | Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . 32 | |||
| Contributors . . . . . . . . . . . . . . . . . . . . . . . . . . 31 | Contributors . . . . . . . . . . . . . . . . . . . . . . . . . . 32 | |||
| Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 32 | Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 32 | |||
| 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 [TLS13]. TLS 1.3 provides | Transport Layer Security (TLS) version 1.3 [TLS13]. TLS 1.3 provides | |||
| critical latency improvements for connection establishment over | critical latency improvements for connection establishment over | |||
| previous versions. Absent packet loss, most new connections can be | previous versions. Absent packet loss, most new connections can be | |||
| established and secured within a single round trip; on subsequent | established and secured within a single round trip; on subsequent | |||
| connections between the same client and server, the client can often | connections between the same client and server, the client can often | |||
| skipping to change at page 4, line 33 ¶ | skipping to change at page 4, line 33 ¶ | |||
| | Record Layer | | | Record Layer | | |||
| | | | | | | |||
| +--------------------------------------------+ | +--------------------------------------------+ | |||
| Each upper layer (handshake, alerts, and application data) is carried | Each upper layer (handshake, alerts, and application data) is carried | |||
| as a series of typed TLS records. Records are individually | as a series of typed TLS records. Records are individually | |||
| cryptographically protected and then transmitted over a reliable | cryptographically protected and then transmitted over a reliable | |||
| transport (typically TCP) which provides sequencing and guaranteed | transport (typically TCP) which provides sequencing and guaranteed | |||
| delivery. | delivery. | |||
| Change Cipher Spec records cannot be sent in QUIC. | ||||
| The TLS authenticated key exchange occurs between two entities: | The TLS authenticated key exchange occurs between two entities: | |||
| client and server. The client initiates the exchange and the server | client and server. The client initiates the exchange and the server | |||
| responds. If the key exchange completes successfully, both client | responds. If the key exchange completes successfully, both client | |||
| and server will agree on a secret. TLS supports both pre-shared key | and server will agree on a secret. TLS supports both pre-shared key | |||
| (PSK) and Diffie-Hellman (DH) key exchanges. PSK is the basis for | (PSK) and Diffie-Hellman (DH) key exchanges. PSK is the basis for | |||
| 0-RTT; the latter provides perfect forward secrecy (PFS) when the DH | 0-RTT; the latter provides perfect forward secrecy (PFS) when the DH | |||
| keys are destroyed. | keys are destroyed. | |||
| After completing the TLS handshake, the client will have learned and | After completing the TLS handshake, the client will have learned and | |||
| authenticated an identity for the server and the server is optionally | authenticated an identity for the server and the server is optionally | |||
| able to learn and authenticate an identity for the client. TLS | able to learn and authenticate an identity for the client. TLS | |||
| supports X.509 [RFC5280] certificate-based authentication for both | supports X.509 [RFC5280] certificate-based authentication for both | |||
| server and client. | server and client. | |||
| The TLS key exchange is resistent to tampering by attackers and it | The TLS key exchange is resistant to tampering by attackers and it | |||
| produces shared secrets that cannot be controlled by either | produces shared secrets that cannot be controlled by either | |||
| participating peer. | participating peer. | |||
| TLS 1.3 provides two basic handshake modes of interest to QUIC: | TLS 1.3 provides two basic handshake modes of interest to QUIC: | |||
| o A full 1-RTT handshake in which the client is able to send | o A full 1-RTT handshake in which the client is able to send | |||
| application data after one round trip and the server immediately | application data after one round trip and the server immediately | |||
| responds after receiving the first handshake message from the | responds after receiving the first handshake message from the | |||
| client. | client. | |||
| o A 0-RTT handshake in which the client uses information it has | o A 0-RTT handshake in which the client uses information it has | |||
| previously learned about the server to send application data | previously learned about the server to send application data | |||
| immediately. This application data can be replayed by an attacker | immediately. This application data can be replayed by an attacker | |||
| so it MUST NOT carry a self-contained trigger for any non- | so it MUST NOT carry a self-contained trigger for any non- | |||
| idempotent action. | idempotent action. | |||
| A simplified TLS 1.3 handshake with 0-RTT application data is shown | A simplified TLS 1.3 handshake with 0-RTT application data is shown | |||
| in Figure 1, see [TLS13] for more options and details. | in Figure 1. Note that this omits the EndOfEarlyData message, which | |||
| is not used in QUIC (see Section 8.3). | ||||
| Client Server | Client Server | |||
| ClientHello | ClientHello | |||
| (0-RTT Application Data) --------> | (0-RTT Application Data) --------> | |||
| ServerHello | ServerHello | |||
| {EncryptedExtensions} | {EncryptedExtensions} | |||
| {Finished} | {Finished} | |||
| <-------- [Application Data] | <-------- [Application Data] | |||
| (EndOfEarlyData) | ||||
| {Finished} --------> | {Finished} --------> | |||
| [Application Data] <-------> [Application Data] | [Application Data] <-------> [Application Data] | |||
| () Indicates messages protected by early data (0-RTT) keys | () Indicates messages protected by early data (0-RTT) keys | |||
| {} Indicates messages protected using handshake keys | {} Indicates messages protected using handshake keys | |||
| [] Indicates messages protected using application data | [] Indicates messages protected using application data | |||
| (1-RTT) keys | (1-RTT) keys | |||
| Figure 1: TLS Handshake with 0-RTT | Figure 1: TLS Handshake with 0-RTT | |||
| skipping to change at page 6, line 38 ¶ | skipping to change at page 6, line 38 ¶ | |||
| +---------------------------------------------+ | +---------------------------------------------+ | |||
| | | | | | | |||
| | QUIC Packet Protection | | | QUIC Packet Protection | | |||
| | | | | | | |||
| +---------------------------------------------+ | +---------------------------------------------+ | |||
| QUIC also relies on TLS 1.3 for authentication and negotiation of | QUIC also relies on TLS 1.3 for authentication and negotiation of | |||
| parameters that are critical to security and performance. | parameters that are critical to security and performance. | |||
| Rather than a strict layering, these two protocols are co-dependent: | Rather than a strict layering, these two protocols are co-dependent: | |||
| QUIC uses the TLS handshake; TLS uses the reliability and ordered | QUIC uses the TLS handshake; TLS uses the reliability, ordered | |||
| delivery provided by QUIC streams. | delivery, and record layer provided by QUIC. | |||
| At a high level, there are two main interactions between the TLS and | At a high level, there are two main interactions between the TLS and | |||
| QUIC components: | QUIC components: | |||
| o The TLS component sends and receives messages via the QUIC | o The TLS component sends and receives messages via the QUIC | |||
| component, with QUIC providing a reliable stream abstraction to | component, with QUIC providing a reliable stream abstraction to | |||
| TLS. | TLS. | |||
| o The TLS component provides a series of updates to the QUIC | o The TLS component provides a series of updates to the QUIC | |||
| component, including (a) new packet protection keys to install (b) | component, including (a) new packet protection keys to install (b) | |||
| skipping to change at page 8, line 5 ¶ | skipping to change at page 8, line 5 ¶ | |||
| QUIC CRYPTO frames is that in QUIC multiple frames may appear in the | QUIC CRYPTO frames is that in QUIC multiple frames may appear in the | |||
| same QUIC packet as long as they are associated with the same | same QUIC packet as long as they are associated with the same | |||
| encryption level. For instance, an implementation might bundle a | encryption level. For instance, an implementation might bundle a | |||
| Handshake message and an ACK for some Handshake data into the same | Handshake message and an ACK for some Handshake data into the same | |||
| packet. | packet. | |||
| Each encryption level has a specific list of frames which may appear | Each encryption level has a specific list of frames which may appear | |||
| in it. The rules here generalize those of TLS, in that frames | in it. The rules here generalize those of TLS, in that frames | |||
| associated with establishing the connection can usually appear at any | associated with establishing the connection can usually appear at any | |||
| encryption level, whereas those associated with transferring data can | encryption level, whereas those associated with transferring data can | |||
| only appear in the 0-RTT and 1-RTT encryption levels | only appear in the 0-RTT and 1-RTT encryption levels: | |||
| o CRYPTO frames MAY appear in packets of any encryption level. | o CRYPTO frames MAY appear in packets of any encryption level except | |||
| 0-RTT. | ||||
| o CONNECTION_CLOSE MAY appear in packets of any encryption level | o CONNECTION_CLOSE MAY appear in packets of any encryption level | |||
| other than 0-RTT. | other than 0-RTT. | |||
| o PADDING and PING frames MAY appear in packets of any encryption | o APPLICATION_CLOSE MAY appear in packets of any encryption level | |||
| level. | other than Initial and 0-RTT. | |||
| o PADDING frames MAY appear in packets of any encryption level. | ||||
| o ACK frames MAY appear in packets of any encryption level other | o ACK frames MAY appear in packets of any encryption level other | |||
| than 0-RTT, but can only acknowledge packets which appeared in | than 0-RTT, but can only acknowledge packets which appeared in | |||
| that encryption level. | that packet number space. | |||
| o STREAM frames MUST ONLY appear in the 0-RTT and 1-RTT levels. | o STREAM frames MUST ONLY appear in the 0-RTT and 1-RTT levels. | |||
| o All other frame types MUST only appear at the 1-RTT levels. | o All other frame types MUST only appear at the 1-RTT levels. | |||
| Because packets could be reordered on the wire, QUIC uses the packet | Because packets could be reordered on the wire, QUIC uses the packet | |||
| type to indicate which level a given packet was encrypted under, as | type to indicate which level a given packet was encrypted under, as | |||
| shown in Table 1. When multiple packets of different encryption | shown in Table 1. When multiple packets of different encryption | |||
| levels need to be sent, endpoints SHOULD use coalesced packets to | levels need to be sent, endpoints SHOULD use coalesced packets to | |||
| send them in the same UDP datagram. | send them in the same UDP datagram. | |||
| skipping to change at page 9, line 41 ¶ | skipping to change at page 9, line 41 ¶ | |||
| handshake octets. | handshake octets. | |||
| At any given time, the TLS stack at an endpoint will have a current | At any given time, the TLS stack at an endpoint will have a current | |||
| sending encryption level and receiving encryption level. Each | sending encryption level and receiving encryption level. Each | |||
| encryption level is associated with a different flow of bytes, which | encryption level is associated with a different flow of bytes, which | |||
| is reliably transmitted to the peer in CRYPTO frames. When TLS | is reliably transmitted to the peer in CRYPTO frames. When TLS | |||
| provides handshake octets to be sent, they are appended to the | provides handshake octets to be sent, they are appended to the | |||
| current flow and any packet that includes the CRYPTO frame is | current flow and any packet that includes the CRYPTO frame is | |||
| protected using keys from the corresponding encryption level. | protected using keys from the corresponding encryption level. | |||
| QUIC takes the unprotected content of TLS handshake records as the | ||||
| content of CRYPTO frames. TLS record protection is not used by QUIC. | ||||
| QUIC assembles CRYPTO frames into QUIC packets, which are protected | ||||
| using QUIC packet protection. | ||||
| When an endpoint receives a QUIC packet containing a CRYPTO frame | When an endpoint receives a QUIC packet containing a CRYPTO frame | |||
| from the network, it proceeds as follows: | from the network, it proceeds as follows: | |||
| o If the packet was in the TLS receiving encryption level, sequence | o If the packet was in the TLS receiving encryption level, sequence | |||
| the data into the input flow as usual. As with STREAM frames, the | the data into the input flow as usual. As with STREAM frames, the | |||
| offset is used to find the proper location in the data sequence. | offset is used to find the proper location in the data sequence. | |||
| If the result of this process is that new data is available, then | If the result of this process is that new data is available, then | |||
| it is delivered to TLS in order. | it is delivered to TLS in order. | |||
| o If the packet is from a previously installed encryption level, it | o If the packet is from a previously installed encryption level, it | |||
| MUST not contain data which extends past the end of previously | MUST not contain data which extends past the end of previously | |||
| received data in that flow. Implementations MUST treat any | received data in that flow. Implementations MUST treat any | |||
| violations of this requirement as a connection error of type | violations of this requirement as a connection error of type | |||
| PROTOCOL_VIOLATION. | PROTOCOL_VIOLATION. | |||
| o If the packet is from a new encryption level, it is saved for | o If the packet is from a new encryption level, it is saved for | |||
| skipping to change at page 11, line 33 ¶ | skipping to change at page 11, line 36 ¶ | |||
| message (using a CRYPTO frame at the Handshake encryption level) an | message (using a CRYPTO frame at the Handshake encryption level) an | |||
| endpoint can send STREAM data (in 1-RTT encryption). If the Finished | endpoint can send STREAM data (in 1-RTT encryption). If the Finished | |||
| message is lost, the endpoint uses the Handshake encryption level to | message is lost, the endpoint uses the Handshake encryption level to | |||
| retransmit the lost message. Reordering or loss of packets can mean | retransmit the lost message. Reordering or loss of packets can mean | |||
| that QUIC will need to handle packets at multiple encryption levels. | that QUIC will need to handle packets at multiple encryption levels. | |||
| During the handshake, this means potentially handling packets at | During the handshake, this means potentially handling packets at | |||
| higher and lower encryption levels than the current encryption level | higher and lower encryption levels than the current encryption level | |||
| used by TLS. | used by TLS. | |||
| In particular, server implementations need to be able to read packets | In particular, server implementations need to be able to read packets | |||
| at the Handshake encryption level before the final TLS handshake | at the Handshake encryption level at the same time as the 0-RTT | |||
| message at the 0-RTT encryption level (EndOfEarlyData) is available. | encryption level. A client could interleave ACK frames that are | |||
| Though the content of CRYPTO frames at the Handshake encryption level | protected with Handshake keys with 0-RTT data and the server needs to | |||
| cannot be forwarded to TLS before EndOfEarlyData is processed, the | process those acknowledgments in order to detect lost Handshake | |||
| client could send ACK frames that the server needs to process in | packets. | |||
| order to detect lost Handshake packets. | ||||
| 4.1.3. TLS Interface Summary | 4.1.3. TLS Interface Summary | |||
| Figure 3 summarizes the exchange between QUIC and TLS for both client | Figure 3 summarizes the exchange between QUIC and TLS for both client | |||
| and server. Each arrow is tagged with the encryption level used for | and server. Each arrow is tagged with the encryption level used for | |||
| that transmission. | that transmission. | |||
| Client Server | Client Server | |||
| Get Handshake | Get Handshake | |||
| skipping to change at page 13, line 8 ¶ | skipping to change at page 13, line 8 ¶ | |||
| acceptable provided that the features of TLS 1.3 that are used by | acceptable provided that the features of TLS 1.3 that are used by | |||
| QUIC are supported by the newer version. | QUIC are supported by the newer version. | |||
| A badly configured TLS implementation could negotiate TLS 1.2 or | A badly configured TLS implementation could negotiate TLS 1.2 or | |||
| another older version of TLS. An endpoint MUST terminate the | another older version of TLS. An endpoint MUST terminate the | |||
| connection if a version of TLS older than 1.3 is negotiated. | connection if a version of TLS older than 1.3 is negotiated. | |||
| 4.3. ClientHello Size | 4.3. ClientHello Size | |||
| QUIC requires that the first Initial packet from a client contain an | QUIC requires that the first Initial packet from a client contain an | |||
| entire crytographic handshake message, which for TLS is the | entire cryptographic handshake message, which for TLS is the | |||
| ClientHello. Though a packet larger than 1200 octets might be | ClientHello. Though a packet larger than 1200 octets might be | |||
| supported by the path, a client improves the likelihood that a packet | supported by the path, a client improves the likelihood that a packet | |||
| is accepted if it ensures that the first ClientHello message is small | is accepted if it ensures that the first ClientHello message is small | |||
| enough to stay within this limit. | enough to stay within this limit. | |||
| QUIC packet and framing add at least 36 octets of overhead to the | QUIC packet and framing add at least 36 octets of overhead to the | |||
| ClientHello message. That overhead increases if the client chooses a | ClientHello message. That overhead increases if the client chooses a | |||
| connection ID without zero length. Overheads also do not include the | connection ID without zero length. Overheads also do not include the | |||
| token or a connection ID longer than 8 octets, both of which might be | token or a connection ID longer than 8 octets, both of which might be | |||
| required if a server sends a Retry packet. | required if a server sends a Retry packet. | |||
| A typical TLS ClientHello can easily fit into a 1200 octet packet. | A typical TLS ClientHello can easily fit into a 1200 octet packet. | |||
| However, in addition to the overheads added by QUIC, there are | However, in addition to the overheads added by QUIC, there are | |||
| several variables that could cause this limit to be exceeded. Large | several variables that could cause this limit to be exceeded. Large | |||
| session tickets, multiple or large key shares, and long lists of | session tickets, multiple or large key shares, and long lists of | |||
| supported ciphers, signature algorithms, versions, QUIC transport | supported ciphers, signature algorithms, versions, QUIC transport | |||
| parameters, and other negotiable parameters and extensions could | parameters, and other negotiable parameters and extensions could | |||
| cause this message to grow. | cause this message to grow. | |||
| For servers, in addition to connection ID and tokens, the size of TLS | For servers, in addition to connection IDs and tokens, the size of | |||
| session tickets can have an effect on a client's ability to connect. | TLS session tickets can have an effect on a client's ability to | |||
| Minimizing the size of these values increases the probability that | connect. Minimizing the size of these values increases the | |||
| they can be successfully used by a client. | probability that they can be successfully used by a client. | |||
| A client is not required to fit the ClientHello that it sends in | A client is not required to fit the ClientHello that it sends in | |||
| response to a HelloRetryRequest message into a single UDP datagram. | response to a HelloRetryRequest message into a single UDP datagram. | |||
| The TLS implementation does not need to ensure that the ClientHello | The TLS implementation does not need to ensure that the ClientHello | |||
| is sufficiently large. QUIC PADDING frames are added to increase the | is sufficiently large. QUIC PADDING frames are added to increase the | |||
| size of the packet as necessary. | size of the packet as necessary. | |||
| 4.4. Peer Authentication | 4.4. Peer Authentication | |||
| skipping to change at page 15, line 27 ¶ | skipping to change at page 15, line 27 ¶ | |||
| generate alerts at the "warning" level. | generate alerts at the "warning" level. | |||
| 4.9. Discarding Unused Keys | 4.9. Discarding Unused Keys | |||
| After QUIC moves to a new encryption level, packet protection keys | After QUIC moves to a new encryption level, packet protection keys | |||
| for previous encryption levels can be discarded. This occurs several | for previous encryption levels can be discarded. This occurs several | |||
| times during the handshake, as well as when keys are updated (see | times during the handshake, as well as when keys are updated (see | |||
| Section 6). | Section 6). | |||
| Packet protection keys are not discarded immediately when new keys | Packet protection keys are not discarded immediately when new keys | |||
| are availble. If packets from a lower encryption level contain | are available. If packets from a lower encryption level contain | |||
| CRYPTO frames, frames that retransmit that data MUST be sent at the | CRYPTO frames, frames that retransmit that data MUST be sent at the | |||
| same encryption level. Similarly, an endpoint generates | same encryption level. Similarly, an endpoint generates | |||
| acknowledgements for packets at the same encryption level as the | acknowledgements for packets at the same encryption level as the | |||
| packet being acknowledged. Thus, it is possible that keys for a | packet being acknowledged. Thus, it is possible that keys for a | |||
| lower encryption level are needed for a short time after keys for a | lower encryption level are needed for a short time after keys for a | |||
| newer encryption level are available. | newer encryption level are available. | |||
| An endpoint cannot discard keys for a given encryption level unless | An endpoint cannot discard keys for a given encryption level unless | |||
| it has both received and acknowledged all CRYPTO frames for that | it has both received and acknowledged all CRYPTO frames for that | |||
| encryption level and when all CRYPTO frames for that encryption level | encryption level and when all CRYPTO frames for that encryption level | |||
| have been acknowledged by its peer. However, this does not guarantee | have been acknowledged by its peer. However, this does not guarantee | |||
| that no further packets will need to be received or sent at that | that no further packets will need to be received or sent at that | |||
| encryption level because a peer might not have received all the | encryption level because a peer might not have received all the | |||
| acknowledgements necessary to reach the same state. | acknowledgements necessary to reach the same state. | |||
| After all CRYPTO frames for a given encryption level have been sent | After all CRYPTO frames for a given encryption level have been sent | |||
| and all expected CRYPTO frames received, and all the corresponding | and all expected CRYPTO frames received, and all the corresponding | |||
| acknowledgments have been received or sent, an endpoint starts a | acknowledgments have been received or sent, an endpoint starts a | |||
| timer. To limit the effect of packet loss around a change in keys, | timer. For 0-RTT keys, which do not carry CRYPTO frames, this timer | |||
| endpoints MUST retain packet protection keys for that encryption | starts when the first packets protected with 1-RTT are sent or | |||
| level for at least three times the current Retramsmission Timeout | received. To limit the effect of packet loss around a change in | |||
| (RTO) interval as defined in [QUIC-RECOVERY]. Retaining keys for | keys, endpoints MUST retain packet protection keys for that | |||
| this interval allows packets containing CRYPTO or ACK frames at that | encryption level for at least three times the current Retransmission | |||
| encryption level to be sent if packets are determined to be lost or | Timeout (RTO) interval as defined in [QUIC-RECOVERY]. Retaining keys | |||
| new packets require acknowledgment. | for this interval allows packets containing CRYPTO or ACK frames at | |||
| that encryption level to be sent if packets are determined to be lost | ||||
| or new packets require acknowledgment. | ||||
| Though an endpoint might retain older keys, new data MUST be sent at | Though an endpoint might retain older keys, new data MUST be sent at | |||
| the highest currently-available encryption level. Only ACK frames | the highest currently-available encryption level. Only ACK frames | |||
| and retransmissions of data in CRYPTO frames are sent at a previous | and retransmissions of data in CRYPTO frames are sent at a previous | |||
| encryption level. These packets MAY also include PADDING frames. | encryption level. These packets MAY also include PADDING frames. | |||
| Once this timer expires, an endpoint MUST NOT either accept or | Once this timer expires, an endpoint MUST NOT either accept or | |||
| generate new packets using those packet protection keys. An endpoint | generate new packets using those packet protection keys. An endpoint | |||
| can discard packet protection keys for that encryption level. | can discard packet protection keys for that encryption level. | |||
| skipping to change at page 16, line 27 ¶ | skipping to change at page 16, line 29 ¶ | |||
| sent two updates prior will appear to use the same keys. After the | sent two updates prior will appear to use the same keys. After the | |||
| handshake is complete, endpoints only need to maintain the two latest | handshake is complete, endpoints only need to maintain the two latest | |||
| sets of packet protection keys and MAY discard older keys. Updating | sets of packet protection keys and MAY discard older keys. Updating | |||
| keys multiple times rapidly can cause packets to be effectively lost | keys multiple times rapidly can cause packets to be effectively lost | |||
| if packets are significantly delayed. Because key updates can only | if packets are significantly delayed. Because key updates can only | |||
| be performed once per round trip time, only packets that are delayed | be performed once per round trip time, only packets that are delayed | |||
| by more than a round trip will be lost as a result of changing keys; | by more than a round trip will be lost as a result of changing keys; | |||
| such packets will be marked as lost before this, as they leave a gap | such packets will be marked as lost before this, as they leave a gap | |||
| in the sequence of packet numbers. | in the sequence of packet numbers. | |||
| 5. QUIC Packet Protection | 5. Packet Protection | |||
| As with TLS over TCP, QUIC encrypts packets with keys derived from | As with TLS over TCP, QUIC protects packets with keys derived from | |||
| the TLS handshake, using the AEAD algorithm negotiated by TLS. | the TLS handshake, using the AEAD algorithm negotiated by TLS. | |||
| 5.1. QUIC Packet Encryption Keys | 5.1. Packet Protection Keys | |||
| QUIC derives packet encryption keys in the same way as TLS 1.3: Each | QUIC derives packet protection keys in the same way that TLS derives | |||
| encryption level/direction pair has a secret value, which is then | record protection keys. | |||
| used to derive the traffic keys using as described in Section 7.3 of | ||||
| [TLS13] | ||||
| The keys for the Initial encryption level are computed based on the | Each encryption level has separate secret values for protection of | |||
| client's initial Destination Connection ID, as described in | packets sent in each direction. These traffic secrets are derived by | |||
| Section 5.1.1. | TLS (see Section 7.1 of [TLS13]) and are used by QUIC for all | |||
| encryption levels except the Initial encryption level. The secrets | ||||
| for the Initial encryption level are computed based on the client's | ||||
| initial Destination Connection ID, as described in Section 5.2. | ||||
| The keys for other encryption levels are computed in the same fashion | The keys used for packet protection are computed from the TLS secrets | |||
| as the corresponding TLS keys (see Section 7 of [TLS13]), except that | using the method described in Section 7.3 of [TLS13]), except that | |||
| the label for HKDF-Expand-Label uses the prefix "quic " rather than | the label for HKDF-Expand-Label uses the prefix "quic " rather than | |||
| "tls13 ". A different label provides key separation between TLS and | "tls13 ". A different label provides key separation between TLS and | |||
| QUIC. | QUIC. | |||
| 5.1.1. Initial Secrets | For example, where TLS might use a label of | |||
| 0x002009746c733133206b657900 to derive a key, QUIC uses | ||||
| 0x00200871756963206b657900. | ||||
| The HKDF-Expand-Label function with a "quic " label is also used to | ||||
| derive the initial secrets (see Section 5.2) and to derive a packet | ||||
| number protection key (the "pn" label, see Section 5.4). | ||||
| 5.2. Initial Secrets | ||||
| Initial packets are protected with a secret derived from the | Initial packets are protected with a secret derived from the | |||
| Destination Connection ID field from the client's first Initial | Destination Connection ID field from the client's first Initial | |||
| packet of the connection. Specifically: | packet of the connection. Specifically: | |||
| initial_salt = 0x9c108f98520a5c5c32968e950e8a2c5fe06d6c38 | initial_salt = 0x9c108f98520a5c5c32968e950e8a2c5fe06d6c38 | |||
| initial_secret = HKDF-Extract(initial_salt, | initial_secret = HKDF-Extract(initial_salt, | |||
| client_dst_connection_id) | client_dst_connection_id) | |||
| client_initial_secret = HKDF-Expand-Label(initial_secret, | client_initial_secret = HKDF-Expand-Label(initial_secret, | |||
| "client in", "", | "client in", "", | |||
| Hash.length) | Hash.length) | |||
| server_initial_secret = HKDF-Expand-Label(initial_secret, | server_initial_secret = HKDF-Expand-Label(initial_secret, | |||
| "server in", "", | "server in", "", | |||
| Hash.length) | Hash.length) | |||
| Note that if the server sends a Retry, the client's Initial will | ||||
| correspond to a new connection and thus use the server provided | ||||
| Destination Connection ID. | ||||
| The hash function for HKDF when deriving initial secrets and keys is | The hash function for HKDF when deriving initial secrets and keys is | |||
| SHA-256 [SHA]. The connection ID used with HKDF-Expand-Label is the | SHA-256 [SHA]. | |||
| initial Destination Connection ID. | ||||
| The connection ID used with HKDF-Expand-Label is the Destination | ||||
| Connection ID in the Initial packet sent by the client. This will be | ||||
| a randomly-selected value unless the client creates the Initial | ||||
| packet after receiving a Retry packet, where the Destination | ||||
| Connection ID is selected by the server. | ||||
| The value of initial_salt is a 20 octet sequence shown in the figure | The value of initial_salt is a 20 octet sequence shown in the figure | |||
| in hexadecimal notation. Future versions of QUIC SHOULD generate a | in hexadecimal notation. Future versions of QUIC SHOULD generate a | |||
| new salt value, thus ensuring that the keys are different for each | 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. This prevents a middlebox that only recognizes one | |||
| version of QUIC from seeing or modifying the contents of handshake | version of QUIC from seeing or modifying the contents of handshake | |||
| packets from future versions. | packets from future versions. | |||
| Note: The Destination Connection ID is of arbitrary length, and it | Note: The Destination Connection ID is of arbitrary length, and it | |||
| could be zero length if the server sends a Retry packet with a | could be zero length if the server sends a Retry packet with a | |||
| zero-length Source Connection ID field. In this case, the Initial | zero-length Source Connection ID field. In this case, the Initial | |||
| keys provide no assurance to the client that the server received | keys provide no assurance to the client that the server received | |||
| its packet; the client has to rely on the exchange that included | its packet; the client has to rely on the exchange that included | |||
| the Retry packet for that property. | the Retry packet for that property. | |||
| 5.2. QUIC AEAD Usage | 5.3. AEAD Usage | |||
| The Authentication Encryption with Associated Data (AEAD) [AEAD] | The Authentication Encryption with Associated Data (AEAD) [AEAD] | |||
| function used for QUIC packet protection is the AEAD that is | function used for QUIC packet protection is the AEAD that is | |||
| negotiated for use with the TLS connection. For example, if TLS is | negotiated for use with the TLS connection. For example, if TLS is | |||
| using the TLS_AES_128_GCM_SHA256, the AEAD_AES_128_GCM function is | using the TLS_AES_128_GCM_SHA256, the AEAD_AES_128_GCM function is | |||
| used. | used. | |||
| QUIC packets are protected prior to applying packet number encryption | QUIC packets are protected prior to applying packet number protection | |||
| (Section 5.3). The unprotected packet number is part of the | (Section 5.4). The unprotected packet number is part of the | |||
| associated data (A). When removing packet protection, an endpoint | associated data (A). When removing packet protection, an endpoint | |||
| first removes the protection from the packet number. | first removes the protection from the packet number. | |||
| All QUIC packets other than Version Negotiation and Retry packets are | All QUIC packets other than Version Negotiation and Retry packets are | |||
| protected with an AEAD algorithm [AEAD]. Prior to establishing a | protected with an AEAD algorithm [AEAD]. Prior to establishing a | |||
| shared secret, packets are protected with AEAD_AES_128_GCM and a key | shared secret, packets are protected with AEAD_AES_128_GCM and a key | |||
| derived from the destination connection ID in the client's first | derived from the destination connection ID in the client's first | |||
| Initial packet (see Section 5.1.1). This provides protection against | Initial packet (see Section 5.2). This provides protection against | |||
| off-path attackers and robustness against QUIC version unaware | off-path attackers and robustness against QUIC version unaware | |||
| middleboxes, but not against on-path attackers. | middleboxes, but not against on-path attackers. | |||
| All ciphersuites currently defined for TLS 1.3 - and therefore QUIC - | All ciphersuites currently defined for TLS 1.3 - and therefore QUIC - | |||
| have a 16-byte authentication tag and produce an output 16 bytes | have a 16-byte authentication tag and produce an output 16 bytes | |||
| larger than their input. | larger than their input. | |||
| The key and IV for the packet are computed as described in | The key and IV for the packet are computed as described in | |||
| Section 5.1. The nonce, N, is formed by combining the packet | Section 5.1. The nonce, N, is formed by combining the packet | |||
| protection IV with the packet number. The 64 bits of the | protection IV with the packet number. The 64 bits of the | |||
| skipping to change at page 18, line 44 ¶ | skipping to change at page 19, line 5 ¶ | |||
| following the header, as described in [QUIC-TRANSPORT]. | following the header, as described in [QUIC-TRANSPORT]. | |||
| The output ciphertext, C, of the AEAD is transmitted in place of P. | The output ciphertext, C, of the AEAD is transmitted in place of P. | |||
| Some AEAD functions have limits for how many packets can be encrypted | Some AEAD functions have limits for how many packets can be encrypted | |||
| under the same key and IV (see for example [AEBounds]). This might | under the same key and IV (see 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 6) prior to exceeding any limit set for the AEAD | key update (Section 6) prior to exceeding any limit set for the AEAD | |||
| that is in use. | that is in use. | |||
| 5.3. Packet Number Protection | 5.4. Packet Number Protection | |||
| QUIC packet numbers are protected using a key that is derived from | QUIC packet numbers are protected using a key that is derived from | |||
| the current set of secrets. The key derived using the "pn" label is | the current set of secrets. The key derived using the "pn" label is | |||
| used to protect the packet number from casual observation. The | used to protect the packet number from casual observation. The | |||
| packet number protection algorithm depends on the negotiated AEAD. | packet number protection algorithm depends on the negotiated AEAD. | |||
| Packet number protection is applied after packet protection is | Packet number protection is applied after packet protection is | |||
| applied (see Section 5.2). The ciphertext of the packet is sampled | applied (see Section 5.3). The ciphertext of the packet is sampled | |||
| and used as input to an encryption algorithm. | and used as input to an encryption algorithm. | |||
| In sampling the packet ciphertext, the packet number length is | In sampling the packet ciphertext, the packet number length is | |||
| assumed to be 4 octets (its maximum possible encoded length), unless | assumed to be 4 octets (its maximum possible encoded length), unless | |||
| there is insufficient space in the packet for sampling. The sampled | there is insufficient space in the packet for sampling. The sampled | |||
| ciphertext starts after allowing for a 4 octet packet number unless | ciphertext starts after allowing for a 4 octet packet number unless | |||
| this would cause the sample to extend past the end of the packet. If | this would cause the sample to extend past the end of the packet. If | |||
| the sample would extend past the end of the packet, the end of the | the sample would extend past the end of the packet, the end of the | |||
| packet is sampled. | packet is sampled. | |||
| skipping to change at page 20, line 5 ¶ | skipping to change at page 20, line 11 ¶ | |||
| the packet number is stored in the first octet of the encoded packet | the packet number is stored in the first octet of the encoded packet | |||
| number, it may be necessary to progressively decrypt the packet | number, it may be necessary to progressively decrypt the packet | |||
| number. | number. | |||
| Before a TLS ciphersuite can be used with QUIC, a packet protection | Before a TLS ciphersuite can be used with QUIC, a packet protection | |||
| algorithm MUST be specifed for the AEAD used with that ciphersuite. | algorithm MUST be specifed for the AEAD used with that ciphersuite. | |||
| This document defines algorithms for AEAD_AES_128_GCM, | This document defines algorithms for AEAD_AES_128_GCM, | |||
| AEAD_AES_128_CCM, AEAD_AES_256_GCM, AEAD_AES_256_CCM (all AES AEADs | AEAD_AES_128_CCM, AEAD_AES_256_GCM, AEAD_AES_256_CCM (all AES AEADs | |||
| are defined in [AEAD]), and AEAD_CHACHA20_POLY1305 ([CHACHA]). | are defined in [AEAD]), and AEAD_CHACHA20_POLY1305 ([CHACHA]). | |||
| 5.3.1. AES-Based Packet Number Protection | 5.4.1. AES-Based Packet Number Protection | |||
| This section defines the packet protection algorithm for | This section defines the packet protection algorithm for | |||
| AEAD_AES_128_GCM, AEAD_AES_128_CCM, AEAD_AES_256_GCM, and | AEAD_AES_128_GCM, AEAD_AES_128_CCM, AEAD_AES_256_GCM, and | |||
| AEAD_AES_256_CCM. AEAD_AES_128_GCM and AEAD_AES_128_CCM use 128-bit | AEAD_AES_256_CCM. AEAD_AES_128_GCM and AEAD_AES_128_CCM use 128-bit | |||
| AES [AES] in counter (CTR) mode. AEAD_AES_256_GCM, and | AES [AES] in counter (CTR) mode. AEAD_AES_256_GCM, and | |||
| AEAD_AES_256_CCM use 256-bit AES in CTR mode. | AEAD_AES_256_CCM use 256-bit AES in CTR mode. | |||
| This algorithm samples 16 octets from the packet ciphertext. This | This algorithm samples 16 octets from the packet ciphertext. This | |||
| value is used as the counter input to AES-CTR. | value is used as the counter input to AES-CTR. | |||
| encrypted_pn = AES-CTR(pn_key, sample, packet_number) | encrypted_pn = AES-CTR(pn_key, sample, packet_number) | |||
| 5.3.2. ChaCha20-Based Packet Number Protection | 5.4.2. ChaCha20-Based Packet Number Protection | |||
| When AEAD_CHACHA20_POLY1305 is in use, packet number protection uses | When AEAD_CHACHA20_POLY1305 is in use, packet number protection uses | |||
| the raw ChaCha20 function as defined in Section 2.4 of [CHACHA]. | the raw ChaCha20 function as defined in Section 2.4 of [CHACHA]. | |||
| This uses a 256-bit key and 16 octets sampled from the packet | This uses a 256-bit key and 16 octets sampled from the packet | |||
| protection output. | protection output. | |||
| The first 4 octets of the sampled ciphertext are interpreted as a | The first 4 octets of the sampled ciphertext are interpreted as a | |||
| 32-bit number in little-endian order and are used as the block count. | 32-bit number in little-endian order and are used as the block count. | |||
| The remaining 12 octets are interpreted as three concatenated 32-bit | The remaining 12 octets are interpreted as three concatenated 32-bit | |||
| numbers in little-endian order and used as the nonce. | numbers in little-endian order and used as the nonce. | |||
| The encoded packet number is then encrypted with ChaCha20 directly. | The encoded packet number is then encrypted with ChaCha20 directly. | |||
| In pseudocode: | In pseudocode: | |||
| counter = DecodeLE(sample[0..3]) | counter = DecodeLE(sample[0..3]) | |||
| nonce = DecodeLE(sample[4..7], sample[8..11], sample[12..15]) | nonce = DecodeLE(sample[4..7], sample[8..11], sample[12..15]) | |||
| encrypted_pn = ChaCha20(pn_key, counter, nonce, packet_number) | encrypted_pn = ChaCha20(pn_key, counter, nonce, packet_number) | |||
| 5.4. 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 in the same packet number space | number, it MUST discard all packets in the same packet number space | |||
| with higher packet numbers if they cannot be successfully unprotected | with higher packet numbers if they cannot be successfully unprotected | |||
| with either the same key, or - if there is a key update - the next | with either the same key, or - if there is a key update - the next | |||
| packet protection key (see Section 6). Similarly, a packet that | packet protection key (see Section 6). Similarly, a packet that | |||
| appears to trigger a key update, but cannot be unprotected | appears to trigger a key update, but cannot be unprotected | |||
| successfully MUST be discarded. | successfully MUST be discarded. | |||
| Failure to unprotect a packet does not necessarily indicate the | Failure to unprotect a packet does not necessarily indicate the | |||
| existence of a protocol error in a peer or an attack. The truncated | existence of a protocol error in a peer or an attack. The truncated | |||
| packet number encoding used in QUIC can cause packet numbers to be | packet number encoding used in QUIC can cause packet numbers to be | |||
| decoded incorrectly if they are delayed significantly. | decoded incorrectly if they are delayed significantly. | |||
| 5.5. Use of 0-RTT Keys | 5.6. Use of 0-RTT Keys | |||
| If 0-RTT keys are available (see Section 4.5), the lack of replay | If 0-RTT keys are available (see Section 4.5), the lack of replay | |||
| protection means that restrictions on their use are necessary to | protection means that restrictions on their use are necessary to | |||
| avoid replay attacks on the protocol. | avoid replay attacks on the protocol. | |||
| A client MUST only use 0-RTT keys to protect data that is idempotent. | A client MUST only use 0-RTT keys to protect data that is idempotent. | |||
| A client MAY wish to apply additional restrictions on what data it | A client MAY wish to apply additional restrictions on what data it | |||
| sends prior to the completion of the TLS handshake. A client | sends prior to the completion of the TLS handshake. A client | |||
| otherwise treats 0-RTT keys as equivalent to 1-RTT keys, except that | otherwise treats 0-RTT keys as equivalent to 1-RTT keys, except that | |||
| it MUST NOT send ACKs with 0-RTT keys. | it MUST NOT send ACKs with 0-RTT keys. | |||
| A client that receives an indication that its 0-RTT data has been | A client that receives an indication that its 0-RTT data has been | |||
| accepted by a server can send 0-RTT data until it receives all of the | accepted by a server can send 0-RTT data until it receives all of the | |||
| server's handshake messages. A client SHOULD stop sending 0-RTT data | server's handshake messages. A client SHOULD stop sending 0-RTT data | |||
| if it receives an indication that 0-RTT data has been rejected. | if it receives an indication that 0-RTT data has been rejected. | |||
| A server MUST NOT use 0-RTT keys to protect packets; it uses 1-RTT | A server MUST NOT use 0-RTT keys to protect packets; it uses 1-RTT | |||
| keys to protect acknowledgements of 0-RTT packets. Clients MUST NOT | keys to protect acknowledgements of 0-RTT packets. A client MUST NOT | |||
| attempt to decrypt 0-RTT packets it receives and instead MUST discard | attempt to decrypt 0-RTT packets it receives and instead MUST discard | |||
| them. | them. | |||
| Note: 0-RTT data can be acknowledged by the server as it receives | Note: 0-RTT data can be acknowledged by the server as it receives | |||
| it, but any packets containing acknowledgments of 0-RTT data | it, but any packets containing acknowledgments of 0-RTT data | |||
| cannot have packet protection removed by the client until the TLS | cannot have packet protection removed by the client until the TLS | |||
| handshake is complete. The 1-RTT keys necessary to remove packet | handshake is complete. The 1-RTT keys necessary to remove packet | |||
| protection cannot be derived until the client receives all server | protection cannot be derived until the client receives all server | |||
| handshake messages. | handshake messages. | |||
| 5.6. Receiving Out-of-Order Protected Frames | 5.7. Receiving Out-of-Order Protected Frames | |||
| Due to reordering and loss, protected packets might be received by an | Due to reordering and loss, protected packets might be received by an | |||
| endpoint before the final TLS handshake messages are received. A | endpoint before the final TLS handshake messages are received. A | |||
| client will be unable to decrypt 1-RTT packets from the server, | client will be unable to decrypt 1-RTT packets from the server, | |||
| whereas a server will be able to decrypt 1-RTT packets from the | whereas a server will be able to decrypt 1-RTT packets from the | |||
| client. | client. | |||
| However, a server MUST NOT process data from incoming 1-RTT protected | However, a server MUST NOT process data from incoming 1-RTT protected | |||
| packets before verifying either the client Finished message or - in | packets before verifying either the client Finished message or - in | |||
| the case that the server has chosen to use a pre-shared key - the | the case that the server has chosen to use a pre-shared key - the | |||
| skipping to change at page 22, line 15 ¶ | skipping to change at page 22, line 17 ¶ | |||
| A server could receive packets protected with 0-RTT keys prior to | A server could receive packets protected with 0-RTT keys prior to | |||
| receiving a TLS ClientHello. The server MAY retain these packets for | receiving a TLS ClientHello. The server MAY retain these packets for | |||
| later decryption in anticipation of receiving a ClientHello. | later decryption in anticipation of receiving a ClientHello. | |||
| 6. Key Update | 6. Key Update | |||
| Once the 1-RTT keys are established and the short header is in use, | Once the 1-RTT keys are established and the short header is in use, | |||
| it is possible to update the keys. The KEY_PHASE bit in the short | it is possible to update the keys. The KEY_PHASE bit in the short | |||
| header is used to indicate whether key updates have occurred. The | header is used to indicate whether key updates have occurred. The | |||
| KEY_PHASE bit is initially set to 0 and then inverted with each key | KEY_PHASE bit is initially set to 0 and then inverted with each key | |||
| update Section 6. | update. | |||
| The KEY_PHASE bit allows a recipient to detect a change in keying | The KEY_PHASE bit allows a recipient to detect a change in keying | |||
| material without necessarily needing to receive the first packet that | material without necessarily needing to receive the first packet that | |||
| triggered the change. An endpoint that notices a changed KEY_PHASE | triggered the change. An endpoint that notices a changed KEY_PHASE | |||
| bit can update keys and decrypt the packet that contains the changed | bit can update keys and decrypt the packet that contains the changed | |||
| bit, see Section 6. | bit. | |||
| 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. | successfully decrypted a packet with a matching KEY_PHASE. | |||
| A receiving endpoint detects an update when the KEY_PHASE bit doesn't | A receiving endpoint detects an update when the KEY_PHASE bit doesn't | |||
| match what it is expecting. It creates a new secret (see Section 7.2 | match what it is expecting. It creates a new secret (see Section 7.2 | |||
| of [TLS13]) and the corresponding read key and IV. If the packet can | of [TLS13]) and the corresponding read key and IV. If the packet can | |||
| be decrypted and authenticated using these values, then the keys it | be decrypted and authenticated using these values, then the keys it | |||
| uses for packet protection are also updated. The next packet sent by | uses for packet protection are also updated. The next packet sent by | |||
| skipping to change at page 25, line 20 ¶ | skipping to change at page 25, line 20 ¶ | |||
| The quic_transport_parameters extension is carried in the ClientHello | The quic_transport_parameters extension is carried in the ClientHello | |||
| and the EncryptedExtensions messages during the handshake. | and the EncryptedExtensions messages during the handshake. | |||
| While the transport parameters are technically available prior to the | While the transport parameters are technically available prior to the | |||
| completion of the handshake, they cannot be fully trusted until the | completion of the handshake, they cannot be fully trusted until the | |||
| handshake completes, and reliance on them should be minimized. | handshake completes, and reliance on them should be minimized. | |||
| However, any tampering with the parameters will cause the handshake | However, any tampering with the parameters will cause the handshake | |||
| to fail. | to fail. | |||
| Endpoints MUST NOT send this extension in a TLS connection that does | ||||
| not use QUIC (such as the use of TLS with TCP defined in [TLS13]). A | ||||
| fatal unsupported_extension alert MUST be sent if this extension is | ||||
| received when the transport is not QUIC. | ||||
| 8.3. Removing the EndOfEarlyData Message | ||||
| The TLS EndOfEarlyData message is not used with QUIC. QUIC does not | ||||
| rely on this message to mark the end of 0-RTT data or to signal the | ||||
| change to Handshake keys. | ||||
| Clients MUST NOT send the EndOfEarlyData message. A server MUST | ||||
| treat receipt of a CRYPTO frame in a 0-RTT packet as a connection | ||||
| error of type PROTOCOL_VIOLATION. | ||||
| As a result, EndOfEarlyData does not appear in the TLS handshake | ||||
| transcript. | ||||
| 9. Security Considerations | 9. 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. | |||
| 9.1. Packet Reflection Attack Mitigation | 9.1. Packet Reflection Attack Mitigation | |||
| skipping to change at page 25, line 46 ¶ | skipping to change at page 26, line 16 ¶ | |||
| containing a ClientHello MUST be padded to a minimum size. Second, | containing a ClientHello MUST be padded to a minimum size. Second, | |||
| if responding to an unverified source address, the server is | if responding to an unverified source address, the server is | |||
| forbidden to send more than three UDP datagrams in its first flight | forbidden to send more than three UDP datagrams in its first flight | |||
| (see Section 4.7 of [QUIC-TRANSPORT]). Finally, because | (see Section 4.7 of [QUIC-TRANSPORT]). Finally, because | |||
| acknowledgements of Handshake packets are authenticated, a blind | acknowledgements of Handshake packets are authenticated, a blind | |||
| attacker cannot forge them. Put together, these defenses limit the | attacker cannot forge them. Put together, these defenses limit the | |||
| level of amplification. | level of amplification. | |||
| 9.2. Peer Denial of Service | 9.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 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 | |||
| marked with the FIN bit. This prevents "STREAM" frames from being | marked with the FIN bit. This prevents "STREAM" frames from being | |||
| sent that only waste effort. | sent that only waste effort. | |||
| skipping to change at page 27, line 41 ¶ | skipping to change at page 28, line 15 ¶ | |||
| [AES] "Advanced encryption standard (AES)", National Institute | [AES] "Advanced encryption standard (AES)", National Institute | |||
| of Standards and Technology report, | of Standards and Technology report, | |||
| DOI 10.6028/nist.fips.197, November 2001. | DOI 10.6028/nist.fips.197, November 2001. | |||
| [CHACHA] Nir, Y. and A. Langley, "ChaCha20 and Poly1305 for IETF | [CHACHA] Nir, Y. and A. Langley, "ChaCha20 and Poly1305 for IETF | |||
| Protocols", RFC 8439, DOI 10.17487/RFC8439, June 2018, | Protocols", RFC 8439, DOI 10.17487/RFC8439, June 2018, | |||
| <https://www.rfc-editor.org/info/rfc8439>. | <https://www.rfc-editor.org/info/rfc8439>. | |||
| [QUIC-RECOVERY] | [QUIC-RECOVERY] | |||
| Iyengar, J., Ed. and I. Swett, Ed., "QUIC Loss Detection | Iyengar, J., Ed. and I. Swett, Ed., "QUIC Loss Detection | |||
| and Congestion Control", draft-ietf-quic-recovery-14 (work | and Congestion Control", draft-ietf-quic-recovery-15 (work | |||
| in progress), August 2018. | in progress), October 2018. | |||
| [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-14 (work in progress), August 2018. | transport-15 (work in progress), October 2018. | |||
| [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate | [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate | |||
| Requirement Levels", BCP 14, RFC 2119, | Requirement Levels", BCP 14, RFC 2119, | |||
| DOI 10.17487/RFC2119, March 1997, | DOI 10.17487/RFC2119, March 1997, | |||
| <https://www.rfc-editor.org/info/rfc2119>. | <https://www.rfc-editor.org/info/rfc2119>. | |||
| [RFC7301] Friedl, S., Popov, A., Langley, A., and E. Stephan, | [RFC7301] Friedl, S., Popov, A., Langley, A., and E. Stephan, | |||
| "Transport Layer Security (TLS) Application-Layer Protocol | "Transport Layer Security (TLS) Application-Layer Protocol | |||
| Negotiation Extension", RFC 7301, DOI 10.17487/RFC7301, | Negotiation Extension", RFC 7301, DOI 10.17487/RFC7301, | |||
| July 2014, <https://www.rfc-editor.org/info/rfc7301>. | July 2014, <https://www.rfc-editor.org/info/rfc7301>. | |||
| skipping to change at page 28, line 46 ¶ | skipping to change at page 29, line 18 ¶ | |||
| 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>. | |||
| [IMC] Katz, J. and Y. Lindell, "Introduction to Modern | [IMC] Katz, J. and Y. Lindell, "Introduction to Modern | |||
| Cryptography, Second Edition", ISBN 978-1466570269, | Cryptography, Second Edition", ISBN 978-1466570269, | |||
| November 2014. | November 2014. | |||
| [QUIC-HTTP] | [QUIC-HTTP] | |||
| Bishop, M., Ed., "Hypertext Transfer Protocol (HTTP) over | Bishop, M., Ed., "Hypertext Transfer Protocol (HTTP) over | |||
| QUIC", draft-ietf-quic-http-14 (work in progress), August | QUIC", draft-ietf-quic-http-15 (work in progress), October | |||
| 2018. | 2018. | |||
| [RFC2818] Rescorla, E., "HTTP Over TLS", RFC 2818, | [RFC2818] Rescorla, E., "HTTP Over TLS", RFC 2818, | |||
| DOI 10.17487/RFC2818, May 2000, | DOI 10.17487/RFC2818, May 2000, | |||
| <https://www.rfc-editor.org/info/rfc2818>. | <https://www.rfc-editor.org/info/rfc2818>. | |||
| [RFC5280] Cooper, D., Santesson, S., Farrell, S., Boeyen, S., | [RFC5280] Cooper, D., Santesson, S., Farrell, S., Boeyen, S., | |||
| Housley, R., and W. Polk, "Internet X.509 Public Key | Housley, R., and W. Polk, "Internet X.509 Public Key | |||
| Infrastructure Certificate and Certificate Revocation List | Infrastructure Certificate and Certificate Revocation List | |||
| (CRL) Profile", RFC 5280, DOI 10.17487/RFC5280, May 2008, | (CRL) Profile", RFC 5280, DOI 10.17487/RFC5280, May 2008, | |||
| End of changes. 54 change blocks. | ||||
| 92 lines changed or deleted | 132 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/ | ||||