]> Cypherpunks repositories - gostls13.git/commit
crypto/tls: add ConnectionState.CurveID
authorFilippo Valsorda <filippo@golang.org>
Thu, 27 Feb 2025 13:01:13 +0000 (14:01 +0100)
committerGopher Robot <gobot@golang.org>
Thu, 13 Mar 2025 15:19:32 +0000 (08:19 -0700)
commit6bd5741a4c600ee9a48dfa5244f0c4116b718404
tree573a786f2d483155bd7bc198e975a33484b0cca4
parentfbdd994166007349920592822e659d98b2d94ab6
crypto/tls: add ConnectionState.CurveID

This required adding a new field to SessionState for TLS 1.0–1.2, since
the key exchange is not repeated on resumption. The additional field is
unfortunately not backwards compatible because current Go versions check
that the encoding has no extra data at the end, but will cause
cross-version tickets to be ignored. Relaxed that so we can add fields
in a backwards compatible way the next time.

For the cipher suite, we check that the session's is still acceptable
per the Config. That would arguably make sense here, too: if a Config
for example requires PQ, we should reject resumptions of connections
that didn't use PQ. However, that only applies to pre-TLS 1.3
connections, since in TLS 1.3 we always do a fresh key exchange on
resumption. Since PQ is the only main differentiator between key
exchanges (aside from off-by-default non-PFS RSA, which are controlled
by the cipher suite in TLS 1.0–1.2) and it's PQ-only, we can skip that
check.

Fixes #67516

Change-Id: I6a6a465681a6292edf66c7b8df8f4aba4171a76b
Reviewed-on: https://go-review.googlesource.com/c/go/+/653315
Reviewed-by: David Chase <drchase@google.com>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Daniel McCarney <daniel@binaryparadox.net>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
18 files changed:
api/next/67516.txt [new file with mode: 0644]
doc/next/6-stdlib/99-minor/crypto/tls/67516.md [new file with mode: 0644]
src/crypto/tls/common.go
src/crypto/tls/conn.go
src/crypto/tls/handshake_client.go
src/crypto/tls/handshake_messages_test.go
src/crypto/tls/handshake_server.go
src/crypto/tls/handshake_server_test.go
src/crypto/tls/testdata/Server-TLSv10-ExportKeyingMaterial
src/crypto/tls/testdata/Server-TLSv12-ALPN
src/crypto/tls/testdata/Server-TLSv12-ALPN-Fallback
src/crypto/tls/testdata/Server-TLSv12-ALPN-NotConfigured
src/crypto/tls/testdata/Server-TLSv12-ExportKeyingMaterial
src/crypto/tls/testdata/Server-TLSv12-IssueTicket
src/crypto/tls/testdata/Server-TLSv12-IssueTicketPreDisable
src/crypto/tls/testdata/Server-TLSv12-Resume
src/crypto/tls/ticket.go
src/crypto/tls/tls_test.go