From d5bfdcbc47c4ab7943ce40ad34d0d4acf13cb33d Mon Sep 17 00:00:00 2001 From: Roland Shoemaker Date: Sun, 16 Nov 2025 16:09:16 -0800 Subject: [PATCH] [release-branch.go1.25] 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. Updates #76283 Fixes #76409 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 (cherry picked from commit 31aa9f800bc8d4089e05b8726b599abe04a486a3) Reviewed-on: https://go-review.googlesource.com/c/go/+/726380 Reviewed-by: Dmitri Shuralyov Auto-Submit: Dmitri Shuralyov --- src/crypto/tls/handshake_client.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/crypto/tls/handshake_client.go b/src/crypto/tls/handshake_client.go index 90c5bdacd8..8d09d18652 100644 --- a/src/crypto/tls/handshake_client.go +++ b/src/crypto/tls/handshake_client.go @@ -317,7 +317,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) -- 2.52.0