]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.19] crypto/x509: don't panic marshaling invalid ECDSA keys
authorFilippo Valsorda <filippo@golang.org>
Tue, 9 Aug 2022 20:02:57 +0000 (13:02 -0700)
committerHeschi Kreinick <heschi@google.com>
Mon, 29 Aug 2022 19:14:33 +0000 (19:14 +0000)
commit2553a09e31d1a87072c7a68e352cd404df95b23d
tree49eea807829cf23d9175c18bbe88f6fd3ab697ca
parent28335508913a46e05ef0c04a18e8a1a6beb775ec
[release-branch.go1.19] crypto/x509: don't panic marshaling invalid ECDSA keys

MarshalPKIXPublicKey, CreateCertificate, CreateCertificateRequest,
MarshalECPrivateKey, and MarshalPKCS8PrivateKey started raising a panic
when encoding an invalid ECDSA key in Go 1.19. Since they have an error
return value, they should return an error instead.

Updates #54288
Fixes #54295

Change-Id: Iba132cd2f890ece36bb7d0396eb9a9a77bdb81df
Reviewed-on: https://go-review.googlesource.com/c/go/+/422298
Auto-Submit: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Roland Shoemaker <roland@golang.org>
Run-TryBot: Filippo Valsorda <filippo@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
(cherry picked from commit f64f12f0b32eba7d49c259480e0fa0c79eb47600)
Reviewed-on: https://go-review.googlesource.com/c/go/+/425634
src/crypto/x509/sec1.go
src/crypto/x509/x509.go
src/crypto/x509/x509_test.go