Skip to content
Snippets Groups Projects
Commit d382f146 authored by Daniel McCarney's avatar Daniel McCarney
Browse files

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: default avatarRoland Shoemaker <roland@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: default avatarCherry Mui <cherryyz@google.com>
parent 2f2f8fe2
No related branches found
No related tags found
No related merge requests found
...@@ -65,7 +65,6 @@ ...@@ -65,7 +65,6 @@
"NoNullCompression-TLS12": "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", "KeyUpdate-RequestACK": "TODO: first pass, this should be fixed",
"TLS13-HRR-InvalidCompressionMethod": "TODO: first pass, this should be fixed", "TLS13-HRR-InvalidCompressionMethod": "TODO: first pass, this should be fixed",
"InvalidCompressionMethod": "TODO: first pass, this should be fixed",
"TLS-TLS12-RSA_WITH_AES_128_GCM_SHA256-LargeRecord": "TODO: first pass, this should be fixed", "TLS-TLS12-RSA_WITH_AES_128_GCM_SHA256-LargeRecord": "TODO: first pass, this should be fixed",
"TLS-TLS1-RSA_WITH_AES_128_CBC_SHA-LargeRecord": "TODO: first pass, this should be fixed", "TLS-TLS1-RSA_WITH_AES_128_CBC_SHA-LargeRecord": "TODO: first pass, this should be fixed",
"TLS-TLS11-RSA_WITH_AES_128_CBC_SHA-LargeRecord": "TODO: first pass, this should be fixed", "TLS-TLS11-RSA_WITH_AES_128_CBC_SHA-LargeRecord": "TODO: first pass, this should be fixed",
......
...@@ -889,7 +889,7 @@ func (hs *clientHandshakeState) processServerHello() (bool, error) { ...@@ -889,7 +889,7 @@ func (hs *clientHandshakeState) processServerHello() (bool, error) {
} }
if hs.serverHello.compressionMethod != compressionNone { if hs.serverHello.compressionMethod != compressionNone {
c.sendAlert(alertUnexpectedMessage) c.sendAlert(alertIllegalParameter)
return false, errors.New("tls: server selected unsupported compression format") return false, errors.New("tls: server selected unsupported compression format")
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment