Internet Engineering Task Force (IETF)                   M. Thomson, Ed.
Request for Comments: 9001                                       Mozilla
Category: Standards Track                                 S. Turner, Ed.
ISSN: 2070-1721                                                    sn3rd
                                                                May 2021

Using TLS to Secure QUIC




This document describes how Transport Layer Security (TLS) is used to secure QUIC.


Status of This Memo


This is an Internet Standards Track document.


This document is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community. It has received public review and has been approved for publication by the Internet Engineering Steering Group (IESG). Further information on Internet Standards is available in Section 2 of RFC 7841.

この文書は、インターネットエンジニアリングタスクフォース(IETF)の製品です。IETFコミュニティのコンセンサスを表します。それは公開レビューを受け、インターネットエンジニアリングステアリンググループ(IESG)による出版の承認を受けました。インターネット規格に関する詳細情報は、RFC 7841のセクション2で利用できます。

Information about the current status of this document, any errata, and how to provide feedback on it may be obtained at


Copyright Notice


Copyright (c) 2021 IETF Trust and the persons identified as the document authors. All rights reserved.

著作権(C)2021 IETF信頼と文書著者として識別された人。全著作権所有。

This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents ( in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.

このドキュメントは、このドキュメントの発行日に有効なBCP 78およびIETFドキュメントに関連するIETFトラストの法的規定(の対象となります。 これらのドキュメントは、このドキュメントに関するお客様の権利と制限について説明しているため、注意深く確認してください。 このドキュメントから抽出されたコードコンポーネントには、Trust LegalProvisionsのセクション4.eで説明されているSimplifiedBSD Licenseテキストが含まれている必要があり、Simplified BSDLicenseで説明されているように保証なしで提供されます。

Table of Contents


   1.  Introduction
   2.  Notational Conventions
     2.1.  TLS Overview
   3.  Protocol Overview
   4.  Carrying TLS Messages
     4.1.  Interface to TLS
       4.1.1.  Handshake Complete
       4.1.2.  Handshake Confirmed
       4.1.3.  Sending and Receiving Handshake Messages
       4.1.4.  Encryption Level Changes
       4.1.5.  TLS Interface Summary
     4.2.  TLS Version
     4.3.  ClientHello Size
     4.4.  Peer Authentication
     4.5.  Session Resumption
     4.6.  0-RTT
       4.6.1.  Enabling 0-RTT
       4.6.2.  Accepting and Rejecting 0-RTT
       4.6.3.  Validating 0-RTT Configuration
     4.7.  HelloRetryRequest
     4.8.  TLS Errors
     4.9.  Discarding Unused Keys
       4.9.1.  Discarding Initial Keys
       4.9.2.  Discarding Handshake Keys
       4.9.3.  Discarding 0-RTT Keys
   5.  Packet Protection
     5.1.  Packet Protection Keys
     5.2.  Initial Secrets
     5.3.  AEAD Usage
     5.4.  Header Protection
       5.4.1.  Header Protection Application
       5.4.2.  Header Protection Sample
       5.4.3.  AES-Based Header Protection
       5.4.4.  ChaCha20-Based Header Protection
     5.5.  Receiving Protected Packets
     5.6.  Use of 0-RTT Keys
     5.7.  Receiving Out-of-Order Protected Packets
     5.8.  Retry Packet Integrity
   6.  Key Update
     6.1.  Initiating a Key Update
     6.2.  Responding to a Key Update
     6.3.  Timing of Receive Key Generation
     6.4.  Sending with Updated Keys
     6.5.  Receiving with Different Keys
     6.6.  Limits on AEAD Usage
     6.7.  Key Update Error Code
   7.  Security of Initial Messages
   8.  QUIC-Specific Adjustments to the TLS Handshake
     8.1.  Protocol Negotiation
     8.2.  QUIC Transport Parameters Extension
     8.3.  Removing the EndOfEarlyData Message
     8.4.  Prohibit TLS Middlebox Compatibility Mode
   9.  Security Considerations
     9.1.  Session Linkability
     9.2.  Replay Attacks with 0-RTT
     9.3.  Packet Reflection Attack Mitigation
     9.4.  Header Protection Analysis
     9.5.  Header Protection Timing Side Channels
     9.6.  Key Diversity
     9.7.  Randomness
   10. IANA Considerations
   11. References
     11.1.  Normative References
     11.2.  Informative References
   Appendix A.  Sample Packet Protection
     A.1.  Keys
     A.2.  Client Initial
     A.3.  Server Initial
     A.4.  Retry
     A.5.  ChaCha20-Poly1305 Short Header Packet
   Appendix B.  AEAD Algorithm Analysis
     B.1.  Analysis of AEAD_AES_128_GCM and AEAD_AES_256_GCM Usage
       B.1.1.  Confidentiality Limit
       B.1.2.  Integrity Limit
     B.2.  Analysis of AEAD_AES_128_CCM Usage Limits
   Authors' Addresses
1. Introduction
1. はじめに

This document describes how QUIC [QUIC-TRANSPORT] is secured using TLS [TLS13].

この文書では、TLS [TLS13]を使用してQUIC [QUIC-TRANSPORT]が保護される方法について説明します。

TLS 1.3 provides critical latency improvements for connection establishment over previous versions. Absent packet loss, most new connections can be established and secured within a single round trip; on subsequent connections between the same client and server, the client can often send application data immediately, that is, using a zero round-trip setup.

TLS 1.3は、以前のバージョンに対する接続確立のための重要な待ち時間の改善を提供します。不在のパケット損失、ほとんどの新しい接続は、1回のラウンドトリップ内で確立され保護されます。同じクライアントとサーバー間の後続の接続で、クライアントはすぐにアプリケーションデータを送信することができます。つまり、ゼロの往復設定を使用することができます。

This document describes how TLS acts as a security component of QUIC.


2. Notational Conventions
2. 表記規則

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.

この文書のキーワード "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", および "OPTIONAL" はBCP 14 [RFC2119] [RFC8174]で説明されているように、すべて大文字の場合にのみ解釈されます。

This document uses the terminology established in [QUIC-TRANSPORT].


For brevity, the acronym TLS is used to refer to TLS 1.3, though a newer version could be used; see Section 4.2.

簡潔にするために、Acronym TLSはTLS 1.3を参照するために使用されますが、新しいバージョンは使用できます。セクション4.2を参照してください。

2.1. TLS Overview
2.1. TLSの概要

TLS provides two endpoints with a way to establish a means of communication over an untrusted medium (for example, the Internet). TLS enables authentication of peers and provides confidentiality and integrity protection for messages that endpoints exchange.


Internally, TLS is a layered protocol, with the structure shown in Figure 1.


   Content   |             |            |  Application |         |
   Layer     |  Handshake  |   Alerts   |     Data     |   ...   |
             |             |            |              |         |
   Record    |                                                   |
   Layer     |                      Records                      |
             |                                                   |

Figure 1: TLS Layers


Each content-layer message (e.g., handshake, alerts, and application data) is carried as a series of typed TLS records by the record layer. Records are individually cryptographically protected and then transmitted over a reliable transport (typically TCP), which provides sequencing and guaranteed delivery.


The TLS authenticated key exchange occurs between two endpoints: client and server. The client initiates the exchange and the server responds. If the key exchange completes successfully, both client and server will agree on a secret. TLS supports both pre-shared key (PSK) and Diffie-Hellman over either finite fields or elliptic curves ((EC)DHE) key exchanges. PSK is the basis for Early Data (0-RTT); the latter provides forward secrecy (FS) when the (EC)DHE keys are destroyed. The two modes can also be combined to provide forward secrecy while using the PSK for authentication.


After completing the TLS handshake, the client will have learned and authenticated an identity for the server, and the server is optionally able to learn and authenticate an identity for the client. TLS supports X.509 [RFC5280] certificate-based authentication for both server and client. When PSK key exchange is used (as in resumption), knowledge of the PSK serves to authenticate the peer.

TLSハンドシェイクを完了した後、クライアントはサーバーのIDを学習および認証し、サーバーはオプションでクライアントのIDを学習し認証できます。TLSは、サーバーとクライアントの両方のX.509 [RFC5280]証明書ベース認証をサポートしています。PSKキー交換が使用されている場合(再開のように)、PSKの知識はピアを認証するのに役立ちます。

The TLS key exchange is resistant to tampering by attackers, and it produces shared secrets that cannot be controlled by either participating peer.


TLS provides two basic handshake modes of interest to QUIC:


* A full 1-RTT handshake, in which the client is able to send application data after one round trip and the server immediately responds after receiving the first handshake message from the client.

* クライアントが1回のラウンドトリップ後にアプリケーションデータを送信できるフル1-RTTハンドシェイクと、サーバーはすぐに応答し、クライアントから最初のハンドシェイクメッセージを受信した後に応答します。

* A 0-RTT handshake, in which the client uses information it has previously learned about the server to send application data immediately. This application data can be replayed by an attacker, so 0-RTT is not suitable for carrying instructions that might initiate any action that could cause unwanted effects if replayed.

* クライアントがアプリケーションデータをすぐに送信するためにサーバーについて以前に学習した情報を使用している0-RTTハンドシェイク。このアプリケーションデータは攻撃者によって再生することができ、0-RTTは、再生された場合に不要な効果を引き起こす可能性がある行動を起こす可能性がある命令を搬送するのには適していません。

A simplified TLS handshake with 0-RTT application data is shown in Figure 2.


       Client                                             Server
      (0-RTT Application Data)  -------->
                                <--------      [Application Data]
      {Finished}                -------->
      [Application Data]        <------->      [Application Data]
       () Indicates messages protected by Early Data (0-RTT) Keys
       {} Indicates messages protected using Handshake Keys
       [] Indicates messages protected using Application Data
          (1-RTT) Keys

Figure 2: TLS Handshake with 0-RTT


Figure 2 omits the EndOfEarlyData message, which is not used in QUIC; see Section 8.3. Likewise, neither ChangeCipherSpec nor KeyUpdate messages are used by QUIC. ChangeCipherSpec is redundant in TLS 1.3; see Section 8.4. QUIC has its own key update mechanism; see Section 6.

図2は、QUICでは使用されないEndOfEarlyDataメッセージを省略しています。 セクション8.3を参照してください。 同様に、ChangeCipherSpecメッセージもKeyUpdateメッセージもQUICでは使用されません。 ChangeCipherSpecはTLS1.3では冗長です。 セクション8.4を参照してください。 QUICには独自のキー更新メカニズムがあります。 セクション6を参照してください。

Data is protected using a number of encryption levels:


* Initial keys

* 初期キー

* Early data (0-RTT) keys

* 初期データ(0-RTT)キー

* Handshake keys

* ハンドシェイクキー

* Application data (1-RTT) keys

* アプリケーションデータ(1 RTT)キー

Application data can only appear in the early data and application data levels. Handshake and alert messages may appear in any level.


The 0-RTT handshake can be used if the client and server have previously communicated. In the 1-RTT handshake, the client is unable to send protected application data until it has received all of the handshake messages sent by the server.


3. Protocol Overview
3. プロトコルの概要

QUIC [QUIC-TRANSPORT] assumes responsibility for the confidentiality and integrity protection of packets. For this it uses keys derived from a TLS handshake [TLS13], but instead of carrying TLS records over QUIC (as with TCP), TLS handshake and alert messages are carried directly over the QUIC transport, which takes over the responsibilities of the TLS record layer, as shown in Figure 3.

QUIC [QUIC-TRANSPORT]パケットの機密性と整合性保護について責任を負います。これはTLSハンドシェイク[TLS13]から派生したキーを使用していますが、(TCPと同様に)TLSレコードを介してTLSレコードを運ぶのではなく、TLSハンドシェイクとアラートメッセージはTLSレコードの責任を引き継ぐQUICのトランスポートで直接伝送されます。図3に示すように、レイヤー。

   +--------------+--------------+ +-------------+
   |     TLS      |     TLS      | |    QUIC     |
   |  Handshake   |    Alerts    | | Applications|
   |              |              | |  (h3, etc.) |
   |                                             |
   |                QUIC Transport               |
   |   (streams, reliability, congestion, etc.)  |
   |                                             |
   |                                             |
   |            QUIC Packet Protection           |
   |                                             |

Figure 3: QUIC Layers


QUIC also relies on TLS for authentication and negotiation of parameters that are critical to security and performance.


Rather than a strict layering, these two protocols cooperate: QUIC uses the TLS handshake; TLS uses the reliability, ordered delivery, and record layer provided by QUIC.


At a high level, there are two main interactions between the TLS and QUIC components:


* The TLS component sends and receives messages via the QUIC component, with QUIC providing a reliable stream abstraction to TLS.

* TLSコンポーネントは、QUICコンポーネントを介してメッセージを送受信し、信頼性の高いストリーム抽象化をTLSに提供します。

* The TLS component provides a series of updates to the QUIC component, including (a) new packet protection keys to install and (b) state changes such as handshake completion, the server certificate, etc.

* TLSコンポーネントは、(a)インストールする新しいパケット保護キーを含む、QUICコンポーネントに一連の更新を提供し、ハンドシェイクの完了、サーバー証明書などの状態の変化

Figure 4 shows these interactions in more detail, with the QUIC packet protection being called out specially.


   +------------+                               +------------+
   |            |<---- Handshake Messages ----->|            |
   |            |<- Validate 0-RTT Parameters ->|            |
   |            |<--------- 0-RTT Keys ---------|            |
   |    QUIC    |<------- Handshake Keys -------|    TLS     |
   |            |<--------- 1-RTT Keys ---------|            |
   |            |<------- Handshake Done -------|            |
   +------------+                               +------------+
    |         ^
    | Protect | Protected
    v         | Packet
   |   QUIC     |
   |  Packet    |
   | Protection |

Figure 4: QUIC and TLS Interactions


Unlike TLS over TCP, QUIC applications that want to send data do not send it using TLS Application Data records. Rather, they send it as QUIC STREAM frames or other frame types, which are then carried in QUIC packets.


4. Carrying TLS Messages
4. TLSメッセージを運ぶ

QUIC carries TLS handshake data in CRYPTO frames, each of which consists of a contiguous block of handshake data identified by an offset and length. Those frames are packaged into QUIC packets and encrypted under the current encryption level. As with TLS over TCP, once TLS handshake data has been delivered to QUIC, it is QUIC's responsibility to deliver it reliably. Each chunk of data that is produced by TLS is associated with the set of keys that TLS is currently using. If QUIC needs to retransmit that data, it MUST use the same keys even if TLS has already updated to newer keys.


Each encryption level corresponds to a packet number space. The packet number space that is used determines the semantics of frames. Some frames are prohibited in different packet number spaces; see Section 12.5 of [QUIC-TRANSPORT].


Because packets could be reordered on the wire, QUIC uses the packet type to indicate which keys were used to protect a given packet, as shown in Table 1. When packets of different types need to be sent, endpoints SHOULD use coalesced packets to send them in the same UDP datagram.


       | Packet Type         | Encryption Keys | PN Space         |
       | Initial             | Initial secrets | Initial          |
       | 0-RTT Protected     | 0-RTT           | Application data |
       | Handshake           | Handshake       | Handshake        |
       | Retry               | Retry           | N/A              |
       | Version Negotiation | N/A             | N/A              |
       | Short Header        | 1-RTT           | Application data |

Table 1: Encryption Keys by Packet Type


Section 17 of [QUIC-TRANSPORT] shows how packets at the various encryption levels fit into the handshake process.


4.1. Interface to TLS
4.1. TLSへのインタフェース

As shown in Figure 4, the interface from QUIC to TLS consists of four primary functions:


* Sending and receiving handshake messages

* ハンドシェイクメッセージの送受信

* Processing stored transport and application state from a resumed session and determining if it is valid to generate or accept 0-RTT data

* 再開セッションからストアドトランスポートとアプリケーションの状態を処理し、0-RTTデータを生成または受け入れることが有効であるかどうかを判断します。

* Rekeying (both transmit and receive)

* REKEING(送信と受信)

* Updating handshake state

* ハンドシェイク状態の更新

Additional functions might be needed to configure TLS. In particular, QUIC and TLS need to agree on which is responsible for validation of peer credentials, such as certificate validation [RFC5280].


4.1.1. Handshake Complete
4.1.1. ハンドシェイクを完了します

In this document, the TLS handshake is considered complete when the TLS stack has reported that the handshake is complete. This happens when the TLS stack has both sent a Finished message and verified the peer's Finished message. Verifying the peer's Finished message provides the endpoints with an assurance that previous handshake messages have not been modified. Note that the handshake does not complete at both endpoints simultaneously. Consequently, any requirement that is based on the completion of the handshake depends on the perspective of the endpoint in question.


4.1.2. Handshake Confirmed
4.1.2. 握手が確認されました

In this document, the TLS handshake is considered confirmed at the server when the handshake completes. The server MUST send a HANDSHAKE_DONE frame as soon as the handshake is complete. At the client, the handshake is considered confirmed when a HANDSHAKE_DONE frame is received.


Additionally, a client MAY consider the handshake to be confirmed when it receives an acknowledgment for a 1-RTT packet. This can be implemented by recording the lowest packet number sent with 1-RTT keys and comparing it to the Largest Acknowledged field in any received 1-RTT ACK frame: once the latter is greater than or equal to the former, the handshake is confirmed.

さらに、クライアントは、1-RTTパケットの確認応答を受け取ったときにハンドシェイクを確認することを検討することができます。これは、1-RTTキーで送信され、それを受信した1 RTT ACKフレームの最大の確認フィールドと比較してそれを比較することによって実装できます。後者が前者以上であると、ハンドシェイクが確認されます。

4.1.3. Sending and Receiving Handshake Messages
4.1.3. ハンドシェイクメッセージの送受信

In order to drive the handshake, TLS depends on being able to send and receive handshake messages. There are two basic functions on this interface: one where QUIC requests handshake messages and one where QUIC provides bytes that comprise handshake messages.


Before starting the handshake, QUIC provides TLS with the transport parameters (see Section 8.2) that it wishes to carry.


A QUIC client starts TLS by requesting TLS handshake bytes from TLS. The client acquires handshake bytes before sending its first packet. A QUIC server starts the process by providing TLS with the client's handshake bytes.


At any time, the TLS stack at an endpoint will have a current sending encryption level and a receiving encryption level. TLS encryption levels determine the QUIC packet type and keys that are used for protecting data.


Each encryption level is associated with a different sequence of bytes, which is reliably transmitted to the peer in CRYPTO frames. When TLS provides handshake bytes to be sent, they are appended to the handshake bytes for the current encryption level. The encryption level then determines the type of packet that the resulting CRYPTO frame is carried in; see Table 1.


Four encryption levels are used, producing keys for Initial, 0-RTT, Handshake, and 1-RTT packets. CRYPTO frames are carried in just three of these levels, omitting the 0-RTT level. These four levels correspond to three packet number spaces: Initial and Handshake encrypted packets use their own separate spaces; 0-RTT and 1-RTT packets use the application data packet number space.


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.


QUIC CRYPTO frames only carry TLS handshake messages. TLS alerts are turned into QUIC CONNECTION_CLOSE error codes; see Section 4.8. TLS application data and other content types cannot be carried by QUIC at any encryption level; it is an error if they are received from the TLS stack.

QUIC CryptoフレームはTLSハンドシェイクメッセージのみを伝送します。TLSアラートはQUIC接続_closeエラーコードに変わります。セクション4.8を参照してください。TLSアプリケーションデータおよび他のコンテンツタイプは、任意の暗号化レベルでQUICによって実行できません。TLSスタックから受信した場合はエラーです。

When an endpoint receives a QUIC packet containing a CRYPTO frame from the network, it proceeds as follows:


* If the packet uses the current TLS receiving encryption level, sequence 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. If the result of this process is that new data is available, then it is delivered to TLS in order.

* パケットが暗号化レベルを受信した現在のTLSを使用している場合は、通常のようにデータを入力フローにシーケンスします。ストリームフレームと同様に、オフセットはデータシーケンス内の適切な場所を見つけるために使用されます。このプロセスの結果が新しいデータが利用可能であることである場合、それは順番にTLSに配信されます。

* If the packet is from a previously installed encryption level, it MUST NOT contain data that extends past the end of previously received data in that flow. Implementations MUST treat any violations of this requirement as a connection error of type PROTOCOL_VIOLATION.

* パケットが以前にインストールされた暗号化レベルからのものである場合、そのフロー内の以前に受信したデータの終わりを経て拡張されたデータを含める必要はありません。実装は、この要求の違反をType Protocol_Violationの接続エラーとして扱う必要があります。

* If the packet is from a new encryption level, it is saved for later processing by TLS. Once TLS moves to receiving from this encryption level, saved data can be provided to TLS. When TLS provides keys for a higher encryption level, if there is data from a previous encryption level that TLS has not consumed, this MUST be treated as a connection error of type PROTOCOL_VIOLATION.

* パケットが新しい暗号化レベルからのものである場合は、後でTLSによる処理のために保存されます。TLSがこの暗号化レベルから受信に移動すると、保存されたデータをTLSに提供することができます。TLSがより高い暗号化レベルのキーを提供するとき、TLSが消費されていない以前の暗号化レベルからのデータがある場合、これはPROTOCOL_VIOLATION型の接続エラーとして扱う必要があります。

Each time that TLS is provided with new data, new handshake bytes are requested from TLS. TLS might not provide any bytes if the handshake messages it has received are incomplete or it has no data to send.


The content of CRYPTO frames might either be processed incrementally by TLS or buffered until complete messages or flights are available. TLS is responsible for buffering handshake bytes that have arrived in order. QUIC is responsible for buffering handshake bytes that arrive out of order or for encryption levels that are not yet ready. QUIC does not provide any means of flow control for CRYPTO frames; see Section 7.5 of [QUIC-TRANSPORT].


Once the TLS handshake is complete, this is indicated to QUIC along with any final handshake bytes that TLS needs to send. At this stage, the transport parameters that the peer advertised during the handshake are authenticated; see Section 8.2.


Once the handshake is complete, TLS becomes passive. TLS can still receive data from its peer and respond in kind, but it will not need to send more data unless specifically requested -- either by an application or QUIC. One reason to send data is that the server might wish to provide additional or updated session tickets to a client.

ハンドシェイクが完了すると、TLSは受動的になります。TLSは依然としてそのピアからデータを受け取ることができ、種類で応答することはできますが、特に要求されない限り、より多くのデータを送信する必要はありません - アプリケーションまたはQUICによって。データを送信する理由の1つは、サーバーが追加または更新されたセッションチケットをクライアントに提供したいと思うことです。

When the handshake is complete, QUIC only needs to provide TLS with any data that arrives in CRYPTO streams. In the same manner that is used during the handshake, new data is requested from TLS after providing received data.


4.1.4. Encryption Level Changes
4.1.4. 暗号化レベルの変更

As keys at a given encryption level become available to TLS, TLS indicates to QUIC that reading or writing keys at that encryption level are available.


The availability of new keys is always a result of providing inputs to TLS. TLS only provides new keys after being initialized (by a client) or when provided with new handshake data.


However, a TLS implementation could perform some of its processing asynchronously. In particular, the process of validating a certificate can take some time. While waiting for TLS processing to complete, an endpoint SHOULD buffer received packets if they might be processed using keys that are not yet available. These packets can be processed once keys are provided by TLS. An endpoint SHOULD continue to respond to packets that can be processed during this time.


After processing inputs, TLS might produce handshake bytes, keys for new encryption levels, or both.


TLS provides QUIC with three items as a new encryption level becomes available:


* A secret

* 秘密

* An Authenticated Encryption with Associated Data (AEAD) function

* 関連データ(AEAD)関数を持つ認証された暗号化

* A Key Derivation Function (KDF)

* 重要な派生機能(KDF)

These values are based on the values that TLS negotiates and are used by QUIC to generate packet and header protection keys; see Section 5 and Section 5.4.


If 0-RTT is possible, it is ready after the client sends a TLS ClientHello message or the server receives that message. After providing a QUIC client with the first handshake bytes, the TLS stack might signal the change to 0-RTT keys. On the server, after receiving handshake bytes that contain a ClientHello message, a TLS server might signal that 0-RTT keys are available.

0-RTTが可能な場合は、クライアントがTLS ClientHelloメッセージを送信した後、またはサーバーがそのメッセージを受信した後に準備ができます。最初のハンドシェイクバイトを使用してQUICクライアントを提供した後、TLSスタックは0-RTTキーへの変更をシグナリングできます。サーバー上で、ClientHelloメッセージを含むハンドシェイクバイトを受信した後、TLSサーバーが0-RTTキーを使用できます。

Although TLS only uses one encryption level at a time, QUIC may use more than one level. For instance, after sending its Finished message (using a CRYPTO frame at the Handshake encryption level) an endpoint can send STREAM data (in 1-RTT encryption). If the Finished message is lost, the endpoint uses the Handshake encryption level to retransmit the lost message. Reordering or loss of packets can mean that QUIC will need to handle packets at multiple encryption levels. During the handshake, this means potentially handling packets at higher and lower encryption levels than the current encryption level used by TLS.


In particular, server implementations need to be able to read packets at the Handshake encryption level at the same time as the 0-RTT encryption level. A client could interleave ACK frames that are protected with Handshake keys with 0-RTT data, and the server needs to process those acknowledgments in order to detect lost Handshake packets.

特に、サーバ実装は、0 - RTT暗号化レベルと同時にハンドシェイク暗号化レベルでパケットを読み取ることができる必要がある。クライアントは、ハンドシェイクキーで0-RTTデータで保護されているACKフレームをインターリーブでき、サーバーは失われたハンドシェイクパケットを検出するためにそれらの確認応答を処理する必要があります。

QUIC also needs access to keys that might not ordinarily be available to a TLS implementation. For instance, a client might need to acknowledge Handshake packets before it is ready to send CRYPTO frames at that encryption level. TLS therefore needs to provide keys to QUIC before it might produce them for its own use.


4.1.5. TLS Interface Summary
4.1.5. TLSインタフェースの概要

Figure 5 summarizes the exchange between QUIC and TLS for both client and server. Solid arrows indicate packets that carry handshake data; dashed arrows show where application data can be sent. Each arrow is tagged with the encryption level used for that transmission.


   Client                                                    Server
   ======                                                    ======
   Get Handshake
                        Initial ------------->
   Install tx 0-RTT keys
                        0-RTT - - - - - - - ->
                                                 Handshake Received
                                                      Get Handshake
                        <------------- Initial
                                              Install rx 0-RTT keys
                                             Install Handshake keys
                                                      Get Handshake
                        <----------- Handshake
                                              Install tx 1-RTT keys
                        <- - - - - - - - 1-RTT
   Handshake Received (Initial)
   Install Handshake keys
   Handshake Received (Handshake)
   Get Handshake
                        Handshake ----------->
   Handshake Complete
   Install 1-RTT keys
                        1-RTT - - - - - - - ->
                                                 Handshake Received
                                                 Handshake Complete
                                                Handshake Confirmed
                                              Install rx 1-RTT keys
                        <--------------- 1-RTT
   Handshake Confirmed

Figure 5: Interaction Summary between QUIC and TLS


Figure 5 shows the multiple packets that form a single "flight" of messages being processed individually, to show what incoming messages trigger different actions. This shows multiple "Get Handshake" invocations to retrieve handshake messages at different encryption levels. New handshake messages are requested after incoming packets have been processed.


Figure 5 shows one possible structure for a simple handshake exchange. The exact process varies based on the structure of endpoint implementations and the order in which packets arrive. Implementations could use a different number of operations or execute them in other orders.


4.2. TLS Version
4.2. TLSバージョン

This document describes how TLS 1.3 [TLS13] is used with QUIC.

この文書では、TLS 1.3 [TLS13]がQUICで使用される方法について説明します。

In practice, the TLS handshake will negotiate a version of TLS to use. This could result in a version of TLS newer than 1.3 being negotiated if both endpoints support that version. This is acceptable provided that the features of TLS 1.3 that are used by QUIC are supported by the newer version.

実際には、TLSハンドシェイクは使用するTLSのバージョンを交渉します。これにより、両方のエンドポイントがそのバージョンをサポートしている場合、これはNegotiated 1.3よりも新しいバージョンのTLSがネゴシエートされる可能性があります。これは、QUICによって使用されるTLS 1.3の機能が新しいバージョンによってサポートされていることが提供される。

Clients MUST NOT offer TLS versions older than 1.3. A badly configured TLS implementation could negotiate TLS 1.2 or another older version of TLS. An endpoint MUST terminate the connection if a version of TLS older than 1.3 is negotiated.

クライアントは1.3より古いTLSバージョンを提供してはいけません。ひどく設定されているTLS実装は、TLS 1.2または別の古いバージョンのTLSを交渉する可能性があります。1.3より古いTLSのバージョンがネゴシエートされている場合、エンドポイントは接続を終了する必要があります。

4.3. ClientHello Size
4.3. Clienthelloサイズ

The first Initial packet from a client contains the start or all of its first cryptographic handshake message, which for TLS is the ClientHello. Servers might need to parse the entire ClientHello (e.g., to access extensions such as Server Name Identification (SNI) or Application-Layer Protocol Negotiation (ALPN)) in order to decide whether to accept the new incoming QUIC connection. If the ClientHello spans multiple Initial packets, such servers would need to buffer the first received fragments, which could consume excessive resources if the client's address has not yet been validated. To avoid this, servers MAY use the Retry feature (see Section 8.1 of [QUIC-TRANSPORT]) to only buffer partial ClientHello messages from clients with a validated address.


QUIC packet and framing add at least 36 bytes of overhead to the ClientHello message. That overhead increases if the client chooses a Source Connection ID field longer than zero bytes. Overheads also do not include the token or a Destination Connection ID longer than 8 bytes, both of which might be required if a server sends a Retry packet.


A typical TLS ClientHello can easily fit into a 1200-byte packet. However, in addition to the overheads added by QUIC, there are several variables that could cause this limit to be exceeded. Large session tickets, multiple or large key shares, and long lists of supported ciphers, signature algorithms, versions, QUIC transport parameters, and other negotiable parameters and extensions could cause this message to grow.

典型的なTLS ClientHelloは、1200バイトのパケットに簡単に収まることができます。ただし、QUICによって追加されたオーバーヘッドに加えて、この制限を超える可能性がある変数がいくつかあります。大きなセッションチケット、複数または大鍵共有、およびサポートされている暗号化、署名アルゴリズム、バージョン、QUICトランスポートパラメータ、およびその他の交渉パラメータ、および拡張の長いリストは、このメッセージを拡大させる可能性があります。

For servers, in addition to connection IDs and tokens, the size of TLS session tickets can have an effect on a client's ability to connect efficiently. Minimizing the size of these values increases the probability that clients can use them and still fit their entire ClientHello message in their first Initial packet.


The TLS implementation does not need to ensure that the ClientHello is large enough to meet QUIC's requirements for datagrams that carry Initial packets; see Section 14.1 of [QUIC-TRANSPORT]. QUIC implementations use PADDING frames or packet coalescing to ensure that datagrams are large enough.


4.4. Peer Authentication
4.4. ピア認証

The requirements for authentication depend on the application protocol that is in use. TLS provides server authentication and permits the server to request client authentication.


A client MUST authenticate the identity of the server. This typically involves verification that the identity of the server is included in a certificate and that the certificate is issued by a trusted entity (see for example [RFC2818]).


Note: Where servers provide certificates for authentication, the size of the certificate chain can consume a large number of bytes. Controlling the size of certificate chains is critical to performance in QUIC as servers are limited to sending 3 bytes for every byte received prior to validating the client address; see Section 8.1 of [QUIC-TRANSPORT]. The size of a certificate chain can be managed by limiting the number of names or extensions; using keys with small public key representations, like ECDSA; or by using certificate compression [COMPRESS].

注:サーバーが認証用の証明書を提供する場合、証明書チェーンのサイズが多数のバイトを消費する可能性があります。 サーバーはクライアントアドレスを検証する前に受信したバイトごとに3バイトを送信するように制限されているため、証明書チェーンのサイズを制御することはQUICのパフォーマンスにとって重要です。 [QUIC-TRANSPORT]のセクション8.1を参照してください。 証明書チェーンのサイズは、名前または拡張子の数を制限することで管理できます。 ECDSAのような小さな公開鍵表現の鍵を使用する。 または、証明書圧縮[COMPRESS]を使用します。

A server MAY request that the client authenticate during the handshake. A server MAY refuse a connection if the client is unable to authenticate when requested. The requirements for client authentication vary based on application protocol and deployment.


A server MUST NOT use post-handshake client authentication (as defined in Section 4.6.2 of [TLS13]) because the multiplexing offered by QUIC prevents clients from correlating the certificate request with the application-level event that triggered it (see [HTTP2-TLS13]). More specifically, servers MUST NOT send post-handshake TLS CertificateRequest messages, and clients MUST treat receipt of such messages as a connection error of type PROTOCOL_VIOLATION.

QUICによって提供される多重化はクライアントが証明書要求をトリガーされたアプリケーションレベルのイベントとの関連付けを防止するため、サーバーは(TLS13]のセクション4.6.2で定義されているように)handshakeクライアント認証を使用してはいけません([TLS13])。TLS13])。具体的には、サーバーはハンドシェイクTLS CertificateQuestメッセージを送信してはならず、クライアントはPROTOCOL_VIOLATION型の接続エラーとしてそのようなメッセージの受信を扱う必要があります。

