0
0
mirror of https://github.com/XTLS/REALITY.git synced 2025-08-22 06:28:35 +00:00

crypto/tls: signature_algorithms in CertificateRequest can't be empty

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>
This commit is contained in:
yuhan6665 2025-05-25 16:05:54 -04:00
parent c169f1395b
commit e679ef7bb1

View 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) {