]> Cypherpunks repositories - gostls13.git/commitdiff
crypto/tls: match compression method alert across versions
authorDaniel McCarney <daniel@binaryparadox.net>
Fri, 16 May 2025 17:44:53 +0000 (13:44 -0400)
committerDaniel McCarney <daniel@binaryparadox.net>
Wed, 21 May 2025 19:58:42 +0000 (12:58 -0700)
When a pre-TLS 1.3 server processes a client hello message that
indicates compression methods that don't include the null compression
method, send an illegal parameter alert.

Previously we did this for TLS 1.3 server handshakes only, and the
legacy TLS versions used alertHandshakeFailure for this circumstance. By
switching this to alertIllegalParameter we use a consistent alert across
all TLS versions, and can also enable the NoNullCompression-TLS12 BoGo
test we were skipping.

Updates #72006

Change-Id: I27a2cd231e4b8762b0d9e2dbd3d8ddd5b87fd5ce
Reviewed-on: https://go-review.googlesource.com/c/go/+/673736
TryBot-Bypass: Daniel McCarney <daniel@binaryparadox.net>
Reviewed-by: Roland Shoemaker <roland@golang.org>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Reviewed-by: David Chase <drchase@google.com>
src/crypto/tls/bogo_config.json
src/crypto/tls/handshake_server.go

index ba1dce87610fc6dacf771ac978c75abb629b4eba..64781b3fbaee5fc070c6aa26b19b0e32b3d1f430 100644 (file)
@@ -63,7 +63,6 @@
         "CheckLeafCurve": "TODO: first pass, this should be fixed",
         "DisabledCurve-HelloRetryRequest-TLS13": "TODO: first pass, this should be fixed",
         "SupportTicketsWithSessionID": "TODO: first pass, this should be fixed",
-        "NoNullCompression-TLS12": "TODO: first pass, this should be fixed",
         "KeyUpdate-RequestACK": "TODO: first pass, this should be fixed",
         "SupportedVersionSelection-TLS12": "TODO: first pass, this should be fixed",
         "DuplicateExtensionServer-TLS-TLS1": "TODO: first pass, this should be fixed",
index c2c924c07bced3d7804b4b05471455d48c4b30e8..d7fadcbd59017a97d88f816153cd8e98acc33f24 100644 (file)
@@ -233,7 +233,7 @@ func (hs *serverHandshakeState) processClientHello() error {
        }
 
        if !foundCompression {
-               c.sendAlert(alertHandshakeFailure)
+               c.sendAlert(alertIllegalParameter)
                return errors.New("tls: client does not support uncompressed connections")
        }