4.5. Session Resumption
4.5. セッションの再開

QUIC can use the session resumption feature of TLS 1.3. It does this by carrying NewSessionTicket messages in CRYPTO frames after the handshake is complete. Session resumption can be used to provide 0-RTT and can also be used when 0-RTT is disabled.

QUICはTLS 1.3のセッション再開機能を使用できます。ハンドシェイクが完了したら、NewSessionTicketメッセージをCryptoフレームに運ぶことによってこれを行います。セッション再開は0-RTTを提供するために使用でき、0-RTTが無効になっているときにも使用できます。

Endpoints that use session resumption might need to remember some information about the current connection when creating a resumed connection. TLS requires that some information be retained; see Section 4.6.1 of [TLS13]. QUIC itself does not depend on any state being retained when resuming a connection unless 0-RTT is also used; see Section 7.4.1 of [QUIC-TRANSPORT] and Section 4.6.1. Application protocols could depend on state that is retained between resumed connections.


Clients can store any state required for resumption along with the session ticket. Servers can use the session ticket to help carry state.


Session resumption allows servers to link activity on the original connection with the resumed connection, which might be a privacy issue for clients. Clients can choose not to enable resumption to avoid creating this correlation. Clients SHOULD NOT reuse tickets as that allows entities other than the server to correlate connections; see Appendix C.4 of [TLS13].


