Revert "crypto/internal/fips140: update frozen module version to "v1.0.0""

This reverts CL 701518. This should land just before CL 701520 to avoid
breaking the builders for long.

Fixes #75343

Change-Id: If1ae1fe933fe443ca9776888967d80875b02f41a
Reviewed-on: https://go-review.googlesource.com/c/go/+/702255
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This commit is contained in:
Filippo Valsorda 2025-09-09 15:05:22 -07:00
parent 30686c4cc8
commit f1c4b860d4
3 changed files with 7 additions and 2 deletions

View file

@ -20,7 +20,7 @@ type MakeHash func() hash.Hash
// TestHash performs a set of tests on hash.Hash implementations, checking the // TestHash performs a set of tests on hash.Hash implementations, checking the
// documented requirements of Write, Sum, Reset, Size, and BlockSize. // documented requirements of Write, Sum, Reset, Size, and BlockSize.
func TestHash(t *testing.T, mh MakeHash) { func TestHash(t *testing.T, mh MakeHash) {
if boring.Enabled || fips140.Version() == "v1.0.0" { if boring.Enabled || fips140.Version() == "v1.0" {
testhash.TestHashWithoutClone(t, testhash.MakeHash(mh)) testhash.TestHashWithoutClone(t, testhash.MakeHash(mh))
return return
} }

View file

@ -62,7 +62,7 @@ func Name() string {
return "Go Cryptographic Module" return "Go Cryptographic Module"
} }
// Version returns the formal version (such as "v1.0.0") if building against a // Version returns the formal version (such as "v1.0") if building against a
// frozen module with GOFIPS140. Otherwise, it returns "latest". // frozen module with GOFIPS140. Otherwise, it returns "latest".
func Version() string { func Version() string {
// This return value is replaced by mkzip.go, it must not be changed or // This return value is replaced by mkzip.go, it must not be changed or

View file

@ -74,6 +74,11 @@ func TestVersion(t *testing.T) {
continue continue
} }
exp := setting.Value exp := setting.Value
if exp == "v1.0.0" {
// Unfortunately we enshrined the version of the first module as
// v1.0 before deciding to go for full versions.
exp = "v1.0"
}
if v := fips140.Version(); v != exp { if v := fips140.Version(); v != exp {
t.Errorf("Version is %q, expected %q", v, exp) t.Errorf("Version is %q, expected %q", v, exp)
} }