]> Cypherpunks.ru repositories - gostls13.git/commit
crypto/ecdsa: properly truncate P-521 hashes
authorFilippo Valsorda <filippo@golang.org>
Mon, 12 Jun 2023 16:58:50 +0000 (18:58 +0200)
committerGopher Robot <gobot@golang.org>
Tue, 13 Jun 2023 16:14:23 +0000 (16:14 +0000)
commit886fba5871268c2dccba2675fea5aafacab59189
tree768e6e93bcf3b6434c25d515508354f57ece96a3
parentbce7aec3cdca8580585095007e9b7cea11a8812f
crypto/ecdsa: properly truncate P-521 hashes

Before, if a hash was exactly 66 bytes long, we weren't truncating it
for use with P-521, because the byte length was not overflowing.
However, the bit length could still overflow.

Fixes #60741

Change-Id: I37a0ee210add0eb566e6dc1c141e83e992983eb6
Reviewed-on: https://go-review.googlesource.com/c/go/+/502478
Auto-Submit: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Roland Shoemaker <roland@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Damien Neil <dneil@google.com>
src/crypto/ecdsa/ecdsa.go
src/crypto/ecdsa/ecdsa_test.go