]> Cypherpunks repositories - gostls13.git/commit
crypto/tls: test key type when casting
authorRoland Shoemaker <roland@golang.org>
Wed, 9 Jun 2021 18:31:27 +0000 (11:31 -0700)
committerFilippo Valsorda <filippo@golang.org>
Mon, 12 Jul 2021 20:58:00 +0000 (20:58 +0000)
commita98589711da5e9d935e8d690cfca92892e86d557
tree681997c43c4dc353d23a6ba6410a87018a104cab
parentcfbd73ba33fc6a3635b3a63096fd6c6bff9d73e8
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>
src/crypto/tls/key_agreement.go