4.6. 0-RTT
4.6. 0-RTT

The 0-RTT feature in QUIC allows a client to send application data before the handshake is complete. This is made possible by reusing negotiated parameters from a previous connection. To enable this, 0-RTT depends on the client remembering critical parameters and providing the server with a TLS session ticket that allows the server to recover the same information.


This information includes parameters that determine TLS state, as governed by [TLS13], QUIC transport parameters, the chosen application protocol, and any information the application protocol might need; see Section 4.6.3. This information determines how 0-RTT packets and their contents are formed.


To ensure that the same information is available to both endpoints, all information used to establish 0-RTT comes from the same connection. Endpoints cannot selectively disregard information that might alter the sending or processing of 0-RTT.


[TLS13] sets a limit of seven days on the time between the original connection and any attempt to use 0-RTT. There are other constraints on 0-RTT usage, notably those caused by the potential exposure to replay attack; see Section 9.2.


4.6.1. Enabling 0-RTT
4.6.1. 0-RTTの有効化

The TLS early_data extension in the NewSessionTicket message is defined to convey (in the max_early_data_size parameter) the amount of TLS 0-RTT data the server is willing to accept. QUIC does not use TLS early data. QUIC uses 0-RTT packets to carry early data. Accordingly, the max_early_data_size parameter is repurposed to hold a sentinel value 0xffffffff to indicate that the server is willing to accept QUIC 0-RTT data. To indicate that the server does not accept 0-RTT data, the early_data extension is omitted from the NewSessionTicket. The amount of data that the client can send in QUIC 0-RTT is controlled by the initial_max_data transport parameter supplied by the server.

NewSessionTicketメッセージのTLS early_data拡張機能は、サーバーが受け入れるTLS0-RTTデータの量を(max_early_data_sizeパラメーターで)伝達するように定義されています。 QUICはTLS初期データを使用しません。 QUICは0-RTTパケットを使用して初期データを伝送します。 したがって、max_early_data_sizeパラメーターは、サーバーがQUIC 0-RTTデータを受け入れる意思があることを示すために、番兵値0xffffffffを保持するために再利用されます。 サーバーが0-RTTデータを受け入れないことを示すために、early_data拡張機能はNewSessionTicketから省略されています。 クライアントがQUIC0-RTTで送信できるデータの量は、サーバーによって提供されるinitial_max_dataトランスポートパラメーターによって制御されます。

Servers MUST NOT send the early_data extension with a max_early_data_size field set to any value other than 0xffffffff. A client MUST treat receipt of a NewSessionTicket that contains an early_data extension with any other value as a connection error of type PROTOCOL_VIOLATION.


A client that wishes to send 0-RTT packets uses the early_data extension in the ClientHello message of a subsequent handshake; see Section 4.2.10 of [TLS13]. It then sends application data in 0-RTT packets.


A client that attempts 0-RTT might also provide an address validation token if the server has sent a NEW_TOKEN frame; see Section 8.1 of [QUIC-TRANSPORT].


4.6.2. Accepting and Rejecting 0-RTT
4.6.2. 0-RTTを受け入れて拒否します

A server accepts 0-RTT by sending an early_data extension in the EncryptedExtensions; see Section 4.2.10 of [TLS13]. The server then processes and acknowledges the 0-RTT packets that it receives.


A server rejects 0-RTT by sending the EncryptedExtensions without an early_data extension. A server will always reject 0-RTT if it sends a TLS HelloRetryRequest. When rejecting 0-RTT, a server MUST NOT process any 0-RTT packets, even if it could. When 0-RTT was rejected, a client SHOULD treat receipt of an acknowledgment for a 0-RTT packet as a connection error of type PROTOCOL_VIOLATION, if it is able to detect the condition.

Eargy_Data拡張機能なしで暗号化されたextensionsを送信することによって、サーバーが0-RTTを拒否します。TLS HellORetryRequestを送信した場合、サーバーは常に0-RTTを拒否します。0-RTTを拒否すると、サーバーはそれができていても0-RTTパケットを処理してはいけません。0-RTTが拒否された場合、クライアントは、条件を検出することができる場合、PROTOCOL_VIOLATION型の接続エラーとして、0-RTTパケットの確認応答の受信を扱います。

When 0-RTT is rejected, all connection characteristics that the client assumed might be incorrect. This includes the choice of application protocol, transport parameters, and any application configuration. The client therefore MUST reset the state of all streams, including application state bound to those streams.


A client MAY reattempt 0-RTT if it receives a Retry or Version Negotiation packet. These packets do not signify rejection of 0-RTT.


4.6.3. Validating 0-RTT Configuration
4.6.3. 0-RTT構成の検証

When a server receives a ClientHello with the early_data extension, it has to decide whether to accept or reject 0-RTT data from the client. Some of this decision is made by the TLS stack (e.g., checking that the cipher suite being resumed was included in the ClientHello; see Section 4.2.10 of [TLS13]). Even when the TLS stack has no reason to reject 0-RTT data, the QUIC stack or the application protocol using QUIC might reject 0-RTT data because the configuration of the transport or application associated with the resumed session is not compatible with the server's current configuration.


QUIC requires additional transport state to be associated with a 0-RTT session ticket. One common way to implement this is using stateless session tickets and storing this state in the session ticket. Application protocols that use QUIC might have similar requirements regarding associating or storing state. This associated state is used for deciding whether 0-RTT data must be rejected. For example, HTTP/3 settings [QUIC-HTTP] determine how 0-RTT data from the client is interpreted. Other applications using QUIC could have different requirements for determining whether to accept or reject 0-RTT data.


4.7. HelloRetryRequest
4.7. HelloRetryRequest

The HelloRetryRequest message (see Section 4.1.4 of [TLS13]) can be used to request that a client provide new information, such as a key share, or to validate some characteristic of the client. From the perspective of QUIC, HelloRetryRequest is not differentiated from other cryptographic handshake messages that are carried in Initial packets. Although it is in principle possible to use this feature for address verification, QUIC implementations SHOULD instead use the Retry feature; see Section 8.1 of [QUIC-TRANSPORT].


4.8. TLS Errors
4.8. TLSエラー

If TLS experiences an error, it generates an appropriate alert as defined in Section 6 of [TLS13].


A TLS alert is converted into a QUIC connection error. The AlertDescription value is added to 0x0100 to produce a QUIC error code from the range reserved for CRYPTO_ERROR; see Section 20.1 of [QUIC-TRANSPORT]. The resulting value is sent in a QUIC CONNECTION_CLOSE frame of type 0x1c.

TLSアラートはQUIC接続エラーに変換されます。AlertDescriptionの値が0x0100に追加され、crypto_errorの範囲からQUICのエラーコードが生成されます。[QUIC-TRANSPORT]の20.1節を参照してください。結果の値は、0x1c型のquic connection_closeフレームで送信されます。

QUIC is only able to convey an alert level of "fatal". In TLS 1.3, the only existing uses for the "warning" level are to signal connection close; see Section 6.1 of [TLS13]. As QUIC provides alternative mechanisms for connection termination and the TLS connection is only closed if an error is encountered, a QUIC endpoint MUST treat any alert from TLS as if it were at the "fatal" level.

QUICは、「致命的」の警告レベルを伝えることしかできません。TLS 1.3では、「警告」レベルの唯一の既存の用途は接続を閉じることです。[TLS13]のセクション6.1を参照してください。QUICが接続終了のための代替メカニズムを提供し、TLS接続はエラーが発生した場合にのみ閉じているだけで、QUICのエンドポイントは、それが「致命的な」レベルにあるかのようにTLSからの警告を扱う必要があります。

QUIC permits the use of a generic code in place of a specific error code; see Section 11 of [QUIC-TRANSPORT]. For TLS alerts, this includes replacing any alert with a generic alert, such as handshake_failure (0x0128 in QUIC). Endpoints MAY use a generic error code to avoid possibly exposing confidential information.


4.9. Discarding Unused Keys
4.9. 未使用のキーの破棄

After QUIC has completed a move to a new encryption level, packet protection keys for previous encryption levels can be discarded. This occurs several times during the handshake, as well as when keys are updated; see Section 6.


Packet protection keys are not discarded immediately when new keys are available. If packets from a lower encryption level contain CRYPTO frames, frames that retransmit that data MUST be sent at the same encryption level. Similarly, an endpoint generates acknowledgments for packets at the same encryption level as the packet being acknowledged. Thus, it is possible that keys for a lower encryption level are needed for a short time after keys for a newer encryption level are available.


An endpoint cannot discard keys for a given encryption level unless it has received all the cryptographic handshake messages from its peer at that encryption level and its peer has done the same. Different methods for determining this are provided for Initial keys (Section 4.9.1) and Handshake keys (Section 4.9.2). These methods do not prevent packets from being received or sent at that encryption level because a peer might not have received all the acknowledgments necessary.


Though an endpoint might retain older keys, new data MUST be sent at the highest currently available encryption level. Only ACK frames and retransmissions of data in CRYPTO frames are sent at a previous encryption level. These packets MAY also include PADDING frames.


4.9.1. Discarding Initial Keys
4.9.1. 初期キーの破棄

Packets protected with Initial secrets (Section 5.2) are not authenticated, meaning that an attacker could spoof packets with the intent to disrupt a connection. To limit these attacks, Initial packet protection keys are discarded more aggressively than other keys.


The successful use of Handshake packets indicates that no more Initial packets need to be exchanged, as these keys can only be produced after receiving all CRYPTO frames from Initial packets. Thus, a client MUST discard Initial keys when it first sends a Handshake packet and a server MUST discard Initial keys when it first successfully processes a Handshake packet. Endpoints MUST NOT send Initial packets after this point.


This results in abandoning loss recovery state for the Initial encryption level and ignoring any outstanding Initial packets.


4.9.2. Discarding Handshake Keys
4.9.2. ハンドシェイクキーの破棄

An endpoint MUST discard its Handshake keys when the TLS handshake is confirmed (Section 4.1.2).


4.9.3. Discarding 0-RTT Keys
4.9.3. 0-RTTキーを破棄します

0-RTT and 1-RTT packets share the same packet number space, and clients do not send 0-RTT packets after sending a 1-RTT packet (Section 5.6).


Therefore, a client SHOULD discard 0-RTT keys as soon as it installs 1-RTT keys as they have no use after that moment.

したがって、クライアントは、その瞬間に使用しないように1 RTTキーをインストールするとすぐに0-RTTキーを破棄する必要があります。

Additionally, a server MAY discard 0-RTT keys as soon as it receives a 1-RTT packet. However, due to packet reordering, a 0-RTT packet could arrive after a 1-RTT packet. Servers MAY temporarily retain 0-RTT keys to allow decrypting reordered packets without requiring their contents to be retransmitted with 1-RTT keys. After receiving a 1-RTT packet, servers MUST discard 0-RTT keys within a short time; the RECOMMENDED time period is three times the Probe Timeout (PTO, see [QUIC-RECOVERY]). A server MAY discard 0-RTT keys earlier if it determines that it has received all 0-RTT packets, which can be done by keeping track of missing packet numbers.

さらに、サーバーは、1-RTTパケットを受信するとすぐに0-RTTキーを破棄することがあります。ただし、パケットの並べ替えのため、1 RTTパケットの後に0-RTTパケットが到着する可能性があります。サーバーは、1-RTTキーで内容を再送信することなく並べ替えされたパケットを復号化することを可能にするために一時的に0-RTTキーを保持することがあります。1-RTTパケットを受信した後、サーバーは短時間で0-RTTキーを破棄しなければなりません。推奨時間はプローブタイムアウトの3倍です(PTO、[QUIC回復]を参照)。Serverは、それがすべての0-RTTパケットを受信したと判断した場合に0-RTTキーを破棄します。これは、欠落しているパケット番号を追跡することによって実行できます。

5. Packet Protection
5. パケット保護

As with TLS over TCP, QUIC protects packets with keys derived from the TLS handshake, using the AEAD algorithm [AEAD] negotiated by TLS.


QUIC packets have varying protections depending on their type:


* Version Negotiation packets have no cryptographic protection.

* バージョンネゴシエーションパケットには暗号保護はありません。

* Retry packets use AEAD_AES_128_GCM to provide protection against accidental modification and to limit the entities that can produce a valid Retry; see Section 5.8.

* 再試行パケットは、AEAD_AES_128_GCMを使用して、偶発的な修正に対する保護を提供し、有効な再試行を生み出すことができるエンティティを制限することです。セクション5.8を参照してください。

* Initial packets use AEAD_AES_128_GCM with keys derived from the Destination Connection ID field of the first Initial packet sent by the client; see Section 5.2.

* 初期パケットは、クライアントによって送信された最初の初期パケットの宛先接続IDフィールドから派生したキーを持つAEAD_AES_128_GCMを使用します。セクション5.2を参照してください。

* All other packets have strong cryptographic protections for confidentiality and integrity, using keys and algorithms negotiated by TLS.

* 他のすべてのパケットは、TLSと交渉されたキーとアルゴリズムを使用して、機密性と整合性に対する強い暗号保護を持っています。

This section describes how packet protection is applied to Handshake packets, 0-RTT packets, and 1-RTT packets. The same packet protection process is applied to Initial packets. However, as it is trivial to determine the keys used for Initial packets, these packets are not considered to have confidentiality or integrity protection. Retry packets use a fixed key and so similarly lack confidentiality and integrity protection.


5.1. Packet Protection Keys
5.1. パケット保護キー

QUIC derives packet protection keys in the same way that TLS derives record protection keys.


Each encryption level has separate secret values for protection of packets sent in each direction. These traffic secrets are derived by TLS (see Section 7.1 of [TLS13]) and are used by QUIC for all 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 used for packet protection are computed from the TLS secrets using the KDF provided by TLS. In TLS 1.3, the HKDF-Expand-Label function described in Section 7.1 of [TLS13] is used with the hash function from the negotiated cipher suite. All uses of HKDF-Expand-Label in QUIC use a zero-length Context.

パケット保護に使用されるキーは、TLSによって提供されるKDFを使用してTLSシークレットから計算されます。 TLS 1.3では、[TLS13]のセクション7.1で説明されているHKDF-Expand-Label関数が、ネゴシエートされた暗号スイートのハッシュ関数とともに使用されます。 QUICでのHKDF-Expand-Labelのすべての使用は、長さがゼロのコンテキストを使用します。

Note that labels, which are described using strings, are encoded as bytes using ASCII [ASCII] without quotes or any trailing NUL byte.

文字列を使用して記述されているラベルは、引用符または末尾のNULバイトなしでASCII [ASCII]を使用してバイトとしてエンコードされています。

Other versions of TLS MUST provide a similar function in order to be used with QUIC.


The current encryption level secret and the label "quic key" are input to the KDF to produce the AEAD key; the label "quic iv" is used to derive the Initialization Vector (IV); see Section 5.3. The header protection key uses the "quic hp" label; see Section 5.4. Using these labels provides key separation between QUIC and TLS; see Section 9.6.

現在の暗号化レベルの秘密とラベル「quic key」がKDFに入力され、AEADキーが生成されます。ラベル「quic iv」は、初期化ベクトル(IV)を導出するために使用される。セクション5.3を参照してください。ヘッダ保護キーは「quic hp」ラベルを使用します。セクション5.4を参照してください。これらのラベルを使用すると、QUICとTLSの間のキー間隔があります。セクション9.6を参照してください。

Both "quic key" and "quic hp" are used to produce keys, so the Length provided to HKDF-Expand-Label along with these labels is determined by the size of keys in the AEAD or header protection algorithm. The Length provided with "quic iv" is the minimum length of the AEAD nonce or 8 bytes if that is larger; see [AEAD].

「quic key」と「quic hp」の両方がキーを生成するために使用されるので、これらのラベルと共にHKDF展開ラベルに供給される長さは、AEADまたはヘッダ保護アルゴリズム内のキーのサイズによって決定される。「quic iv」で提供される長さは、それが大きい場合、AEAD nonceまたは8バイトの最小長です。[AEAD]を参照してください。

The KDF used for initial secrets is always the HKDF-Expand-Label function from TLS 1.3; see Section 5.2.

最初の秘密に使用されるKDFは常にTLS 1.3からのHKDF展開ラベル関数です。セクション5.2を参照してください。

5.2. Initial Secrets
5.2. 初期の秘密

Initial packets apply the packet protection process, but use a secret derived from the Destination Connection ID field from the client's first Initial packet.


This secret is determined by using HKDF-Extract (see Section 2.2 of [HKDF]) with a salt of 0x38762cf7f55934b34d179ae6a4c80cadccbb7f0a and the input keying material (IKM) of the Destination Connection ID field. This produces an intermediate pseudorandom key (PRK) that is used to derive two separate secrets for sending and receiving.


