]> Cypherpunks.ru repositories - gostls13.git/commit
[release-branch.go1.20] 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>
Mon, 19 Jun 2023 16:08:25 +0000 (16:08 +0000)
commita7a48fad7ef67033f3662bcc659e92848040d3d6
tree1ef8966ffd3910f40369386cb2db924baf7d7220
parentf5172dcd38f42829d145afd47c293afab934ccbc
[release-branch.go1.20] 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 #60744
Updates #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>
(cherry picked from commit 886fba5871268c2dccba2675fea5aafacab59189)
Reviewed-on: https://go-review.googlesource.com/c/go/+/502915
Auto-Submit: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Run-TryBot: Damien Neil <dneil@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
src/crypto/ecdsa/ecdsa.go
src/crypto/ecdsa/ecdsa_test.go