@@ -317,7 +317,7 @@ ensures that TLS handshake messages are delivered in the correct order.
317
317
318
318
QUIC Frames <any> @1
319
319
<--------
320
- @1 QUIC STREAM Frame(s) <1>:
320
+ @C QUIC STREAM Frame(s) <1>:
321
321
(EndOfEarlyData)
322
322
{Finished}
323
323
-------->
@@ -337,7 +337,7 @@ In {{quic-tls-handshake}}, symbols mean:
337
337
338
338
If 0-RTT is not attempted, then the client does not send packets protected by
339
339
the 0-RTT key (@0). In that case, the only key transition on the client is from
340
- unprotected packets (@C) to 1-RTT protection (@1), which happens before it sends
340
+ unprotected packets (@C) to 1-RTT protection (@1), which happens after it sends
341
341
its final set of TLS handshake messages.
342
342
343
343
The server sends TLS handshake messages without protection (@C). The server
@@ -350,7 +350,7 @@ QUIC. QUIC packets from the server are sent in the clear until the final
350
350
transition to 1-RTT keys.
351
351
352
352
The client transitions from cleartext (@C) to 0-RTT keys (@0) when sending 0-RTT
353
- data, and subsequently to to 1-RTT keys (@1) for its second flight of TLS
353
+ data, and subsequently to to 1-RTT keys (@1) after its second flight of TLS
354
354
handshake messages. This creates the potential for unprotected packets to be
355
355
received by a server in close proximity to packets that are protected with 1-RTT
356
356
keys.
@@ -460,14 +460,14 @@ TLS provides QUIC with signals when 0-RTT and 1-RTT keys are ready for use.
460
460
These events are not asynchronous, they always occur immediately after TLS is
461
461
provided with new handshake octets, or after TLS produces handshake octets.
462
462
463
- When TLS has enough information to generate 1-RTT keys, it indicates their
464
- availability. On the client, this occurs after receiving the entirety of the
465
- first flight of TLS handshake messages from the server. A server indicates that
466
- 1-RTT keys are available after it sends its handshake messages.
463
+ When TLS completed its handshake, 1-RTT keys can be provided to QUIC. On both
464
+ client and server, this occurs after sending the TLS Finished message.
467
465
468
- This ordering ensures that a client sends its second flight of handshake
469
- messages protected with 1-RTT keys. More importantly, it ensures that the
470
- server sends its flight of handshake messages without protection.
466
+ This ordering means that there could be frames that carry TLS handshake messages
467
+ ready to send at the same time that application data is available. An
468
+ implementation MUST ensure that TLS handshake messages are always sent in
469
+ cleartext packets. Separate packets are required for data that needs protection
470
+ from 1-RTT keys.
471
471
472
472
If 0-RTT is possible, it is ready after the client sends a TLS ClientHello
473
473
message or the server receives that message. After providing a QUIC client with
@@ -501,9 +501,9 @@ Get Handshake
501
501
1-RTT Keys Ready
502
502
<--- send/receive ---
503
503
Handshake Received
504
- 1-RTT Keys Ready
505
504
Get Handshake
506
505
Handshake Complete
506
+ 1-RTT Keys Ready
507
507
--- send/receive --->
508
508
Handshake Received
509
509
Get Handshake
@@ -648,8 +648,8 @@ packets sent by the client.
648
648
649
649
1-RTT keys are used by both client and server after the TLS handshake completes.
650
650
There are two secrets used at any time : one is used to derive packet protection
651
- keys for packets sent by the client, the other for protecting packets sent by
652
- the server.
651
+ keys for packets sent by the client, the other for packet protection keys on
652
+ packets sent by the server.
653
653
654
654
The initial client packet protection secret is exported from TLS using the
655
655
exporter label "EXPORTER-QUIC client 1-RTT Secret"; the initial server packet
@@ -840,19 +840,15 @@ ensure that TLS handshake messages are sent with the correct packet protection.
840
840
The initial exchange of packets are sent without protection. These packets are
841
841
marked with a KEY_PHASE of 0.
842
842
843
- TLS handshake messages that are critical to the TLS key exchange cannot be
844
- protected using QUIC packet protection. A KEY_PHASE of 0 is used for all of
845
- these packets, even during retransmission. The messages critical to key
846
- exchange are the TLS ClientHello and any TLS handshake message from the server,
847
- except those that are sent after the handshake completes, such as
848
- NewSessionTicket.
843
+ TLS handshake messages MUST NOT be protected using QUIC packet protection. A
844
+ KEY_PHASE of 0 is used for all of these packets, even during retransmission.
845
+ The messages affected are all TLS handshake message up to the TLS Finished that
846
+ is sent by each endpoint.
849
847
850
- The second flight of TLS handshake messages from the client, and any TLS
851
- handshake messages that are sent after completing the TLS handshake do not need
852
- special packet protection rules. This includes the EndOfEarlyData message that
853
- is sent by a client to mark the end of its 0-RTT data. Packets containing these
854
- messages use the packet protection keys that are current at the time of sending
855
- (or retransmission).
848
+ Any TLS handshake messages that are sent after completing the TLS handshake do
849
+ not need special packet protection rules. Packets containing these messages use
850
+ the packet protection keys that are current at the time of sending (or
851
+ retransmission).
856
852
857
853
Like the client, a server MUST send retransmissions of its unprotected handshake
858
854
messages or acknowledgments for unprotected handshake messages sent by the
@@ -861,27 +857,25 @@ client in unprotected packets (KEY_PHASE=0).
861
857
862
858
# ## Initial Key Transitions {#first-keys}
863
859
864
- Once the TLS key exchange is complete, keying material is exported from TLS and
860
+ Once the TLS handshake is complete, keying material is exported from TLS and
865
861
QUIC packet protection commences.
866
862
867
863
Packets protected with 1-RTT keys have a KEY_PHASE bit set to 1. These packets
868
864
also have a VERSION bit set to 0.
869
865
870
- If the client is unable to send 0-RTT data - or it does not have 0-RTT data to
871
- send - packet protection with 1-RTT keys starts with the packets that contain
872
- its second flight of TLS handshake messages. That is, the flight containing the
873
- TLS Finished handshake message and optionally a Certificate and
874
- CertificateVerify message.
875
-
876
866
If the client sends 0-RTT data, it marks packets protected with 0-RTT keys with
877
867
a KEY_PHASE of 1 and a VERSION bit of 1. Setting the version bit means that all
878
- packets also include the version field. The client removes the VERSION bit when
879
- it transitions to using 1-RTT keys, but it does not change the KEY_PHASE bit.
868
+ packets also include the version field. The client retains the VERSION bit, but
869
+ reverts the KEY_PHASE bit for the packet that contains the TLS EndOfEarlyData
870
+ and Finished messages.
871
+
872
+ The client clears the VERSION bit and sets the KEY_PHASE bit to 1 when it
873
+ transitions to using 1-RTT keys.
880
874
881
875
Marking 0-RTT data with the both KEY_PHASE and VERSION bits ensures that the
882
- server is able to identify these packets as 0-RTT data in case the packet
883
- containing the TLS ClientHello is lost or delayed. Including the version also
884
- ensures that the packet format is known to the server in this case.
876
+ server is able to identify these packets as 0-RTT data in case packets
877
+ containing TLS handshake message are lost or delayed. Including the version
878
+ also ensures that the packet format is known to the server in this case.
885
879
886
880
Using both KEY_PHASE and VERSION also ensures that the server is able to
887
881
distinguish between cleartext handshake packets (KEY_PHASE=0, VERSION=1), 0-RTT
@@ -905,26 +899,16 @@ KEY_PHASE of 1.
905
899
906
900
# ## Retransmission and Acknowledgment of Unprotected Packets
907
901
908
- The first flight of TLS handshake messages from both client and server
909
- (ClientHello, or ServerHello through to the server's Finished) are critical to
910
- the key exchange. The contents of these messages determines the keys used to
911
- protect later messages. If these handshake messages are included in packets
912
- that are protected with these keys, they will be indecipherable to the
913
- recipient.
902
+ TLS handshake messages from both client and server are critical to the key
903
+ exchange. The contents of these messages determines the keys used to protect
904
+ later messages. If these handshake messages are included in packets that are
905
+ protected with these keys, they will be indecipherable to the recipient.
914
906
915
907
Even though newer keys could be available when retranmitting, retransmissions of
916
908
these handshake messages MUST be sent in unprotected packets (with a KEY_PHASE
917
909
of 0). An endpoint MUST also generate ACK frames for these messages that are
918
910
sent in unprotected packets.
919
911
920
- The TLS handshake messages that are affected by this rule are specifically :
921
-
922
- * A client MUST NOT restransmit a TLS ClientHello with 0-RTT keys. The server
923
- needs this message in order to determine the 0-RTT keys.
924
-
925
- * A server MUST NOT retransmit any of its TLS handshake messages with 1-RTT
926
- keys. The client needs these messages in order to determine the 1-RTT keys.
927
-
928
912
A HelloRetryRequest handshake message might be used to reject an initial
929
913
ClientHello. A HelloRetryRequest handshake message and any second ClientHello
930
914
that is sent in response MUST also be sent without packet protection. This is
@@ -933,12 +917,6 @@ need to be sent. Upon receipt of a HelloRetryRequest, a client SHOULD cease any
933
917
transmission of 0-RTT data; 0-RTT data will only be discarded by any server that
934
918
sends a HelloRetryRequest.
935
919
936
- Note :
937
-
938
- : TLS handshake data that needs to be sent without protection is all the
939
- handshake data acquired from TLS before the point that 1-RTT keys are provided
940
- by TLS (see {{key-ready-events}}).
941
-
942
920
The KEY_PHASE and VERSION bits ensure that protected packets are clearly
943
921
distinguished from unprotected packets. Loss or reordering might cause
944
922
unprotected packets to arrive once 1-RTT keys are in use, unprotected packets
0 commit comments