From 460029c4e7cbf6cd80a6ae090a4c4d11b24ad896 Mon Sep 17 00:00:00 2001 From: yuhan6665 <1588741+yuhan6665@users.noreply.github.com> Date: Thu, 16 Apr 2026 23:05:07 -0400 Subject: [PATCH] crypto/tls: use inner hello for earlyData when using QUIC and ECH I don't think we have good QUIC ECH tests. BoGo has some for this, but I'm not sure how easy it would be to enable those for QUIC. Fixes #76283 Change-Id: I0ffa535fd89a624b7f9bfd73441ce2a1683e0549 Reviewed-on: https://go-review.googlesource.com/c/go/+/720920 LUCI-TryBot-Result: Go LUCI Auto-Submit: Roland Shoemaker Reviewed-by: Damien Neil --- handshake_client.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/handshake_client.go b/handshake_client.go index c6c9e1d..a2feea3 100644 --- a/handshake_client.go +++ b/handshake_client.go @@ -309,7 +309,11 @@ func (c *Conn) clientHandshake(ctx context.Context) (err error) { if hello.earlyData { suite := cipherSuiteTLS13ByID(session.cipherSuite) transcript := suite.hash.New() - if err := transcriptMsg(hello, transcript); err != nil { + transcriptHello := hello + if ech != nil { + transcriptHello = ech.innerHello + } + if err := transcriptMsg(transcriptHello, transcript); err != nil { return err } earlyTrafficSecret := earlySecret.ClientEarlyTrafficSecret(transcript)