]> Cypherpunks repositories - gostls13.git/commitdiff
crypto/tls: signature_algorithms in CertificateRequest can't be empty
authorFilippo Valsorda <filippo@golang.org>
Wed, 21 May 2025 20:41:54 +0000 (22:41 +0200)
committerGopher Robot <gobot@golang.org>
Sat, 24 May 2025 00:06:24 +0000 (17:06 -0700)
Change-Id: I6a6a4656ab97e1f247df35b2589cd73461b4ac76
Reviewed-on: https://go-review.googlesource.com/c/go/+/675917
Auto-Submit: Filippo Valsorda <filippo@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Daniel McCarney <daniel@binaryparadox.net>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

src/crypto/tls/handshake_messages.go

index ad3e5fa352f33d2cc76eb3bf6776b2ae1d7120fe..d9a475aab14b22ef4734890e89259cfee47a69ae 100644 (file)
@@ -1790,7 +1790,7 @@ func (m *certificateRequestMsg) unmarshal(data []byte) bool {
                }
                sigAndHashLen := uint16(data[0])<<8 | uint16(data[1])
                data = data[2:]
-               if sigAndHashLen&1 != 0 {
+               if sigAndHashLen&1 != 0 || sigAndHashLen == 0 {
                        return false
                }
                if len(data) < int(sigAndHashLen) {