Skip to content

Retry must reuse the same handshake message #2658

Duplicate

Description

@LiD0209

Retry must reuse the same handshake message

  • Recheck Status: confirmed_on_2026-08-12

Standard Requirement

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, quiche saves the new token and DCID, then executes drop_epoch_state(packet::Epoch::Initial, now) and self.handshake.clear()?.
  • quiche/src/packet.rs:942-953: CryptoContext::clear() rebuilds an empty Initial crypto_stream, discarding the previous Initial CRYPTO buffer.
  • quiche/src/tls/mod.rs:593-596: handshake.clear() calls SSL_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 next send() runs SSL_do_handshake() again and writes newly generated handshake bytes into the Initial CRYPTO stream through add_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:

  1. Send the first client Initial.
  2. Read the Initial-space CRYPTO byte stream.
  3. Inject a valid Retry with a 1024-byte token.
  4. Send the client Initial again.
  5. Read the Initial-space CRYPTO byte stream again.
  6. 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 DCID and Token; it does not permit replacing the ClientHello.
  • quiche clears 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

  1. added
    type: bugfix
    area: tls
    on Nov 24, 2026
  2. ghedo commented on Nov 25, 2026

    @ghedo
    Member

    Closing as a duplicate of #1375, which reports the same regenerated ClientHello after a Retry. #1886 proposes keeping the original handshake message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: tlstype: bugfix

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions