]> Cypherpunks repositories - gostls13.git/commit
crypto/md5,crypto/sha1: apply fips140=only to Write and Sum, not New
authorFilippo Valsorda <filippo@golang.org>
Mon, 6 Jan 2025 17:49:45 +0000 (18:49 +0100)
committerGopher Robot <gobot@golang.org>
Wed, 8 Jan 2025 19:44:28 +0000 (11:44 -0800)
commit54693a81fd605a9c1abbee83da072c61e38d3ebf
tree300dfbbad07f3f462c89b64c5e9f0ab24957a4cd
parent0cdf8c7a8ce5913845ab46e49a1befd86c9c565d
crypto/md5,crypto/sha1: apply fips140=only to Write and Sum, not New

New is called to get a Hash which can then be rejected with an error
(instead of a panic) from fips140only.ApprovedHash.

Also, it's reasonable to call New().Size() and then not use the hash.

Change-Id: I6a6a4656c43528d169c4b28c8b6de48448236d4f
Reviewed-on: https://go-review.googlesource.com/c/go/+/641317
Auto-Submit: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Daniel McCarney <daniel@binaryparadox.net>
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Roland Shoemaker <roland@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/crypto/md5/md5.go
src/crypto/sha1/sha1.go