Skip to content

Only compress ALPN for standard ClientHellos where inner and outer match - #436

Open
wwqgtxx wants to merge 1 commit into
refraction-networking:masterfrom
wwqgtxx:patch-2
Open

wwqgtxx wants to merge 1 commit into
refraction-networking:masterfrom
wwqgtxx:patch-2

Conversation

@wwqgtxx

@wwqgtxx wwqgtxx commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

The issue stems from the order of extensions. In the standard ECH encoding, a contiguous sequence of extensions is compressed together and subsequently expanded by the server at the position of the outer_extensions placeholder. With the current change, ALPN is encoded directly, while other extensions remain in the placeholder section. This can lead to the following discrepancy:

Original Inner ClientHello: … supported_groups → signature_algorithms → ALPN → …
Reconstructed Inner ClientHello (Server-side): … ALPN → supported_groups → signature_algorithms → …

Although the content of the fields remains identical, the TLS transcript hash is computed over the raw bytes of the entire message—which includes the order of the extensions.

In the standard workflow, the transcript is computed directly from the original innerHello (see handshake_client_tls13.go:75). Consequently, while the server accepts the ECH, the client fails to correctly verify the acceptance confirmation, leading to a divergence in handshake state and key derivation between the two parties.

This affects only:
Conn
UConn + HelloGolang

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant