aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilippo Valsorda <filippo@golang.org>2025-09-10 03:19:49 -0700
committerJunyang Shao <shaojunyang@google.com>2025-09-26 10:44:44 -0700
commitbec452a3a29bfe8fbcb5461327c4ceb32862a60a (patch)
tree0a619c0256fff8e5a3c751cc1a0b68f616c6c8e8
parent57bd28ab7f287167e3d8915815975d72bab3687f (diff)
downloadgo-bec452a3a29bfe8fbcb5461327c4ceb32862a60a.tar.xz
[release-branch.go1.25] crypto/internal/fips140: update frozen module version to "v1.0.0"
We are re-sealing the .zip file anyway for another reason, might as well take the opportunity to fix the "v1.0" mistake. Note that the actual returned version change will happen when re-sealing the .zip, as the latest mkzip.go will inject "v1.0.0" instead of "v1.0". This reapplies CL 701518, reverted in CL 702255. Updates #75524 Change-Id: Ib5b3721bda35c32dd48293b3d1193c12661662dd Reviewed-on: https://go-review.googlesource.com/c/go/+/706717 Reviewed-by: Roland Shoemaker <roland@golang.org> TryBot-Bypass: Filippo Valsorda <filippo@golang.org> Reviewed-by: Junyang Shao <shaojunyang@google.com>
-rw-r--r--src/crypto/internal/cryptotest/hash.go2
-rw-r--r--src/crypto/internal/fips140/fips140.go2
-rw-r--r--src/crypto/internal/fips140test/fips_test.go5
3 files changed, 2 insertions, 7 deletions
diff --git a/src/crypto/internal/cryptotest/hash.go b/src/crypto/internal/cryptotest/hash.go
index f00e9c80d3..37fd96a2d9 100644
--- a/src/crypto/internal/cryptotest/hash.go
+++ b/src/crypto/internal/cryptotest/hash.go
@@ -20,7 +20,7 @@ type MakeHash func() hash.Hash
// TestHash performs a set of tests on hash.Hash implementations, checking the
// documented requirements of Write, Sum, Reset, Size, and BlockSize.
func TestHash(t *testing.T, mh MakeHash) {
- if boring.Enabled || fips140.Version() == "v1.0" {
+ if boring.Enabled || fips140.Version() == "v1.0.0" {
testhash.TestHashWithoutClone(t, testhash.MakeHash(mh))
return
}
diff --git a/src/crypto/internal/fips140/fips140.go b/src/crypto/internal/fips140/fips140.go
index e05ad66374..e48706fbd5 100644
--- a/src/crypto/internal/fips140/fips140.go
+++ b/src/crypto/internal/fips140/fips140.go
@@ -62,7 +62,7 @@ func Name() string {
return "Go Cryptographic Module"
}
-// Version returns the formal version (such as "v1.0") if building against a
+// Version returns the formal version (such as "v1.0.0") if building against a
// frozen module with GOFIPS140. Otherwise, it returns "latest".
func Version() string {
// This return value is replaced by mkzip.go, it must not be changed or
diff --git a/src/crypto/internal/fips140test/fips_test.go b/src/crypto/internal/fips140test/fips_test.go
index 08d60933ef..6220e536f4 100644
--- a/src/crypto/internal/fips140test/fips_test.go
+++ b/src/crypto/internal/fips140test/fips_test.go
@@ -74,11 +74,6 @@ func TestVersion(t *testing.T) {
continue
}
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 {
t.Errorf("Version is %q, expected %q", v, exp)
}