1
0
mirror of https://github.com/golang/go synced 2024-11-26 04:17:59 -07:00
go/src/crypto
Roland Shoemaker a98589711d crypto/tls: test key type when casting
When casting the certificate public key in generateClientKeyExchange,
check the type is appropriate. This prevents a panic when a server
agrees to a RSA based key exchange, but then sends an ECDSA (or
other) certificate.

Fixes #47143
Fixes CVE-2021-34558

Thanks to Imre Rad for reporting this issue.

Change-Id: Iabccacca6052769a605cccefa1216a9f7b7f6aea
Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1116723
Reviewed-by: Filippo Valsorda <valsorda@google.com>
Reviewed-by: Katie Hockman <katiehockman@google.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/334031
Trust: Filippo Valsorda <filippo@golang.org>
Run-TryBot: Filippo Valsorda <filippo@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-07-12 20:58:00 +00:00
..
aes all: go fmt std cmd (but revert vendor) 2021-02-20 03:54:50 +00:00
cipher all: add //go:build lines to assembly files 2021-05-13 09:12:17 +00:00
des crypto/des: fix typo in permuteInitialBlock function comments 2020-09-22 21:24:40 +00:00
dsa crypto/dsa,crypto/x509: deprecate DSA and remove crypto/x509 support 2020-10-02 10:48:33 +00:00
ecdsa crypto/ecdsa,crypto/elliptic: improve tests and benchmarks 2021-05-06 02:21:55 +00:00
ed25519 crypto/ed25519: skip allocations test on -noopt builder 2021-05-06 02:20:28 +00:00
elliptic crypto/elliptic: update P-521 docs to say it's constant-time 2021-06-07 15:19:57 +00:00
hmac crypto/hmac: panic if reusing hash.Hash values 2020-10-19 15:00:02 +00:00
internal all: go fmt std cmd (but revert vendor) 2021-02-20 03:54:50 +00:00
md5 all: add //go:build lines to assembly files 2021-05-13 09:12:17 +00:00
rand crypto/rand, internal/syscall/unix: add support for getentropy syscall on darwin 2021-03-17 22:14:28 +00:00
rc4
rsa crypto/rsa: fix salt length calculation with PSSSaltLengthAuto 2021-03-29 15:20:11 +00:00
sha1 docs: fix case of GitHub 2021-03-05 02:35:21 +00:00
sha256 docs: fix case of GitHub 2021-03-05 02:35:21 +00:00
sha512 all: remove redundant spaces before . and , 2021-04-20 00:49:17 +00:00
subtle
tls crypto/tls: test key type when casting 2021-07-12 20:58:00 +00:00
x509 crypto/x509: don't fail on optional auth key id fields 2021-06-30 01:29:49 +00:00
crypto.go crypto: fix PKCS space in docs 2020-07-08 17:21:49 +00:00
issue21104_test.go