]> Cypherpunks repositories - gostls13.git/commitdiff
crypto/tls: reject empty TLS 1.3 session ticket
authorDaniel McCarney <daniel@binaryparadox.net>
Mon, 17 Feb 2025 16:45:23 +0000 (11:45 -0500)
committerGopher Robot <gobot@golang.org>
Mon, 10 Mar 2025 21:02:22 +0000 (14:02 -0700)
While not clearly motivated by normative language in RFC 8446 it seems
clear that an empty opaque ticket value is non-operable, and so we
should reject it with an appropriate alert/error.

This allows removing the SendEmptySessionTicket-TLS13 BoGo test from the
bogo excluded tests configuration.

Fixes #70513
Updates #72006

Change-Id: I589b34e86fb1eb27a349a230e920c22284597cde
Reviewed-on: https://go-review.googlesource.com/c/go/+/650735
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Roland Shoemaker <roland@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
Auto-Submit: Daniel McCarney <daniel@binaryparadox.net>

src/crypto/tls/bogo_config.json
src/crypto/tls/handshake_client_tls13.go

index 6472512158c444700d44b38a6fc7f01b52f23769..f4772a00b200f4234b8d2378f988eea19bd4882f 100644 (file)
@@ -38,8 +38,6 @@
         "PostQuantumNotEnabledByDefaultInClients": "We do enable it by default!",
         "*-Kyber-TLS13": "We don't support Kyber, only ML-KEM (BoGo bug ignoring AllCurves?)",
 
-        "SendEmptySessionTicket-TLS13": "https://github.com/golang/go/issues/70513",
-
         "*-SignDefault-*": "TODO, partially it encodes BoringSSL defaults, partially we might be missing some implicit behavior of a missing flag",
 
         "V2ClientHello-*": "We don't support SSLv2",
index c0396e75796add3b66d87dc5129bad258f155052..fadca22e60eecf61cd3d4bdac9bad90b2bd8480a 100644 (file)
@@ -870,6 +870,11 @@ func (c *Conn) handleNewSessionTicket(msg *newSessionTicketMsgTLS13) error {
                return errors.New("tls: received a session ticket with invalid lifetime")
        }
 
+       if len(msg.label) == 0 {
+               c.sendAlert(alertDecodeError)
+               return errors.New("tls: received a session ticket with empty opaque ticket label")
+       }
+
        // RFC 9001, Section 4.6.1
        if c.quic != nil && msg.maxEarlyData != 0 && msg.maxEarlyData != 0xffffffff {
                c.sendAlert(alertIllegalParameter)