The secret used by clients to construct Initial packets uses the PRK and the label "client in" as input to the HKDF-Expand-Label function from TLS [TLS13] to produce a 32-byte secret. Packets constructed by the server use the same process with the label "server in". The hash function for HKDF when deriving initial secrets and keys is SHA-256 [SHA].

初期パケットを構築するためにクライアントが使用する秘密は、TLS [TLS13]からのHKDF-Expand-Label関数への入力としてPRKとラベル「client in」を使用して32バイトの秘密を生成します。サーバーによって構築されたパケットは、ラベル「server in」と同じプロセスを使用します。初期秘密と鍵を導出するときのHKDFのハッシュ関数はSHA-256 [SHA]です。

This process in pseudocode is:


   initial_salt = 0x38762cf7f55934b34d179ae6a4c80cadccbb7f0a
   initial_secret = HKDF-Extract(initial_salt,

   client_initial_secret = HKDF-Expand-Label(initial_secret,
                                             "client in", "",
   server_initial_secret = HKDF-Expand-Label(initial_secret,
                                             "server in", "",

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.


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 recognizes only one version of QUIC from seeing or modifying the contents of packets from future versions.


The HKDF-Expand-Label function defined in TLS 1.3 MUST be used for Initial packets even where the TLS versions offered do not include TLS 1.3.

TLS 1.3で定義されているHKDF-Expand-Label関数は、提供されているTLSバージョンにTLS 1.3を含まない場合でも、初期パケットに使用する必要があります。

The secrets used for constructing subsequent Initial packets change when a server sends a Retry packet to use the connection ID value selected by the server. The secrets do not change when a client changes the Destination Connection ID it uses in response to an Initial packet from the server.


Note: The Destination Connection ID field could be any length up to 20 bytes, including zero length if the server sends a Retry packet with a zero-length Source Connection ID field. After a Retry, the Initial keys provide the client no assurance that the server received its packet, so the client has to rely on the exchange that included the Retry packet to validate the server address; see Section 8.1 of [QUIC-TRANSPORT].

注:宛先接続IDフィールドは、サーバーが長さゼロの送信元接続IDフィールドで再試行パケットを送信する場合の長さゼロを含め、最大20バイトの任意の長さにすることができます。 再試行後、初期キーはサーバーがパケットを受信したことをクライアントに保証しないため、クライアントはサーバーアドレスを検証するために再試行パケットを含む交換に依存する必要があります。 [QUIC-TRANSPORT]のセクション8.1を参照してください。

Appendix A contains sample Initial packets.


5.3. AEAD Usage
5.3. AEADの使用

The Authenticated Encryption with Associated Data (AEAD) function (see [AEAD]) used for QUIC packet protection is the AEAD that is negotiated for use with the TLS connection. For example, if TLS is using the TLS_AES_128_GCM_SHA256 cipher suite, the AEAD_AES_128_GCM function is used.


QUIC can use any of the cipher suites defined in [TLS13] with the exception of TLS_AES_128_CCM_8_SHA256. A cipher suite MUST NOT be negotiated unless a header protection scheme is defined for the cipher suite. This document defines a header protection scheme for all cipher suites defined in [TLS13] aside from TLS_AES_128_CCM_8_SHA256. These cipher suites have a 16-byte authentication tag and produce an output 16 bytes larger than their input.


An endpoint MUST NOT reject a ClientHello that offers a cipher suite that it does not support, or it would be impossible to deploy a new cipher suite. This also applies to TLS_AES_128_CCM_8_SHA256.


When constructing packets, the AEAD function is applied prior to applying header protection; see Section 5.4. The unprotected packet header is part of the associated data (A). When processing packets, an endpoint first removes the header protection.


The key and IV for the packet are computed as described in Section 5.1. The nonce, N, is formed by combining the packet protection IV with the packet number. The 62 bits of the reconstructed QUIC packet number in network byte order are left-padded with zeros to the size of the IV. The exclusive OR of the padded packet number and the IV forms the AEAD nonce.


The associated data, A, for the AEAD is the contents of the QUIC header, starting from the first byte of either the short or long header, up to and including the unprotected packet number.


The input plaintext, P, for the AEAD is the payload of the QUIC packet, as described in [QUIC-TRANSPORT].


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 under the same key and IV; see Section 6.6. This might 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 that is in use.


5.4. Header Protection
5.4. ヘッダー保護

Parts of QUIC packet headers, in particular the Packet Number field, are protected using a key that is derived separately from the packet protection key and IV. The key derived using the "quic hp" label is used to provide confidentiality protection for those fields that are not exposed to on-path elements.

QUICのパケットヘッダー、特にパケット番号フィールドの一部は、パケット保護キーとIVとは別に導出されたキーを使用して保護されています。「quic hp」ラベルを使用して導出されたキーは、オンパス要素にさらされていないフィールドの機密保護を提供するために使用されます。

This protection applies to the least significant bits of the first byte, plus the Packet Number field. The four least significant bits of the first byte are protected for packets with long headers; the five least significant bits of the first byte are protected for packets with short headers. For both header forms, this covers the reserved bits and the Packet Number Length field; the Key Phase bit is also protected for packets with a short header.


The same header protection key is used for the duration of the connection, with the value not changing after a key update (see Section 6). This allows header protection to be used to protect the key phase.


This process does not apply to Retry or Version Negotiation packets, which do not contain a protected payload or any of the fields that are protected by this process.


5.4.1. Header Protection Application
5.4.1. ヘッダー保護アプリケーション

Header protection is applied after packet protection is applied (see Section 5.3). The ciphertext of the packet is sampled and used as input to an encryption algorithm. The algorithm used depends on the negotiated AEAD.


The output of this algorithm is a 5-byte mask that is applied to the protected header fields using exclusive OR. The least significant bits of the first byte of the packet are masked by the least significant bits of the first mask byte, and the packet number is masked with the remaining bytes. Any unused bytes of mask that might result from a shorter packet number encoding are unused.


Figure 6 shows a sample algorithm for applying header protection. Removing header protection only differs in the order in which the packet number length (pn_length) is determined (here "^" is used to represent exclusive OR).


   mask = header_protection(hp_key, sample)

   pn_length = (packet[0] & 0x03) + 1
   if (packet[0] & 0x80) == 0x80:
      # Long header: 4 bits masked
      packet[0] ^= mask[0] & 0x0f
      # Short header: 5 bits masked
      packet[0] ^= mask[0] & 0x1f

   # pn_offset is the start of the Packet Number field.
   packet[pn_offset:pn_offset+pn_length] ^= mask[1:1+pn_length]

Figure 6: Header Protection Pseudocode


Specific header protection functions are defined based on the selected cipher suite; see Section 5.4.3 and Section 5.4.4.


Figure 7 shows an example long header packet (Initial) and a short header packet (1-RTT). Figure 7 shows the fields in each header that are covered by header protection and the portion of the protected packet payload that is sampled.

図7は、ロングヘッダパケットの例(初期)と短いヘッダパケット(1 - RTT)を示しています。図7は、ヘッダ保護によってカバーされている各ヘッダのフィールドとサンプリングされた保護されたパケットペイロードの部分を示しています。

   Initial Packet {
     Header Form (1) = 1,
     Fixed Bit (1) = 1,
     Long Packet Type (2) = 0,
     Reserved Bits (2),         # Protected
     Packet Number Length (2),  # Protected
     Version (32),
     DCID Len (8),
     Destination Connection ID (0..160),
     SCID Len (8),
     Source Connection ID (0..160),
     Token Length (i),
     Token (..),
     Length (i),
     Packet Number (8..32),     # Protected
     Protected Payload (0..24), # Skipped Part
     Protected Payload (128),   # Sampled Part
     Protected Payload (..)     # Remainder
   1-RTT Packet {
     Header Form (1) = 0,
     Fixed Bit (1) = 1,
     Spin Bit (1),
     Reserved Bits (2),         # Protected
     Key Phase (1),             # Protected
     Packet Number Length (2),  # Protected
     Destination Connection ID (0..160),
     Packet Number (8..32),     # Protected
     Protected Payload (0..24), # Skipped Part
     Protected Payload (128),   # Sampled Part
     Protected Payload (..),    # Remainder

Figure 7: Header Protection and Ciphertext Sample


Before a TLS cipher suite can be used with QUIC, a header protection algorithm MUST be specified for the AEAD used with that cipher suite. This document defines algorithms for AEAD_AES_128_GCM, AEAD_AES_128_CCM, AEAD_AES_256_GCM (all these AES AEADs are defined in [AEAD]), and AEAD_CHACHA20_POLY1305 (defined in [CHACHA]). Prior to TLS selecting a cipher suite, AES header protection is used (Section 5.4.3), matching the AEAD_AES_128_GCM packet protection.

TLS暗号スイートをQUICで使用する前に、その暗号スイートで使用されるAEADにヘッダー保護アルゴリズムを指定する必要があります。このドキュメントでは、AEAD_AES_128_GCM、AEAD_AES_128_CCM、AEAD_AES_256_GCMのアルゴリズムを定義します(これらすべてのAES AEADsは[AEAD]で定義されています)、AEAD_CHACHA20_POLY1305([Chacha]で定義されています)。TLSの前に暗号スイートを選択する前に、AESヘッダー保護(セクション5.4.3)、AEAD_AES_128_GCMパケット保護と一致します。

5.4.2. Header Protection Sample
5.4.2. ヘッダー保護のサンプル

The header protection algorithm uses both the header protection key and a sample of the ciphertext from the packet Payload field.


The same number of bytes are always sampled, but an allowance needs to be made for the removal of protection by a receiving endpoint, which will not know the length of the Packet Number field. The sample of ciphertext is taken starting from an offset of 4 bytes after the start of the Packet Number field. That is, in sampling packet ciphertext for header protection, the Packet Number field is assumed to be 4 bytes long (its maximum possible encoded length).


An endpoint MUST discard packets that are not long enough to contain a complete sample.


To ensure that sufficient data is available for sampling, packets are padded so that the combined lengths of the encoded packet number and protected payload is at least 4 bytes longer than the sample required for header protection. The cipher suites defined in [TLS13] -- other than TLS_AES_128_CCM_8_SHA256, for which a header protection scheme is not defined in this document -- have 16-byte expansions and 16-byte header protection samples. This results in needing at least 3 bytes of frames in the unprotected payload if the packet number is encoded on a single byte, or 2 bytes of frames for a 2-byte packet number encoding.

サンプリングに十分なデータが利用可能であることを確認するために、符号化されたパケット番号と保護されたペイロードの合成された長さが、ヘッダ保護に必要なサンプルより4バイト以上になるようにパケットが埋め込まれます。[TLS13]で定義された暗号スイート - TLS_AES_128_CCM_8_SHA256以外に、ヘッダー保護方式はこのドキュメントに定義されていない - 16バイトの拡張と16バイトのヘッダー保護サンプルがあります。これにより、パケット番号が1バイト、または2バイトのパケット番号エンコードに対して2バイトのフレームでエンコードされている場合、保護されていないペイロード内の少なくとも3バイトのフレームが必要となる。

The sampled ciphertext can be determined by the following pseudocode:


   # pn_offset is the start of the Packet Number field.
   sample_offset = pn_offset + 4

   sample = packet[sample_offset..sample_offset+sample_length]

Where the packet number offset of a short header packet can be calculated as:


   pn_offset = 1 + len(connection_id)

And the packet number offset of a long header packet can be calculated as:


   pn_offset = 7 + len(destination_connection_id) +
                   len(source_connection_id) +
   if packet_type == Initial:
       pn_offset += len(token_length) +

For example, for a packet with a short header, an 8-byte connection ID, and protected with AEAD_AES_128_GCM, the sample takes bytes 13 to 28 inclusive (using zero-based indexing).


Multiple QUIC packets might be included in the same UDP datagram. Each packet is handled separately.


5.4.3. AES-Based Header Protection
5.4.3. AESベースのヘッダー保護

This section defines the packet protection algorithm for AEAD_AES_128_GCM, AEAD_AES_128_CCM, and AEAD_AES_256_GCM. AEAD_AES_128_GCM and AEAD_AES_128_CCM use 128-bit AES in Electronic Codebook (ECB) mode. AEAD_AES_256_GCM uses 256-bit AES in ECB mode. AES is defined in [AES].


This algorithm samples 16 bytes from the packet ciphertext. This value is used as the input to AES-ECB. In pseudocode, the header protection function is defined as:


   header_protection(hp_key, sample):
     mask = AES-ECB(hp_key, sample)
5.4.4. ChaCha20-Based Header Protection
5.4.4. Chacha20ベースのヘッダー保護

When AEAD_CHACHA20_POLY1305 is in use, header protection uses the raw ChaCha20 function as defined in Section 2.4 of [CHACHA]. This uses a 256-bit key and 16 bytes sampled from the packet protection output.


The first 4 bytes of the sampled ciphertext are the block counter. A ChaCha20 implementation could take a 32-bit integer in place of a byte sequence, in which case, the byte sequence is interpreted as a little-endian value.


The remaining 12 bytes are used as the nonce. A ChaCha20 implementation might take an array of three 32-bit integers in place of a byte sequence, in which case, the nonce bytes are interpreted as a sequence of 32-bit little-endian integers.


The encryption mask is produced by invoking ChaCha20 to protect 5 zero bytes. In pseudocode, the header protection function is defined as:


   header_protection(hp_key, sample):
     counter = sample[0..3]
     nonce = sample[4..15]
     mask = ChaCha20(hp_key, counter, nonce, {0,0,0,0,0})
5.5. Receiving Protected Packets
5.5. 保護されたパケットの受信

Once an endpoint successfully receives a packet with a given packet number, it MUST discard all packets in the same packet number space with higher packet numbers if they cannot be successfully unprotected with either the same key, or -- if there is a key update -- a subsequent packet protection key; see Section 6. Similarly, a packet that appears to trigger a key update but cannot be unprotected successfully MUST be discarded.


Failure to unprotect a packet does not necessarily indicate the 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 decoded incorrectly if they are delayed significantly.


5.6. Use of 0-RTT Keys
5.6. 0-RTTキーの使用

If 0-RTT keys are available (see Section 4.6.1), the lack of replay protection means that restrictions on their use are necessary to avoid replay attacks on the protocol.


Of the frames defined in [QUIC-TRANSPORT], the STREAM, RESET_STREAM, STOP_SENDING, and CONNECTION_CLOSE frames are potentially unsafe for use with 0-RTT as they carry application data. Application data that is received in 0-RTT could cause an application at the server to process the data multiple times rather than just once. Additional actions taken by a server as a result of processing replayed application data could have unwanted consequences. A client therefore MUST NOT use 0-RTT for application data unless specifically requested by the application that is in use.


An application protocol that uses QUIC MUST include a profile that defines acceptable use of 0-RTT; otherwise, 0-RTT can only be used to carry QUIC frames that do not carry application data. For example, a profile for HTTP is described in [HTTP-REPLAY] and used for HTTP/3; see Section 10.9 of [QUIC-HTTP].


Though replaying packets might result in additional connection attempts, the effect of processing replayed frames that do not carry application data is limited to changing the state of the affected connection. A TLS handshake cannot be successfully completed using replayed packets.


A client MAY wish to apply additional restrictions on what data it sends prior to the completion of the TLS handshake.


A client otherwise treats 0-RTT keys as equivalent to 1-RTT keys, except that it cannot send certain frames with 0-RTT keys; see Section 12.5 of [QUIC-TRANSPORT].


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 server's handshake messages. A client SHOULD stop sending 0-RTT data 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 keys to protect acknowledgments of 0-RTT packets. A client MUST NOT attempt to decrypt 0-RTT packets it receives and instead MUST discard them.


Once a client has installed 1-RTT keys, it MUST NOT send any more 0-RTT packets.


Note: 0-RTT data can be acknowledged by the server as it receives it, but any packets containing acknowledgments of 0-RTT data cannot have packet protection removed by the client until the TLS handshake is complete. The 1-RTT keys necessary to remove packet protection cannot be derived until the client receives all server handshake messages.

注:0-RTTデータは、サーバーが受信したときに確認応答できますが、0-RTTデータの確認応答を含むパケットは、TLSハンドシェイクが完了するまで、クライアントがパケット保護を削除することはできません。 パケット保護を削除するために必要な1-RTTキーは、クライアントがすべてのサーバーハンドシェイクメッセージを受信するまで取得できません。

5.7. Receiving Out-of-Order Protected Packets
5.7. 異常な保護パケットの受信

Due to reordering and loss, protected packets might be received by an endpoint before the final TLS handshake messages are received. A 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 client. Endpoints in either role MUST NOT decrypt 1-RTT packets from their peer prior to completing the handshake.

並べ替えや損失のため、最後のTLSハンドシェイクメッセージが受信される前に、保護されたパケットがエンドポイントによって受信される可能性があります。クライアントはサーバーから1-RTTパケットを復号化できませんが、サーバーはクライアントから1-RTTパケットを復号化できます。どちらの役割のエンドポイントも、ハンドシェイクを完了する前に、ピアから1 RTTパケットを復号化してはいけません。

Even though 1-RTT keys are available to a server after receiving the first handshake messages from a client, it is missing assurances on the client state:


* The client is not authenticated, unless the server has chosen to use a pre-shared key and validated the client's pre-shared key binder; see Section 4.2.11 of [TLS13].

* サーバーが事前共有キーを使用してクライアントの事前共有キーバインダーを検証した場合を除き、クライアントは認証されません。[TLS13]の4.2.11節を参照してください。

* The client has not demonstrated liveness, unless the server has validated the client's address with a Retry packet or other means; see Section 8.1 of [QUIC-TRANSPORT].

* サーバーがリトライパケットまたは他の手段を使用してクライアントのアドレスを検証していない限り、クライアントは活性を示していません。[QUIC-TRANSPORT]のセクション8.1を参照してください。

* Any received 0-RTT data that the server responds to might be due to a replay attack.

* サーバーが応答する受信された0-RTTデータは、再生攻撃によるものです。

Therefore, the server's use of 1-RTT keys before the handshake is complete is limited to sending data. A server MUST NOT process incoming 1-RTT protected packets before the TLS handshake is complete. Because sending acknowledgments indicates that all frames in a packet have been processed, a server cannot send acknowledgments for 1-RTT packets until the TLS handshake is complete. Received packets protected with 1-RTT keys MAY be stored and later decrypted and used once the handshake is complete.

したがって、ハンドシェイクが完成する前の1-RTTキーのサーバーの使用はデータの送信に制限されています。TLSハンドシェイクが完了する前に、サーバーは着信1-RTT保護パケットを処理してはなりません。送信確認応答は、パケット内のすべてのフレームが処理されたことを示し、サーバーはTLSハンドシェイクが完了するまで1 RTTパケットに対して確認応答を送信できません。1-RTTキーで保護された受信パケットは、ハンドシェイクが完了すると、保存され、後で復号化され、使用されます。

Note: TLS implementations might provide all 1-RTT secrets prior to handshake completion. Even where QUIC implementations have 1-RTT read keys, those keys are not to be used prior to completing the handshake.

注:TLS実装は、ハンドシェイクが完了する前にすべての1-RTTシークレットを提供する場合があります。 QUIC実装に1-RTT読み取りキーがある場合でも、ハンドシェイクを完了する前にそれらのキーを使用することはできません。

The requirement for the server to wait for the client Finished message creates a dependency on that message being delivered. A client can avoid the potential for head-of-line blocking that this implies by sending its 1-RTT packets coalesced with a Handshake packet containing a copy of the CRYPTO frame that carries the Finished message, until one of the Handshake packets is acknowledged. This enables immediate server processing for those packets.

クライアントが完了したメッセージが完了したメッセージを待つサーバーの要件は、そのメッセージが配信されているそのメッセージに依存します。クライアントは、これが完成したメッセージを搭載したCryptoフレームのコピーを含むハンドシェイクパケットと合成したその1 RTTパケットを承認するまで、これがその1-RTTパケットを送信することによって暗証率ブロックの可能性を避けることができる。これにより、それらのパケットに対して即時のサーバー処理が可能になります。

A server could receive packets protected with 0-RTT keys prior to receiving a TLS ClientHello. The server MAY retain these packets for later decryption in anticipation of receiving a ClientHello.

サーバーは、TLS ClientHelloを受信する前に、0-RTTキーで保護されているパケットを受信できます。サーバは、ClientHelloを受信することを見越して後の復号化のためにこれらのパケットを保持することができる。

A client generally receives 1-RTT keys at the same time as the handshake completes. Even if it has 1-RTT secrets, a client MUST NOT process incoming 1-RTT protected packets before the TLS handshake is complete.


5.8. Retry Packet Integrity
5.8. リトライパケットの完全性

Retry packets (see Section 17.2.5 of [QUIC-TRANSPORT]) carry a Retry Integrity Tag that provides two properties: it allows the discarding of packets that have accidentally been corrupted by the network, and only an entity that observes an Initial packet can send a valid Retry packet.


The Retry Integrity Tag is a 128-bit field that is computed as the output of AEAD_AES_128_GCM [AEAD] used with the following inputs:

Retry Integrityタグは、次の入力で使用されているAEAD_AES_128_GCM [AEAD]の出力として計算される128ビットフィールドです。

* The secret key, K, is 128 bits equal to 0xbe0c690b9f66575a1d766b54e368c84e.

* 秘密鍵 K は、0xbe0c690b9f66575a1d766b54e368c84e の128ビットです。

* The nonce, N, is 96 bits equal to 0x461599d35d632bf2239825bb.

* ナンス N は、0x461599d35d632bf2239825bb の96ビットです。

* The plaintext, P, is empty.

* 平文 P は空文字です。

* The associated data, A, is the contents of the Retry Pseudo-Packet, as illustrated in Figure 8:

* 関連データ A は、図8に示すように、再試行疑似パケットの内容です。

The secret key and the nonce are values derived by calling HKDF-Expand-Label using 0xd9c9943e6101fd200021506bcc02814c73030f25c79d71ce876eca876e6fca8e as the secret, with labels being "quic key" and "quic iv" (Section 5.1).

秘密鍵とNonceは、0xd9c9943e6101fd200021506bcc02814c73030f25c79d71ce876eca876e6fca8e を使ってHKDF-Expand-Labelで導出した秘密で、ラベルは「quic key」と「quic iv」(セクション5.1)です。

   Retry Pseudo-Packet {
     ODCID Length (8),
     Original Destination Connection ID (0..160),
     Header Form (1) = 1,
     Fixed Bit (1) = 1,
     Long Packet Type (2) = 3,
     Unused (4),
     Version (32),
     DCID Len (8),
     Destination Connection ID (0..160),
     SCID Len (8),
     Source Connection ID (0..160),
     Retry Token (..),

Figure 8: Retry Pseudo-Packet


The Retry Pseudo-Packet is not sent over the wire. It is computed by taking the transmitted Retry packet, removing the Retry Integrity Tag, and prepending the two following fields:

リトライ疑似パケットはワイヤー上には送信されません。送信された再試行パケットを取得し、Retry Integrityタグを削除し、次の2つのフィールドを付加することによって計算されます。

ODCID Length: The ODCID Length field contains the length in bytes of the Original Destination Connection ID field that follows it, encoded as an 8-bit unsigned integer.


Original Destination Connection ID: The Original Destination Connection ID contains the value of the Destination Connection ID from the Initial packet that this Retry is in response to. The length of this field is given in ODCID Length. The presence of this field ensures that a valid Retry packet can only be sent by an entity that observes the Initial packet.


6. Key Update
6. キーアップデート

Once the handshake is confirmed (see Section 4.1.2), an endpoint MAY initiate a key update.


The Key Phase bit indicates which packet protection keys are used to protect the packet. The Key Phase bit is initially set to 0 for the first set of 1-RTT packets and toggled to signal each subsequent key update.


The Key Phase bit allows a recipient to detect a change in keying material without needing to receive the first packet that triggered the change. An endpoint that notices a changed Key Phase bit updates keys and decrypts the packet that contains the changed value.


Initiating a key update results in both endpoints updating keys. This differs from TLS where endpoints can update keys independently.


This mechanism replaces the key update mechanism of TLS, which relies on KeyUpdate messages sent using 1-RTT encryption keys. Endpoints MUST NOT send a TLS KeyUpdate message. Endpoints MUST treat the receipt of a TLS KeyUpdate message as a connection error of type 0x010a, equivalent to a fatal TLS alert of unexpected_message; see Section 4.8.

このメカニズムは、1-RTT暗号化キーを使用して送信されたKeyUpdateメッセージに依存するTLSのキーアップデートメカニズムを置き換えます。エンドポイントはTLS KeyUpdateメッセージを送信してはいけません。エンドポイントは、TLS keyUpdateメッセージの受信をTLS 0x010Aの接続エラーとして扱う必要があります。セクション4.8を参照してください。

Figure 9 shows a key update process, where the initial set of keys used (identified with @M) are replaced by updated keys (identified with @N). The value of the Key Phase bit is indicated in brackets [].


      Initiating Peer                    Responding Peer

   @M [0] QUIC Packets

   ... Update to @N
   @N [1] QUIC Packets
                                            Update to @N ...
                                         QUIC Packets [1] @N
                                         QUIC Packets [1] @N
                                       containing ACK
   ... Key Update Permitted
   @N [1] QUIC Packets
            containing ACK for @N packets
                                    Key Update Permitted ...

Figure 9: Key Update


6.1. Initiating a Key Update
6.1. キーアップデートを開始します

Endpoints maintain separate read and write secrets for packet protection. An endpoint initiates a key update by updating its packet protection write secret and using that to protect new packets. The endpoint creates a new write secret from the existing write secret as performed in Section 7.2 of [TLS13]. This uses the KDF function provided by TLS with a label of "quic ku". The corresponding key and IV are created from that secret as defined in Section 5.1. The header protection key is not updated.

エンドポイントは、パケット保護のための個別の読み書き秘密を維持します。エンドポイントは、パケット保護の書き込み秘密を更新し、新しいパケットを保護するためにそれを使用してキーアップデートを開始します。エンドポイントは、[TLS13]のセクション7.2で実行された既存の書き込み秘密から新しい書き込み秘密を作成します。これは、TLSによって提供されるKDF関数を「QUIC KU」のラベルを使用します。対応するキーとIVは、セクション5.1で定義されているようにその秘密から作成されます。ヘッダー保護キーは更新されません。

For example, to update write keys with TLS 1.3, HKDF-Expand-Label is used as:

たとえば、TLS 1.3で書き込みキーを更新するには、HKDF-Expand-Labelが次のように使用されます。

   secret_<n+1> = HKDF-Expand-Label(secret_<n>, "quic ku",
                                    "", Hash.length)

The endpoint toggles the value of the Key Phase bit and uses the updated key and IV to protect all subsequent packets.


An endpoint MUST NOT initiate a key update prior to having confirmed the handshake (Section 4.1.2). An endpoint MUST NOT initiate a subsequent key update unless it has received an acknowledgment for a packet that was sent protected with keys from the current key phase. This ensures that keys are available to both peers before another key update can be initiated. This can be implemented by tracking the lowest packet number sent with each key phase and the highest acknowledged packet number in the 1-RTT space: once the latter is higher than or equal to the former, another key update can be initiated.


Note: Keys of packets other than the 1-RTT packets are never updated; their keys are derived solely from the TLS handshake state.

注:1-RTTパケット以外のパケットのキーは更新されません。 それらのキーは、TLSハンドシェイク状態からのみ派生します。

The endpoint that initiates a key update also updates the keys that it uses for receiving packets. These keys will be needed to process packets the peer sends after updating.


An endpoint MUST retain old keys until it has successfully unprotected a packet sent using the new keys. An endpoint SHOULD retain old keys for some time after unprotecting a packet sent using the new keys. Discarding old keys too early can cause delayed packets to be discarded. Discarding packets will be interpreted as packet loss by the peer and could adversely affect performance.


6.2. Responding to a Key Update
6.2. キーアップデートへの応答

A peer is permitted to initiate a key update after receiving an acknowledgment of a packet in the current key phase. An endpoint detects a key update when processing a packet with a key phase that differs from the value used to protect the last packet it sent. To process this packet, the endpoint uses the next packet protection key and IV. See Section 6.3 for considerations about generating these keys.


If a packet is successfully processed using the next key and IV, then the peer has initiated a key update. The endpoint MUST update its send keys to the corresponding key phase in response, as described in Section 6.1. Sending keys MUST be updated before sending an acknowledgment for the packet that was received with updated keys. By acknowledging the packet that triggered the key update in a packet protected with the updated keys, the endpoint signals that the key update is complete.


An endpoint can defer sending the packet or acknowledgment according to its normal packet sending behavior; it is not necessary to immediately generate a packet in response to a key update. The next packet sent by the endpoint will use the updated keys. The next packet that contains an acknowledgment will cause the key update to be completed. If an endpoint detects a second update before it has sent any packets with updated keys containing an acknowledgment for the packet that initiated the key update, it indicates that its peer has updated keys twice without awaiting confirmation. An endpoint MAY treat such consecutive key updates as a connection error of type KEY_UPDATE_ERROR.


An endpoint that receives an acknowledgment that is carried in a packet protected with old keys where any acknowledged packet was protected with newer keys MAY treat that as a connection error of type KEY_UPDATE_ERROR. This indicates that a peer has received and acknowledged a packet that initiates a key update, but has not updated keys in response.


6.3. Timing of Receive Key Generation
6.3. 受信キーの生成のタイミング

Endpoints responding to an apparent key update MUST NOT generate a timing side-channel signal that might indicate that the Key Phase bit was invalid (see Section 9.5). Endpoints can use randomized packet protection keys in place of discarded keys when key updates are not yet permitted. Using randomized keys ensures that attempting to remove packet protection does not result in timing variations, and results in packets with an invalid Key Phase bit being rejected.


The process of creating new packet protection keys for receiving packets could reveal that a key update has occurred. An endpoint MAY generate new keys as part of packet processing, but this creates a timing signal that could be used by an attacker to learn when key updates happen and thus leak the value of the Key Phase bit.


Endpoints are generally expected to have current and next receive packet protection keys available. For a short period after a key update completes, up to the PTO, endpoints MAY defer generation of the next set of receive packet protection keys. This allows endpoints to retain only two sets of receive keys; see Section 6.5.


Once generated, the next set of packet protection keys SHOULD be retained, even if the packet that was received was subsequently discarded. Packets containing apparent key updates are easy to forge, and while the process of key update does not require significant effort, triggering this process could be used by an attacker for DoS.


For this reason, endpoints MUST be able to retain two sets of packet protection keys for receiving packets: the current and the next. Retaining the previous keys in addition to these might improve performance, but this is not essential.


6.4. Sending with Updated Keys
6.4. 更新された鍵による送信

An endpoint never sends packets that are protected with old keys. Only the current keys are used. Keys used for protecting packets can be discarded immediately after switching to newer keys.


Packets with higher packet numbers MUST be protected with either the same or newer packet protection keys than packets with lower packet numbers. An endpoint that successfully removes protection with old keys when newer keys were used for packets with lower packet numbers MUST treat this as a connection error of type KEY_UPDATE_ERROR.


6.5. Receiving with Different Keys
6.5. 異なる鍵による受信

For receiving packets during a key update, packets protected with older keys might arrive if they were delayed by the network. Retaining old packet protection keys allows these packets to be successfully processed.


As packets protected with keys from the next key phase use the same Key Phase value as those protected with keys from the previous key phase, it is necessary to distinguish between the two if packets protected with old keys are to be processed. This can be done using packet numbers. A recovered packet number that is lower than any packet number from the current key phase uses the previous packet protection keys; a recovered packet number that is higher than any packet number from the current key phase requires the use of the next packet protection keys.


Some care is necessary to ensure that any process for selecting between previous, current, and next packet protection keys does not expose a timing side channel that might reveal which keys were used to remove packet protection. See Section 9.5 for more information.


Alternatively, endpoints can retain only two sets of packet protection keys, swapping previous for next after enough time has passed to allow for reordering in the network. In this case, the Key Phase bit alone can be used to select keys.


An endpoint MAY allow a period of approximately the Probe Timeout (PTO; see [QUIC-RECOVERY]) after promoting the next set of receive keys to be current before it creates the subsequent set of packet protection keys. These updated keys MAY replace the previous keys at that time. With the caveat that PTO is a subjective measure -- that is, a peer could have a different view of the RTT -- this time is expected to be long enough that any reordered packets would be declared lost by a peer even if they were acknowledged and short enough to allow a peer to initiate further key updates.

エンドポイントは、次の受信キーのセットを作成する前に、プローブタイムアウトの周期(PTO; [QUIC-Recovery]を参照)の後続のパケット保護キーのセットを作成する前に行うことができます。これらの更新されたキーはその時点で前のキーを置き換えることができます。PTOが主観的な尺度であるという警告を使用して、その議案はRTTの異なる見方をすることができます - 今回は、並べ替えられたパケットが承認されたとしても、並べ替えされたパケットが宣言されるのに十分な長さであると予想されます。そしてピアがさらなる重要な更新を開始できるように十分に短い。

Endpoints need to allow for the possibility that a peer might not be able to decrypt packets that initiate a key update during the period when the peer retains old keys. Endpoints SHOULD wait three times the PTO before initiating a key update after receiving an acknowledgment that confirms that the previous key update was received. Failing to allow sufficient time could lead to packets being discarded.


An endpoint SHOULD retain old read keys for no more than three times the PTO after having received a packet protected using the new keys. After this period, old read keys and their corresponding secrets SHOULD be discarded.


6.6. Limits on AEAD Usage
6.6. AEAD使用の制限

This document sets usage limits for AEAD algorithms to ensure that overuse does not give an adversary a disproportionate advantage in attacking the confidentiality and integrity of communications when using QUIC.


The usage limits defined in TLS 1.3 exist for protection against attacks on confidentiality and apply to successful applications of AEAD protection. The integrity protections in authenticated encryption also depend on limiting the number of attempts to forge packets. TLS achieves this by closing connections after any record fails an authentication check. In comparison, QUIC ignores any packet that cannot be authenticated, allowing multiple forgery attempts.

TLS 1.3で定義されている使用制限は、機密性に対する攻撃に対する保護に存在し、AEAD保護の成功申請に適用されます。認証された暗号化の整合性保護はまた、パケットを偽造するための試み回数を制限することによって異なります。認証確認に失敗した後に接続を閉じることによってTLSがこれを達成します。比較すると、QUICは認証できないパケットを無視し、複数の偽造試行を可能にします。

QUIC accounts for AEAD confidentiality and integrity limits separately. The confidentiality limit applies to the number of packets encrypted with a given key. The integrity limit applies to the number of packets decrypted within a given connection. Details on enforcing these limits for each AEAD algorithm follow below.


Endpoints MUST count the number of encrypted packets for each set of keys. If the total number of encrypted packets with the same key exceeds the confidentiality limit for the selected AEAD, the endpoint MUST stop using those keys. Endpoints MUST initiate a key update before sending more protected packets than the confidentiality limit for the selected AEAD permits. If a key update is not possible or integrity limits are reached, the endpoint MUST stop using the connection and only send stateless resets in response to receiving packets. It is RECOMMENDED that endpoints immediately close the connection with a connection error of type AEAD_LIMIT_REACHED before reaching a state where key updates are not possible.


For AEAD_AES_128_GCM and AEAD_AES_256_GCM, the confidentiality limit is 2^23 encrypted packets; see Appendix B.1. For AEAD_CHACHA20_POLY1305, the confidentiality limit is greater than the number of possible packets (2^62) and so can be disregarded. For AEAD_AES_128_CCM, the confidentiality limit is 2^21.5 encrypted packets; see Appendix B.2. Applying a limit reduces the probability that an attacker can distinguish the AEAD in use from a random permutation; see [AEBounds], [ROBUST], and [GCM-MU].


In addition to counting packets sent, endpoints MUST count the number of received packets that fail authentication during the lifetime of a connection. If the total number of received packets that fail authentication within the connection, across all keys, exceeds the integrity limit for the selected AEAD, the endpoint MUST immediately close the connection with a connection error of type AEAD_LIMIT_REACHED and not process any more packets.


For AEAD_AES_128_GCM and AEAD_AES_256_GCM, the integrity limit is 2^52 invalid packets; see Appendix B.1. For AEAD_CHACHA20_POLY1305, the integrity limit is 2^36 invalid packets; see [AEBounds]. For AEAD_AES_128_CCM, the integrity limit is 2^21.5 invalid packets; see Appendix B.2. Applying this limit reduces the probability that an attacker can successfully forge a packet; see [AEBounds], [ROBUST], and [GCM-MU].

AEAD_AES_128_GCMおよびAEAD_AES_256_GCMの場合、整合性制限は2^52無効なパケットです。付録B.1を参照してください。AEAD_CHACHA20_POLY1305の場合、整合性制限は2^36無効なパケットです。[AEBounds]を参照してください。AEAD_AES_128_CCMの場合、整合性制限は2^21 21.5無効なパケットです。付録B.2を参照してください。この制限を適用すると、攻撃者がパケットを偽造できた可能性が低下します。[AEBounds]、[ROBUST]、[GCM-MU]を参照してください。

Endpoints that limit the size of packets MAY use higher confidentiality and integrity limits; see Appendix B for details.


Future analyses and specifications MAY relax confidentiality or integrity limits for an AEAD.


Any TLS cipher suite that is specified for use with QUIC MUST define limits on the use of the associated AEAD function that preserves margins for confidentiality and integrity. That is, limits MUST be specified for the number of packets that can be authenticated and for the number of packets that can fail authentication. Providing a reference to any analysis upon which values are based -- and any assumptions used in that analysis -- allows limits to be adapted to varying usage conditions.

QUICで使用するように指定されているTLS暗号スイートは、機密性と整合性のためのマージンを保持する関連するAEAD関数を使用する限界を定義しなければなりません。つまり、認証可能なパケットの数と認証に失敗する可能性があるパケットの数に制限を指定する必要があります。どの値が基づいているか、およびその分析で使用されている任意の仮定への参照を提供する - 制限を様々な使用条件に適応させることができます。

6.7. Key Update Error Code
6.7. キーアップデートエラーコード

The KEY_UPDATE_ERROR error code (0x0e) is used to signal errors related to key updates.


7. Security of Initial Messages
7. 初期メッセージのセキュリティ

Initial packets are not protected with a secret key, so they are subject to potential tampering by an attacker. QUIC provides protection against attackers that cannot read packets but does not attempt to provide additional protection against attacks where the attacker can observe and inject packets. Some forms of tampering -- such as modifying the TLS messages themselves -- are detectable, but some -- such as modifying ACKs -- are not.


For example, an attacker could inject a packet containing an ACK frame to make it appear that a packet had not been received or to create a false impression of the state of the connection (e.g., by modifying the ACK Delay). Note that such a packet could cause a legitimate packet to be dropped as a duplicate. Implementations SHOULD use caution in relying on any data that is contained in Initial packets that is not otherwise authenticated.


It is also possible for the attacker to tamper with data that is carried in Handshake packets, but because that sort of tampering requires modifying TLS handshake messages, any such tampering will cause the TLS handshake to fail.


8. QUIC-Specific Adjustments to the TLS Handshake
8. TLSハンドシェイクへの厳密な固有の調整

Certain aspects of the TLS handshake are different when used with QUIC.


QUIC also requires additional features from TLS. In addition to negotiation of cryptographic parameters, the TLS handshake carries and authenticates values for QUIC transport parameters.


8.1. Protocol Negotiation
8.1. プロトコルネゴシエーション

QUIC requires that the cryptographic handshake provide authenticated protocol negotiation. TLS uses Application-Layer Protocol Negotiation [ALPN] to select an application protocol. Unless another mechanism is used for agreeing on an application protocol, endpoints MUST use ALPN for this purpose.


When using ALPN, endpoints MUST immediately close a connection (see Section 10.2 of [QUIC-TRANSPORT]) with a no_application_protocol TLS alert (QUIC error code 0x0178; see Section 4.8) if an application protocol is not negotiated. While [ALPN] only specifies that servers use this alert, QUIC clients MUST use error 0x0178 to terminate a connection when ALPN negotiation fails.

ALPNを使用する場合、エンドポイントは、no_application_protocol TLSアラートを使用して接続をすぐに閉じる必要があります([QUIC-TRANSPORT]のセクション10.2)、アプリケーションプロトコルがネゴシエートされていない場合は、(QUICエラーコード0x0178; セクション4.8を参照)。[ALPN]サーバーはこのアラートを使用することだけを指定しているが、ALPNネゴシエーションが失敗したときに接続を終了するには、QUICクライアントはエラー0x0178を使用する必要があります。

An application protocol MAY restrict the QUIC versions that it can operate over. Servers MUST select an application protocol compatible with the QUIC version that the client has selected. The server MUST treat the inability to select a compatible application protocol as a connection error of type 0x0178 (no_application_protocol). Similarly, a client MUST treat the selection of an incompatible application protocol by a server as a connection error of type 0x0178.

アプリケーションプロトコルは、それが操作できるQUICバージョンを制限するかもしれません。サーバーは、クライアントが選択したQUICバージョンと互換性のあるアプリケーションプロトコルを選択する必要があります。サーバーは、タイプ0x0178(no_application_protocol)の接続エラーとして互換性のあるアプリケーションプロトコルを選択できないことを扱う必要があります。同様に、クライアントは、Type 0x0178の接続エラーとして、サーバーによる互換性のないアプリケーションプロトコルの選択を扱う必要があります。

8.2. QUIC Transport Parameters Extension
8.2. QUICトランスポートパラメータ拡張

QUIC transport parameters are carried in a TLS extension. Different versions of QUIC might define a different method for negotiating transport configuration.


Including transport parameters in the TLS handshake provides integrity protection for these values.


      enum {
         quic_transport_parameters(0x39), (65535)
      } ExtensionType;

The extension_data field of the quic_transport_parameters extension contains a value that is defined by the version of QUIC that is in use.


The quic_transport_parameters extension is carried in the ClientHello and the EncryptedExtensions messages during the handshake. Endpoints MUST send the quic_transport_parameters extension; endpoints that receive ClientHello or EncryptedExtensions messages without the quic_transport_parameters extension MUST close the connection with an error of type 0x016d (equivalent to a fatal TLS missing_extension alert, see Section 4.8).

quic_transport_parameters拡張は、ハンドシェイク中にClientHelloおよびEncryptedExtensionsメッセージで搭載されています。エンドポイントはquic_transport_parameters拡張機能を送信する必要があります。quic_transport_parametersのないClientHelloまたはEncryptedExtensionsメッセージを受信するエンドポイントは、拡張子が0x016Dとタイプ0x016Dのエラーで接続を閉じる必要があります(致命的なTLS MUSINESTENSER ALECTENT警告と同等)。

Transport parameters become available prior to the completion of the handshake. A server might use these values earlier than handshake completion. However, the value of transport parameters is not authenticated until the handshake completes, so any use of these parameters cannot depend on their authenticity. Any tampering with transport parameters will cause the handshake 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 by an implementation that supports this extension if the extension is received when the transport is not QUIC.

エンドポイントは、QUICを使用しないTLS接続でこの拡張子を送信してはいけません([TLS13]でTCPのTCPの使用など)。atfort unsupported_extensionアラートは、トランスポートがQUICでないときに拡張子が受信された場合にこの拡張機能をサポートする実装によって送信されなければなりません。

Negotiating the quic_transport_parameters extension causes the EndOfEarlyData to be removed; see Section 8.3.


8.3. Removing the EndOfEarlyData Message
8.3. EndOfEarlyDataメッセージの削除

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.

TLS EndOfEarlyDataメッセージはQUICでは使用されません。QUICは0-RTTデータの終わりをマークするか、ハンドシェイクキーへの変更をシグナリングするためにこのメッセージに依存しません。

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.


8.4. Prohibit TLS Middlebox Compatibility Mode
8.4. TLSミドルボックス互換性モードの禁止

Appendix D.4 of [TLS13] describes an alteration to the TLS 1.3 handshake as a workaround for bugs in some middleboxes. The TLS 1.3 middlebox compatibility mode involves setting the legacy_session_id field to a 32-byte value in the ClientHello and ServerHello, then sending a change_cipher_spec record. Both field and record carry no semantic content and are ignored.

[TLS13]の付録D.4は、いくつかのミドルボックスのバグの回避策としてのTLS 1.3ハンドシェイクへの変更を示しています。TLS 1.3ミドルボックス互換性モードでは、LEGACY_SESSION_IDフィールドをClientHelloとServerHelloの32バイトの値に設定してから、change_cipher_specレコードを送信します。フィールドとレコードの両方で意味のあるコンテンツはありませんが無視されます。

This mode has no use in QUIC as it only applies to middleboxes that interfere with TLS over TCP. QUIC also provides no means to carry a change_cipher_spec record. A client MUST NOT request the use of the TLS 1.3 compatibility mode. A server SHOULD treat the receipt of a TLS ClientHello with a non-empty legacy_session_id field as a connection error of type PROTOCOL_VIOLATION.

TCPを介してTLSを妨害するミドルボックスにのみ適用されるように、このモードでは使用されません。QUICは、change_cipher_specレコードを搬送する手段もありません。クライアントはTLS 1.3互換モードの使用を要求してはいけません。サーバーは、PROTOCOL_VIOLATION型の接続エラーとして、空のLEGACY_SESSION_IDフィールドを使用してTLS ClientHelloの受信を扱う必要があります。

9. Security Considerations
9. セキュリティに関する考慮事項

All of the security considerations that apply to TLS also apply to the use of TLS in QUIC. Reading all of [TLS13] and its appendices is the best way to gain an understanding of the security properties of QUIC.


This section summarizes some of the more important security aspects specific to the TLS integration, though there are many security-relevant details in the remainder of the document.


9.1. Session Linkability
9.1. セッションリンク可能性

Use of TLS session tickets allows servers and possibly other entities to correlate connections made by the same client; see Section 4.5 for details.


9.2. Replay Attacks with 0-RTT
9.2. 0-RTTでのリプレイ攻撃

As described in Section 8 of [TLS13], use of TLS early data comes with an exposure to replay attack. The use of 0-RTT in QUIC is similarly vulnerable to replay attack.


Endpoints MUST implement and use the replay protections described in [TLS13], however it is recognized that these protections are imperfect. Therefore, additional consideration of the risk of replay is needed.


QUIC is not vulnerable to replay attack, except via the application protocol information it might carry. The management of QUIC protocol state based on the frame types defined in [QUIC-TRANSPORT] is not vulnerable to replay. Processing of QUIC frames is idempotent and cannot result in invalid connection states if frames are replayed, reordered, or lost. QUIC connections do not produce effects that last beyond the lifetime of the connection, except for those produced by the application protocol that QUIC serves.


TLS session tickets and address validation tokens are used to carry QUIC configuration information between connections, specifically, to enable a server to efficiently recover state that is used in connection establishment and address validation. These MUST NOT be used to communicate application semantics between endpoints; clients MUST treat them as opaque values. The potential for reuse of these tokens means that they require stronger protections against replay.


A server that accepts 0-RTT on a connection incurs a higher cost than accepting a connection without 0-RTT. This includes higher processing and computation costs. Servers need to consider the probability of replay and all associated costs when accepting 0-RTT.


Ultimately, the responsibility for managing the risks of replay attacks with 0-RTT lies with an application protocol. An application protocol that uses QUIC MUST describe how the protocol uses 0-RTT and the measures that are employed to protect against replay attack. An analysis of replay risk needs to consider all QUIC protocol features that carry application semantics.


Disabling 0-RTT entirely is the most effective defense against replay attack.


QUIC extensions MUST either describe how replay attacks affect their operation or prohibit the use of the extension in 0-RTT. Application protocols MUST either prohibit the use of extensions that carry application semantics in 0-RTT or provide replay mitigation strategies.


9.3. Packet Reflection Attack Mitigation
9.3. パケット反射攻撃の軽減

A small ClientHello that results in a large block of handshake messages from a server can be used in packet reflection attacks to amplify the traffic generated by an attacker.


QUIC includes three defenses against this attack. First, the packet containing a ClientHello MUST be padded to a minimum size. Second, if responding to an unverified source address, the server is forbidden to send more than three times as many bytes as the number of bytes it has received (see Section 8.1 of [QUIC-TRANSPORT]). Finally, because acknowledgments of Handshake packets are authenticated, a blind attacker cannot forge them. Put together, these defenses limit the level of amplification.


9.4. Header Protection Analysis
9.4. ヘッダー保護分析

[NAN] analyzes authenticated encryption algorithms that provide nonce privacy, referred to as "Hide Nonce" (HN) transforms. The general header protection construction in this document is one of those algorithms (HN1). Header protection is applied after the packet protection AEAD, sampling a set of bytes ("sample") from the AEAD output and encrypting the header field using a pseudorandom function (PRF) as follows:

[NAN]は、「Hide Nonce」(HN)変換と呼ばれる、ナンスプライバシーを提供する認証済み暗号化アルゴリズムを分析します。 このドキュメントの一般的なヘッダー保護構造は、それらのアルゴリズム(HN1)の1つです。 ヘッダー保護は、パケット保護AEADの後に適用され、AEAD出力からバイトセット(「サンプル」)をサンプリングし、次のように疑似ランダム関数(PRF)を使用してヘッダーフィールドを暗号化します。

   protected_field = field XOR PRF(hp_key, sample)

The header protection variants in this document use a pseudorandom permutation (PRP) in place of a generic PRF. However, since all PRPs are also PRFs [IMC], these variants do not deviate from the HN1 construction.

この文書のヘッダー保護バリアントは、一般的なPRFの代わりに疑似乱数順列(PRP)を使用しています。しかし、すべてのPRPもPRFS [IMC]であるため、これらの変種はHN1構造から逸脱しません。

As "hp_key" is distinct from the packet protection key, it follows that header protection achieves AE2 security as defined in [NAN] and therefore guarantees privacy of "field", the protected packet header. Future header protection variants based on this construction MUST use a PRF to ensure equivalent security guarantees.


Use of the same key and ciphertext sample more than once risks compromising header protection. Protecting two different headers with the same key and ciphertext sample reveals the exclusive OR of the protected fields. Assuming that the AEAD acts as a PRF, if L bits are sampled, the odds of two ciphertext samples being identical approach 2^(-L/2), that is, the birthday bound. For the algorithms described in this document, that probability is one in 2^64.

ヘッダー保護を犠牲にすると、同じキーと暗号文のサンプルを複数回使用します。同じキーと暗号文のサンプルを持つ2つの異なるヘッダーを保護すると、保護されたフィールドの排他的論理和を明らかにします。AEADがPRFとして機能すると仮定すると、Lビットがサンプリングされた場合、2つの暗号文サンプルのオッズは同一の方法 2^(-L/2)、すなわち誕生日バウンド。この文書に記載されているアルゴリズムの場合、その確率は2^64の1つです。

To prevent an attacker from modifying packet headers, the header is transitively authenticated using packet protection; the entire packet header is part of the authenticated additional data. Protected fields that are falsified or modified can only be detected once the packet protection is removed.


9.5. Header Protection Timing Side Channels
9.5. ヘッダー保護タイミングサイドチャンネル

An attacker could guess values for packet numbers or Key Phase and have an endpoint confirm guesses through timing side channels. Similarly, guesses for the packet number length can be tried and exposed. If the recipient of a packet discards packets with duplicate packet numbers without attempting to remove packet protection, they could reveal through timing side channels that the packet number matches a received packet. For authentication to be free from side channels, the entire process of header protection removal, packet number recovery, and packet protection removal MUST be applied together without timing and other side channels.


For the sending of packets, construction and protection of packet payloads and packet numbers MUST be free from side channels that would reveal the packet number or its encoded size.


During a key update, the time taken to generate new keys could reveal through timing side channels that a key update has occurred. Alternatively, where an attacker injects packets, this side channel could reveal the value of the Key Phase on injected packets. After receiving a key update, an endpoint SHOULD generate and save the next set of receive packet protection keys, as described in Section 6.3. By generating new keys before a key update is received, receipt of packets will not create timing signals that leak the value of the Key Phase.


This depends on not doing this key generation during packet processing, and it can require that endpoints maintain three sets of packet protection keys for receiving: for the previous key phase, for the current key phase, and for the next key phase. Endpoints can instead choose to defer generation of the next receive packet protection keys until they discard old keys so that only two sets of receive keys need to be retained at any point in time.


9.6. Key Diversity
9.6. キーダイバーシティ

In using TLS, the central key schedule of TLS is used. As a result of the TLS handshake messages being integrated into the calculation of secrets, the inclusion of the QUIC transport parameters extension ensures that the handshake and 1-RTT keys are not the same as those that might be produced by a server running TLS over TCP. To avoid the possibility of cross-protocol key synchronization, additional measures are provided to improve key separation.


The QUIC packet protection keys and IVs are derived using a different label than the equivalent keys in TLS.


To preserve this separation, a new version of QUIC SHOULD define new labels for key derivation for packet protection key and IV, plus the header protection keys. This version of QUIC uses the string "quic". Other versions can use a version-specific label in place of that string.

この分離を維持するために、新しいバージョンのQUICは、パケット保護キーとIVのキー導出のための新しいラベルとヘッダー保護キーを定義する必要があります。このバージョンのQUICは文字列 "quic"を使用します。他のバージョンは、その文字列の代わりにバージョン固有のラベルを使用できます。

The initial secrets use a key that is specific to the negotiated QUIC version. New QUIC versions SHOULD define a new salt value used in calculating initial secrets.


9.7. Randomness
9.7. ランダム性

QUIC depends on endpoints being able to generate secure random numbers, both directly for protocol values such as the connection ID, and transitively via TLS. See [RFC4086] for guidance on secure random number generation.


10. IANA Considerations
10. IANAの考慮事項

IANA has registered a codepoint of 57 (or 0x39) for the quic_transport_parameters extension (defined in Section 8.2) in the "TLS ExtensionType Values" registry [TLS-REGISTRIES].

IANAは、「TLS ExtenctType値」レジストリ[TLSレジストリ]のQUIC_TRANSPORT_PARAMETERS拡張(セクション8.2で定義)のCodePointを登録しています。

The Recommended column for this extension is marked Yes. The TLS 1.3 Column includes CH (ClientHello) and EE (EncryptedExtensions).

この拡張子の推奨列は、はいマークです。TLS 1.3列にはCH(ClientHello)とEE(EncryptedExtensions)が含まれています。

   | Value | Extension Name            | TLS | Recommended | Reference |
   |       |                           | 1.3 |             |           |
   |    57 | quic_transport_parameters | CH, | Y           | This      |
   |       |                           | EE  |             | document  |

Table 2: TLS ExtensionType Values Registry Entry

表2:MLS ExtensionType値レジストリエントリ

11. References
11. 参考文献
11.1. Normative References
11.1. 引用文献

[AEAD] McGrew, D., "An Interface and Algorithms for Authenticated Encryption", RFC 5116, DOI 10.17487/RFC5116, January 2008, <>.

[AEAD] MCGREW、D。、「認証された暗号化のためのインタフェースとアルゴリズム」、RFC 5116、DOI 10.17487 / RFC5116、2008年1月、<>。

[AES] "Advanced encryption standard (AES)", National Institute of Standards and Technology report, DOI 10.6028/nist.fips.197, November 2001, <>.

[AES]「高度な暗号化規格(AES)」、国立標準化学研究所、DOI 10.6028 / NIST.FIPS.197、2001年11月、<>。

[ALPN] Friedl, S., Popov, A., Langley, A., and E. Stephan, "Transport Layer Security (TLS) Application-Layer Protocol Negotiation Extension", RFC 7301, DOI 10.17487/RFC7301, July 2014, <>.

[ALPN] Friedl、S.、Popov、A.、Langley、A.、およびE.Stethan、「トランスポート層セキュリティ(TLS)アプリケーション層プロトコルネゴシエーション拡張」、RFC 7301、DOI 10.17487 / RFC7301、2014年7月、<>。

[CHACHA] Nir, Y. and A. Langley, "ChaCha20 and Poly1305 for IETF Protocols", RFC 8439, DOI 10.17487/RFC8439, June 2018, <>.

[Chacha] NIR、Y。およびA. Langley、RFC 8439、DOI 10.17487 / RFC8439、2018年6月、<>。

[HKDF] Krawczyk, H. and P. Eronen, "HMAC-based Extract-and-Expand Key Derivation Function (HKDF)", RFC 5869, DOI 10.17487/RFC5869, May 2010, <>.

[HKDF] Krawczyk、H.およびP. Eronen、 "HMACベースの抽出抽出及び拡張キー派生機能(HKDF)"、RFC 5869、DOI 10.17487 / RFC5869、<https://www.rfc-編集者.org / info / rfc5869>。

[QUIC-RECOVERY] Iyengar, J., Ed. and I. Swett, Ed., "QUIC Loss Detection and Congestion Control", RFC 9002, DOI 10.17487/RFC9002, May 2021, <>.

[QUIC回復] Iyngar、J.、ED。I.SWETT、ED。、「QUICの損失検出および輻輳制御」、RFC 9002、DOI 10.17487 / RFC9002、2021年5月、<>。

[QUIC-TRANSPORT] Iyengar, J., Ed. and M. Thomson, Ed., "QUIC: A UDP-Based Multiplexed and Secure Transport", RFC 9000, DOI 10.17487/RFC9000, May 2021, <>.

[QUIC-TRANSPORT] Iyengar、J.、ED。そして、「Q. Thomson」、「QUIC:UDPベースの多重化および安全な輸送」、RFC 9000、DOI 10.17487 / RFC9000、<>。

[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997, <>.

[RFC2119] BRADNER、S、「RFCSで使用するためのキーワード」、BCP 14、RFC 2119、DOI 10.17487 / RFC2119、1997年3月、<>。

[RFC4086] Eastlake 3rd, D., Schiller, J., and S. Crocker, "Randomness Requirements for Security", BCP 106, RFC 4086, DOI 10.17487/RFC4086, June 2005, <>.

[RFC4086]イーストレイク3RD、D.、Schiller、J.、S. Crocker、「セキュリティのためのランダム性要件」、BCP 106、RFC 4086、DOI 10.17487 / RFC4086、2005年6月、<https://www.rfc-編集者.org / info / rfc4086>。

[RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, May 2017, <>.

[RFC8174] Leiba、B、「RFC 2119キーワードの大文字の曖昧さ」、BCP 14、RFC 8174、DOI 10.17487 / RFC8174、2017年5月、<>。

[SHA] Dang, Q., "Secure Hash Standard", National Institute of Standards and Technology report, DOI 10.6028/nist.fips.180-4, July 2015, <>.

[SHA] Dang、Q.、国立標準技術研究所、DOI 10.6028 / NIST.FIPS.180-4、<>。

[TLS-REGISTRIES] Salowey, J. and S. Turner, "IANA Registry Updates for TLS and DTLS", RFC 8447, DOI 10.17487/RFC8447, August 2018, <>.

[TLS-Registries] Salowey、J.およびS.ターナー、「TLSおよびDTLSのIANAレジストリアップデート」、RFC 8447、DOI 10.17487 / RFC8447、2018年8月、<>。

[TLS13] Rescorla, E., "The Transport Layer Security (TLS) Protocol Version 1.3", RFC 8446, DOI 10.17487/RFC8446, August 2018, <>.

[TLS13] RESCORLA、E。、「トランスポート層セキュリティ(TLS)プロトコルバージョン1.3」、RFC 8446、DOI 10.17487 / RFC8446、2018年8月、<>。

11.2. Informative References
11.2. 参考引用

[AEBounds] Luykx, A. and K. Paterson, "Limits on Authenticated Encryption Use in TLS", 28 August 2017, <>.

[AEBounds] Luykx、A.およびK. Paterson、2017年8月28日、<>。

[ASCII] Cerf, V., "ASCII format for network interchange", STD 80, RFC 20, DOI 10.17487/RFC0020, October 1969, <>.

[ASCII] CERF、V.、「ネットワークインターチェンジのASCIIフォーマット」、STD 80、RFC 20、DOI 10.17487 / RFC0020、1969年10月、<>。

[CCM-ANALYSIS] Jonsson, J., "On the Security of CTR + CBC-MAC", Selected Areas in Cryptography, SAC 2002, Lecture Notes in Computer Science, vol 2595, pp. 76-93, DOI 10.1007/3-540-36492-7_7, 2003, <>.

[CCM-Analysis] Jonsson、J.、「CTR CBC-MACのセキュリティについて」、Cryptographyの選択領域、SAC 2002、PP.76-93、DOI 10.1007 / 3-540-36492-7_7,2003、<>。

[COMPRESS] Ghedini, A. and V. Vasiliev, "TLS Certificate Compression", RFC 8879, DOI 10.17487/RFC8879, December 2020, <>.

[圧縮] Ghedini、A.およびV.Vasiliev、「TLS証明書圧縮」、RFC 8879、DOI 10.17487 / RFC8879、2020年12月、<>。

[GCM-MU] Hoang, V., Tessaro, S., and A. Thiruvengadam, "The Multi-user Security of GCM, Revisited: Tight Bounds for Nonce Randomization", CCS '18: Proceedings of the 2018 ACM SIGSAC Conference on Computer and Communications Security, pp. 1429-1440, DOI 10.1145/3243734.3243816, 2018, <>.

[GCM-MU]ホアアン、V.、Tessaro、S.、およびA.Thiruvengadam、「GCMのマルチユーザーセキュリティ、再検討:Nonceランダム化のためのタイトな範囲」、CCS '18:2018年ACM SIGSAC会議の手続きコンピュータと通信セキュリティ、PP。1429-1440、DOI 10.1145 / 3243734.3243816,2018、<>。

[HTTP-REPLAY] Thomson, M., Nottingham, M., and W. Tarreau, "Using Early Data in HTTP", RFC 8470, DOI 10.17487/RFC8470, September 2018, <>.

[HTTP-REPLAY] Thomson、M.、Nottingham、M.、およびW. Tarreau、2018年9月、2018年9月、<https:///www.rfc-編集者。org / info / rfc8470>。

[HTTP2-TLS13] Benjamin, D., "Using TLS 1.3 with HTTP/2", RFC 8740, DOI 10.17487/RFC8740, February 2020, <>.

[HTTP2-TLS13] Benjamin、D.、「HTTP / 2のTLS 1.3を使用して、RFC 8740、DOI 10.17487 / RFC8740、2020年2月、<>。

[IMC] Katz, J. and Y. Lindell, "Introduction to Modern Cryptography, Second Edition", ISBN 978-1466570269, 6 November 2014.

[IMC] Katz、J.およびY. Lindell、2014年11月6日、ISBN 978-1466570269、ISBN 978-1466570269。

[NAN] Bellare, M., Ng, R., and B. Tackmann, "Nonces Are Noticed: AEAD Revisited", Advances in Cryptology - CRYPTO 2019, Lecture Notes in Computer Science, vol 11692, pp. 235-265, DOI 10.1007/978-3-030-26948-7_9, 2019, <>.

[Nan] Bellare、M.、NG、R.、B. Tackmann、Cryptolysの進歩 - Crypto 2019、Crypto 2019、PP。235-265、DOI10.1007 / 978-3-030-26948-7_9、2019、<>。

[QUIC-HTTP] Bishop, M., Ed., "Hypertext Transfer Protocol Version 3 (HTTP/3)", Work in Progress, Internet-Draft, draft-ietf-quic-http-34, 2 February 2021, <>.

[QUIC-HTTP] Bishop、M.、Ed。、「Hypertext Transfer Protocol Version 3(HTTP/3)」、進行中の作業、インターネットドラフト、romft-ietf-quic-quic-http-34,2021、<HTTPS://>。

[RFC2818] Rescorla, E., "HTTP Over TLS", RFC 2818, DOI 10.17487/RFC2818, May 2000, <>.

[RFC2818] RESCORLA、E.、「HTTP over TLS」、RFC 2818、DOI 10.17487 / RFC2818、2000年5月、<>。

[RFC5280] Cooper, D., Santesson, S., Farrell, S., Boeyen, S., Housley, R., and W. Polk, "Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile", RFC 5280, DOI 10.17487/RFC5280, May 2008, <>.

[RFC5280] Cooper、D.、Santesson、S.、Farrell、S.、Boeyen、S.、Housley、R.、およびW.Polk、 "Internet X.509公開鍵インフラストラクチャ証明書および証明書失効リスト(CRL)プロファイル「、RFC 5280、DOI 10.17487 / RFC5280、2008年5月、<>。

[ROBUST] Fischlin, M., Günther, F., and C. Janson, "Robust Channels: Handling Unreliable Networks in the Record Layers of QUIC and DTLS 1.3", 16 May 2020, <>.

[堅牢な] Fischlin、M.、Günther、F.、およびC.Janson、 "堅牢なチャンネル:QUICおよびDTLS 1.3の記録層の信頼性の低いネットワークの取り扱い、2020年5月16日、 2020/718>。

Appendix A. Sample Packet Protection

This section shows examples of packet protection so that implementations can be verified incrementally. Samples of Initial packets from both client and server plus a Retry packet are defined. These packets use an 8-byte client-chosen Destination Connection ID of 0x8394c8f03e515708. Some intermediate values are included. All values are shown in hexadecimal.


A.1. Keys
A.1. キー

The labels generated during the execution of the HKDF-Expand-Label function (that is, HkdfLabel.label) and part of the value given to the HKDF-Expand function in order to produce its output are:


   client in:  00200f746c73313320636c69656e7420696e00

   server in:  00200f746c7331332073657276657220696e00

   quic key:  00100e746c7331332071756963206b657900

   quic iv:  000c0d746c733133207175696320697600

   quic hp:  00100d746c733133207175696320687000

The initial secret is common:


   initial_secret = HKDF-Extract(initial_salt, cid)
       = 7db5df06e7a69e432496adedb0085192

The secrets for protecting client packets are:


       = HKDF-Expand-Label(initial_secret, "client in", "", 32)
       = c00cf151ca5be075ed0ebfb5c80323c4
   key = HKDF-Expand-Label(client_initial_secret, "quic key", "", 16)
       = 1f369613dd76d5467730efcbe3b1a22d
   iv = HKDF-Expand-Label(client_initial_secret, "quic iv", "", 12)
       = fa044b2f42a3fd3b46fb255c
   hp  = HKDF-Expand-Label(client_initial_secret, "quic hp", "", 16)
       = 9f50449e04a0e810283a1e9933adedd2

The secrets for protecting server packets are:


       = HKDF-Expand-Label(initial_secret, "server in", "", 32)
       = 3c199828fd139efd216c155ad844cc81
   key = HKDF-Expand-Label(server_initial_secret, "quic key", "", 16)
       = cf3a5331653c364c88f0f379b6067e37
   iv = HKDF-Expand-Label(server_initial_secret, "quic iv", "", 12)
       = 0ac1493ca1905853b0bba03e
   hp  = HKDF-Expand-Label(server_initial_secret, "quic hp", "", 16)
       = c206b8d9b9f0f37644430b490eeaa314
A.2. Client Initial
A.2. クライアントの初期

The client sends an Initial packet. The unprotected payload of this packet contains the following CRYPTO frame, plus enough PADDING frames to make a 1162-byte payload:


   060040f1010000ed0303ebf8fa56f129 39b9584a3896472ec40bb863cfd3e868
   04fe3a47f06a2b69484c000004130113 02010000c000000010000e00000b6578
   616d706c652e636f6dff01000100000a 00080006001d00170018001000070005
   04616c706e0005000501000000000033 00260024001d00209370b2c9caa47fba
   baf4559fedba753de171fa71f50f1ce1 5d43e994ec74d748002b000302030400
   0d0010000e0403050306030203080408 050806002d00020101001c0002400100
   3900320408ffffffffffffffff050480 00ffff07048000ffff08011001048000
   75300901100f088394c8f03e51570806 048000ffff

The unprotected header indicates a length of 1182 bytes: the 4-byte packet number, 1162 bytes of frames, and the 16-byte authentication tag. The header includes the connection ID and a packet number of 2:



Protecting the payload produces output that is sampled for header protection. Because the header uses a 4-byte packet number encoding, the first 16 bytes of the protected payload is sampled and then applied to the header as follows:


   sample = d1b1c98dd7689fb8ec11d242b123dc9b

   mask = AES-ECB(hp, sample)[0..4]
        = 437b9aec36

   header[0] ^= mask[0] & 0x0f
        = c0
   header[18..21] ^= mask[1..4]
        = 7b9aec34
   header = c000000001088394c8f03e5157080000449e7b9aec34

The resulting protected packet is:


   c000000001088394c8f03e5157080000 449e7b9aec34d1b1c98dd7689fb8ec11
   d242b123dc9bd8bab936b47d92ec356c 0bab7df5976d27cd449f63300099f399
   1c260ec4c60d17b31f8429157bb35a12 82a643a8d2262cad67500cadb8e7378c
   8eb7539ec4d4905fed1bee1fc8aafba1 7c750e2c7ace01e6005f80fcb7df6212
   30c83711b39343fa028cea7f7fb5ff89 eac2308249a02252155e2347b63d58c5
   457afd84d05dfffdb20392844ae81215 4682e9cf012f9021a6f0be17ddd0c208
   4dce25ff9b06cde535d0f920a2db1bf3 62c23e596d11a4f5a6cf3948838a3aec
   4e15daf8500a6ef69ec4e3feb6b1d98e 610ac8b7ec3faf6ad760b7bad1db4ba3
   485e8a94dc250ae3fdb41ed15fb6a8e5 eba0fc3dd60bc8e30c5c4287e53805db
   059ae0648db2f64264ed5e39be2e20d8 2df566da8dd5998ccabdae053060ae6c
   7b4378e846d29f37ed7b4ea9ec5d82e7 961b7f25a9323851f681d582363aa5f8
   9937f5a67258bf63ad6f1a0b1d96dbd4 faddfcefc5266ba6611722395c906556
   be52afe3f565636ad1b17d508b73d874 3eeb524be22b3dcbc2c7468d54119c74
   68449a13d8e3b95811a198f3491de3e7 fe942b330407abf82a4ed7c1b311663a
   c69890f4157015853d91e923037c227a 33cdd5ec281ca3f79c44546b9d90ca00
   f064c99e3dd97911d39fe9c5d0b23a22 9a234cb36186c4819e8b9c5927726632
   291d6a418211cc2962e20fe47feb3edf 330f2c603a9d48c0fcb5699dbfe58964
   25c5bac4aee82e57a85aaf4e2513e4f0 5796b07ba2ee47d80506f8d2c25e50fd
   14de71e6c418559302f939b0e1abd576 f279c4b2e0feb85c1f28ff18f58891ff
   ef132eef2fa09346aee33c28eb130ff2 8f5b766953334113211996d20011a198
   e3fc433f9f2541010ae17c1bf202580f 6047472fb36857fe843b19f5984009dd
   c324044e847a4f4a0ab34f719595de37 252d6235365e9b84392b061085349d73
   203a4a13e96f5432ec0fd4a1ee65accd d5e3904df54c1da510b0ff20dcc0c77f
   cb2c0e0eb605cb0504db87632cf3d8b4 dae6e705769d1de354270123cb11450e
   fc60ac47683d7b8d0f811365565fd98c 4c8eb936bcab8d069fc33bd801b03ade
   a2e1fbc5aa463d08ca19896d2bf59a07 1b851e6c239052172f296bfb5e724047
   90a2181014f3b94a4e97d117b4381303 68cc39dbb2d198065ae3986547926cd2
   162f40a29f0c3c8745c0f50fba3852e5 66d44575c29d39a03f0cda721984b6f4
   40591f355e12d439ff150aab7613499d bd49adabc8676eef023b15b65bfc5ca0
   6948109f23f350db82123535eb8a7433 bdabcb909271a6ecbcb58b936a88cd4e
   8f2e6ff5800175f113253d8fa9ca8885 c2f552e657dc603f252e1a8e308f76f0
   be79e2fb8f5d5fbbe2e30ecadd220723 c8c0aea8078cdfcb3868263ff8f09400
   54da48781893a7e49ad5aff4af300cd8 04a6b6279ab3ff3afb64491c85194aab
   760d58a606654f9f4400e8b38591356f bf6425aca26dc85244259ff2b19c41b9
   f96f3ca9ec1dde434da7d2d392b905dd f3d1f9af93d1af5950bd493f5aa731b4
   056df31bd267b6b90a079831aaf579be 0a39013137aac6d404f518cfd4684064
   7e78bfe706ca4cf5e9c5453e9f7cfd2b 8b4c8d169a44e55c88d4a9a7f9474241
A.3. Server Initial
A.3. サーバーのイニシャル

The server sends the following payload in response, including an ACK frame, a CRYPTO frame, and no PADDING frames:


   02000000000600405a020000560303ee fce7f7b37ba1d1632e96677825ddf739
   88cfc79825df566dc5430b9a045a1200 130100002e00330024001d00209d3c94
   0d89690b84d08a60993c144eca684d10 81287c834d5311bcf32bb9da1a002b00

The header from the server includes a new connection ID and a 2-byte packet number encoding for a packet number of 1:



As a result, after protection, the header protection sample is taken starting from the third protected byte:


   sample = 2cd0991cd25b0aac406a5816b6394100
   mask   = 2ec0d8356a
   header = cf000000010008f067a5502a4262b5004075c0d9

The final protected packet is then:


   cf000000010008f067a5502a4262b500 4075c0d95a482cd0991cd25b0aac406a
   5816b6394100f37a1c69797554780bb3 8cc5a99f5ede4cf73c3ec2493a1839b3
   dbcba3f6ea46c5b7684df3548e7ddeb9 c3bf9c73cc3f3bded74b562bfb19fb84
   022f8ef4cdd93795d77d06edbb7aaf2f 58891850abbdca3d20398c276456cbc4
A.4. Retry
A.4. リトライ

This shows a Retry packet that might be sent in response to the Initial packet in Appendix A.2. The integrity check includes the client-chosen connection ID value of 0x8394c8f03e515708, but that value is not included in the final Retry packet:


   ff000000010008f067a5502a4262b574 6f6b656e04a265ba2eff4d829058fb3f
A.5. ChaCha20-Poly1305 Short Header Packet
A.5. Chacha20-Poly1305ショートヘッダーパケット

This example shows some of the steps required to protect a packet with a short header. This example uses AEAD_CHACHA20_POLY1305.


In this example, TLS produces an application write secret from which a server uses HKDF-Expand-Label to produce four values: a key, an IV, a header protection key, and the secret that will be used after keys are updated (this last value is not used further in this example).


       = 9ac312a7f877468ebe69422748ad00a1

   key = HKDF-Expand-Label(secret, "quic key", "", 32)
       = c6d98ff3441c3fe1b2182094f69caa2e

   iv  = HKDF-Expand-Label(secret, "quic iv", "", 12)
       = e0459b3474bdd0e44a41c144

   hp  = HKDF-Expand-Label(secret, "quic hp", "", 32)
       = 25a282b9e82f06f21f488917a4fc8f1b

   ku  = HKDF-Expand-Label(secret, "quic ku", "", 32)
       = 1223504755036d556342ee9361d25342

The following shows the steps involved in protecting a minimal packet with an empty Destination Connection ID. This packet contains a single PING frame (that is, a payload of just 0x01) and has a packet number of 654360564. In this example, using a packet number of length 3 (that is, 49140 is encoded) avoids having to pad the payload of the packet; PADDING frames would be needed if the packet number is encoded on fewer bytes.


   pn                 = 654360564 (decimal)
   nonce              = e0459b3474bdd0e46d417eb0
   unprotected header = 4200bff4
   payload plaintext  = 01
   payload ciphertext = 655e5cd55c41f69080575d7999c25a5bfb

The resulting ciphertext is the minimum size possible. One byte is skipped to produce the sample for header protection.


   sample = 5e5cd55c41f69080575d7999c25a5bfb
   mask   = aefefe7d03
   header = 4cfe4189

The protected packet is the smallest possible packet size of 21 bytes.


   packet = 4cfe4189655e5cd55c41f69080575d7999c25a5bfb
Appendix B. AEAD Algorithm Analysis
付録B. AEADアルゴリズム分析

This section documents analyses used in deriving AEAD algorithm limits for AEAD_AES_128_GCM, AEAD_AES_128_CCM, and AEAD_AES_256_GCM. The analyses that follow use symbols for multiplication (*), division (/), and exponentiation (^), plus parentheses for establishing precedence. The following symbols are also used:


t: The size of the authentication tag in bits. For these ciphers, t is 128.


n: The size of the block function in bits. For these ciphers, n is 128.


k: The size of the key in bits. This is 128 for AEAD_AES_128_GCM and AEAD_AES_128_CCM; 256 for AEAD_AES_256_GCM.


l: The number of blocks in each packet (see below).


q: The number of genuine packets created and protected by endpoints. This value is the bound on the number of packets that can be protected before updating keys.


v: The number of forged packets that endpoints will accept. This value is the bound on the number of forged packets that an endpoint can reject before updating keys.


o: The amount of offline ideal cipher queries made by an adversary.


The analyses that follow rely on a count of the number of block operations involved in producing each message. This analysis is performed for packets of size up to 2^11 (l = 2^7) and 2^16 (l = 2^12). A size of 2^11 is expected to be a limit that matches common deployment patterns, whereas the 2^16 is the maximum possible size of a QUIC packet. Only endpoints that strictly limit packet size can use the larger confidentiality and integrity limits that are derived using the smaller packet size.

以下の分析は、各メッセージの作成に含まれるブロック操作の数の数に依存しています。この分析は、最大2^11(L = 2^7)および2^16(L = 2^12)のサイズのパケットについて実行されます。2^11のサイズは、共通の展開パターンに一致する限界であると予想されますが、2^16はQUICパケットの最大可能サイズです。パケットサイズを厳密に制限するエンドポイントだけが、小さいパケットサイズを使用して導出される大きな機密性と整合性の制限を使用できます。

For AEAD_AES_128_GCM and AEAD_AES_256_GCM, the message length (l) is the length of the associated data in blocks plus the length of the plaintext in blocks.


For AEAD_AES_128_CCM, the total number of block cipher operations is the sum of the following: the length of the associated data in blocks, the length of the ciphertext in blocks, the length of the plaintext in blocks, plus 1. In this analysis, this is simplified to a value of twice the length of the packet in blocks (that is, "2l = 2^8" for packets that are limited to 2^11 bytes, or "2l = 2^13" otherwise). This simplification is based on the packet containing all of the associated data and ciphertext. This results in a one to three block overestimation of the number of operations per packet.

AEAD_AES_128_CCMの場合、ブロック暗号化操作の総数は、以下の合計です。ブロック内のパケットの長さの2倍の値(つまり、2^11バイトに制限されているパケットの場合は「2l = 2^8」、またはそうでない場合は「2l = 2^13」)の値に簡素化されています。この単純化は、関連するデータと暗号文のすべてを含むパケットに基づいています。これにより、パケットごとの操作数が1から3ブロックの過大評価になります。

B.1. Analysis of AEAD_AES_128_GCM and AEAD_AES_256_GCM Usage Limits
B.1. AEAD_AES_128_GCMおよびAEAD_AES_256_GCM使用制限の分析

[GCM-MU] specifies concrete bounds for AEAD_AES_128_GCM and AEAD_AES_256_GCM as used in TLS 1.3 and QUIC. This section documents this analysis using several simplifying assumptions:

[GCM-MU]は、TLS 1.3およびQUICで使用されているAEAD_AES_128_GCMおよびAEAD_AES_256_GCMの具体的な境界を指定します。このセクションでは、この分析をいくつか単純化してこの分析を説明します。

* The number of ciphertext blocks an attacker uses in forgery attempts is bounded by v * l, which is the number of forgery attempts multiplied by the size of each packet (in blocks).

* CipherTextブロックの数は、偽造試行での攻撃者が v * l によって制限されます。これは、各パケットのサイズ(ブロック内)のサイズを掛けた偽造試行の数です。

* The amount of offline work done by an attacker does not dominate other factors in the analysis.

* 攻撃者によって行われたオフライン作業の量は、分析における他の要因を支配しません。

The bounds in [GCM-MU] are tighter and more complete than those used in [AEBounds], which allows for larger limits than those described in [TLS13].


B.1.1. Confidentiality Limit
B.1.1. 機密性の制限

For confidentiality, Theorem (4.3) in [GCM-MU] establishes that, for a single user that does not repeat nonces, the dominant term in determining the distinguishing advantage between a real and random AEAD algorithm gained by an attacker is:


   2 * (q * l)^2 / 2^n

For a target advantage of 2^-57, this results in the relation:


   q <= 2^35 / l

Thus, endpoints that do not send packets larger than 2^11 bytes cannot protect more than 2^28 packets in a single connection without causing an attacker to gain a more significant advantage than the target of 2^-57. The limit for endpoints that allow for the packet size to be as large as 2^16 is instead 2^23.


B.1.2. Integrity Limit
B.1.2. 完全性の制限

For integrity, Theorem (4.3) in [GCM-MU] establishes that an attacker gains an advantage in successfully forging a packet of no more than the following:


   (1 / 2^(8 * n)) + ((2 * v) / 2^(2 * n))
           + ((2 * o * v) / 2^(k + n)) + (n * (v + (v * l)) / 2^k)

The goal is to limit this advantage to 2^-57. For AEAD_AES_128_GCM, the fourth term in this inequality dominates the rest, so the others can be removed without significant effect on the result. This produces the following approximation:


   v <= 2^64 / l

Endpoints that do not attempt to remove protection from packets larger than 2^11 bytes can attempt to remove protection from at most 2^57 packets. Endpoints that do not restrict the size of processed packets can attempt to remove protection from at most 2^52 packets.


For AEAD_AES_256_GCM, the same term dominates, but the larger value of k produces the following approximation:


   v <= 2^192 / l

This is substantially larger than the limit for AEAD_AES_128_GCM. However, this document recommends that the same limit be applied to both functions as either limit is acceptably large.


B.2. Analysis of AEAD_AES_128_CCM Usage Limits
B.2. AEAD_AES_128_CCM使用制限の分析

TLS [TLS13] and [AEBounds] do not specify limits on usage for AEAD_AES_128_CCM. However, any AEAD that is used with QUIC requires limits on use that ensure that both confidentiality and integrity are preserved. This section documents that analysis.

TLS [TLS13]と[AEBounds]は、AEAD_AES_128_CCMの使用上の制限を指定しません。ただし、QUICで使用されるAEADは、機密性と完全性の両方が保存されていることを保証する使用時の制限が必要です。このセクションはその分析を文書化しています。

[CCM-ANALYSIS] is used as the basis of this analysis. The results of that analysis are used to derive usage limits that are based on those chosen in [TLS13].


For confidentiality, Theorem 2 in [CCM-ANALYSIS] establishes that an attacker gains a distinguishing advantage over an ideal pseudorandom permutation (PRP) of no more than the following:


   (2l * q)^2 / 2^n

The integrity limit in Theorem 1 in [CCM-ANALYSIS] provides an attacker a strictly higher advantage for the same number of messages. As the targets for the confidentiality advantage and the integrity advantage are the same, only Theorem 1 needs to be considered.


Theorem 1 establishes that an attacker gains an advantage over an ideal PRP of no more than the following:


   v / 2^t + (2l * (v + q))^2 / 2^n

As "t" and "n" are both 128, the first term is negligible relative to the second, so that term can be removed without a significant effect on the result.


This produces a relation that combines both encryption and decryption attempts with the same limit as that produced by the theorem for confidentiality alone. For a target advantage of 2^-57, this results in the following:


   v + q <= 2^34.5 / l

By setting "q = v", values for both confidentiality and integrity limits can be produced. Endpoints that limit packets to 2^11 bytes therefore have both confidentiality and integrity limits of 2^26.5 packets. Endpoints that do not restrict packet size have a limit of 2^21.5.

「q = v」を設定することで、機密性と整合性の両方の値の値を生成することができます。したがって、パケットを2^11バイトに制限するエンドポイントは、2^26.5パケットの機密性と整合性の両方の制限を持ちます。パケットサイズを制限しないエンドポイントには、2^21.5の制限があります。



The IETF QUIC Working Group received an enormous amount of support from many people. The following people provided substantive contributions to this document:


* Adam Langley * Alessandro Ghedini * Christian Huitema * Christopher Wood * David Schinazi * Dragana Damjanovic * Eric Rescorla * Felix Günther * Ian Swett * Jana Iyengar * 奥 一穂 (Kazuho Oku) * Marten Seemann * Martin Duke * Mike Bishop * Mikkel Fahnøe Jørgensen * Nick Banks * Nick Harper * Roberto Peon * Rui Paulo * Ryan Hamilton * Victor Vasiliev

* Adam Langley * Alessandro Ghedini * Christian Huitema * Christopher Wood * David Schinazi * Dragana Damjanovic * Eric Rescorla * Felix Günther * Ian Swett * Jana Iyengar * 奥 一穂 (Kazuho Oku) * Marten Seemann * Martin Duke * Mike Bishop * Mikkel Fahnøe Jørgensen * Nick Banks * Nick Harper * Roberto Peon * Rui Paulo * Ryan Hamilton * Victor Vasiliev

Authors' Addresses


Martin Thomson (editor) Mozilla

Martin Thomson(編集)Mozilla.


Sean Turner (editor) sn3rd

Sean Turner(編集)sn3rd