Repository navigation
Description
Retry must reuse the same handshake message
- Recheck Status:
confirmed_on_2026-08-12
Standard Requirement
- RFC 9000 Section 17.2.5: Retry Packet
- RFC 9001 Section 4.1.1: Handshake Initiation
- RFC 9000 Section 17.2.2.1: Abandoning Initial Packets
- RFC 9001 Section 4.7: HelloRetryRequest
- RFC 8446 Section 4.1.2: ClientHello
RFC 9000 says that after Retry, the client remains constrained by the original Initial except for updating the Destination Connection ID and Token. The normative sentence is that a client MUST use the same cryptographic handshake message.
For QUIC over TLS, RFC 9001 makes that first handshake message the TLS ClientHello. If TLS genuinely needs new handshake input, such as a new key_share, that is driven by TLS HelloRetryRequest, not by QUIC Retry. QUIC Retry is address validation; it is not permission to generate a new ClientHello.
Relevant Source Code
quiche/src/lib.rs:3084-3138: after receiving Retry,quichesaves the new token and DCID, then executesdrop_epoch_state(packet::Epoch::Initial, now)andself.handshake.clear()?.quiche/src/packet.rs:942-953:CryptoContext::clear()rebuilds an empty Initialcrypto_stream, discarding the previous Initial CRYPTO buffer.quiche/src/tls/mod.rs:593-596:handshake.clear()callsSSL_clear(), resetting TLS handshake state.quiche/src/lib.rs:3968-3971,quiche/src/lib.rs:8037-8044,quiche/src/tls/mod.rs:851-879: the nextsend()runsSSL_do_handshake()again and writes newly generated handshake bytes into the Initial CRYPTO stream throughadd_handshake_data().
The effective behavior is to discard the old Initial handshake bytes and generate a new ClientHello, rather than reusing the same handshake message from the first Initial.
Runtime Evidence
I ran:
cargo test -p quiche retry_preserves_initial_crypto_message --lib -- --nocapture
The probe performed these steps:
- Send the first client Initial.
- Read the Initial-space CRYPTO byte stream.
- Inject a valid Retry with a 1024-byte token.
- Send the client Initial again.
- Read the Initial-space CRYPTO byte stream again.
- Compare the two byte streams for exact equality.
Observed output:
cubic: Retry changed Initial CRYPTO bytes at offset 6 (first_len=229, second_len=229, first_byte=20, second_byte=0e)
bbr2_gcongestion: Retry changed Initial CRYPTO bytes at offset 6 (first_len=229, second_len=229, first_byte=85, second_byte=63)
RFC 8446 Section 4.1.2 defines the TLS ClientHello layout as a 4-byte handshake header, then a 2-byte legacy_version, then Random random. The first difference at offset 6 therefore falls inside ClientHello.random, not merely in the outer QUIC Initial wrapper.
Assessment
- Retry permits changing
DCIDandToken; it does not permit replacing theClientHello. quicheclears Initial CRYPTO and TLS state on Retry, then regenerates the handshake message.- The runtime result directly shows that the Initial CRYPTO bytes differ before and after Retry, starting in
ClientHello.random.
This is a real standards violation and should be treated as a standards violation.
Cleanup
The temporary probe was removed. A follow-up run of cargo test -p quiche retry --lib -- --nocapture passed with 18 passed; 0 failed.
Activity
ghedo commentedon Nov 25, 2026
Closing as a duplicate of #1375, which reports the same regenerated ClientHello after a Retry. #1886 proposes keeping the original handshake message.