Skip to content

Commit d382f14

Browse files
committed
crypto/tls: use illegal param alert for bad compression
Previously if the clientHandshakeState for the TLS 1.2 client code encountered a server helo message that contained a compression method other than compressionNone, we would emit an unexpected message alert. Instead, it seems more appropriate to return an illegal parameter alert. The server hello message _was_ expected, it just contained a bad parameter option. Making this change also allows enabling the InvalidCompressionMethod bogo test. Updates #72006 Change-Id: I27a2cd231e4b8762b0d9e2dbd3d8ddd5b87fd5c3 Reviewed-on: https://go-review.googlesource.com/c/go/+/669155 Reviewed-by: Roland Shoemaker <roland@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
1 parent 2f2f8fe commit d382f14

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

src/crypto/tls/bogo_config.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@
6565
"NoNullCompression-TLS12": "TODO: first pass, this should be fixed",
6666
"KeyUpdate-RequestACK": "TODO: first pass, this should be fixed",
6767
"TLS13-HRR-InvalidCompressionMethod": "TODO: first pass, this should be fixed",
68-
"InvalidCompressionMethod": "TODO: first pass, this should be fixed",
6968
"TLS-TLS12-RSA_WITH_AES_128_GCM_SHA256-LargeRecord": "TODO: first pass, this should be fixed",
7069
"TLS-TLS1-RSA_WITH_AES_128_CBC_SHA-LargeRecord": "TODO: first pass, this should be fixed",
7170
"TLS-TLS11-RSA_WITH_AES_128_CBC_SHA-LargeRecord": "TODO: first pass, this should be fixed",

src/crypto/tls/handshake_client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -889,7 +889,7 @@ func (hs *clientHandshakeState) processServerHello() (bool, error) {
889889
}
890890

891891
if hs.serverHello.compressionMethod != compressionNone {
892-
c.sendAlert(alertUnexpectedMessage)
892+
c.sendAlert(alertIllegalParameter)
893893
return false, errors.New("tls: server selected unsupported compression format")
894894
}
895895

0 commit comments

Comments
 (0)