]> Cypherpunks repositories - gostls13.git/commit
crypto/tls: empty server_name conf. ext. from server
authorDaniel McCarney <daniel@binaryparadox.net>
Sat, 28 Jun 2025 18:29:48 +0000 (14:29 -0400)
committerGopher Robot <gobot@golang.org>
Wed, 9 Jul 2025 15:28:24 +0000 (08:28 -0700)
commit67c1704444ba9661699a80d0ea0a2df20b4107e2
treeb231ac003b4a43496ba02d32d0cfb85dd96af3b0
parent54c9d776302d53ab1907645cb67fa4a948e1500c
crypto/tls: empty server_name conf. ext. from server

When a TLS server uses the information from the server_name extension in
a client hello, and the connection isn't resuming, it should return an
empty server_name extension in its server hello (or encrypted extensions
for TLS 1.3).

For TLS <1.3 we we do this in doFullHandshake(), by setting the
pre-existing serverHelloMsg.serverNameAck bool. We know that the
connection isn't resuming based on the context where this function is
called.

For TLS 1.3, a new encryptedExtensionsMsg.serverNameAck bool is added,
and populated as appropriate in sendServerParameters() based on whether
the conn was resumed or not. The encryptedExtensionsMsg marshalling is
updated to emit the encrypted extension based on that field.

These changes allow enabling the ServerNameExtensionServer-* bogo tests
that verify both the presence and absence of the server_name extension
based on the relevant specifications.

Resolves #74282
Updates #72006

Change-Id: I703bc2ec916b50906bdece7b7483a7faed7aa8e4
Reviewed-on: https://go-review.googlesource.com/c/go/+/684795
TryBot-Bypass: Daniel McCarney <daniel@binaryparadox.net>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Roland Shoemaker <roland@golang.org>
Auto-Submit: Daniel McCarney <daniel@binaryparadox.net>
src/crypto/tls/bogo_config.json
src/crypto/tls/handshake_messages.go
src/crypto/tls/handshake_server.go
src/crypto/tls/handshake_server_tls13.go
src/crypto/tls/testdata/Server-TLSv12-SNI
src/crypto/tls/testdata/Server-TLSv12-SNI-GetCertificate
src/crypto/tls/testdata/Server-TLSv12-SNI-GetCertificateNotFound