]> Cypherpunks repositories - gostls13.git/commitdiff
crypto/internal/fips140: update frozen module version to "v1.0.0"
authorFilippo Valsorda <filippo@golang.org>
Wed, 10 Sep 2025 10:19:49 +0000 (03:19 -0700)
committerFilippo Valsorda <filippo@golang.org>
Thu, 25 Sep 2025 19:06:18 +0000 (12:06 -0700)
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.

Change-Id: Ib5b3721bda35c32dd48293b3d1193c12661662dd
Reviewed-on: https://go-review.googlesource.com/c/go/+/702316
Reviewed-by: Roland Shoemaker <roland@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
TryBot-Bypass: Filippo Valsorda <filippo@golang.org>

src/crypto/internal/cryptotest/hash.go
src/crypto/internal/fips140/fips140.go
src/crypto/internal/fips140test/fips_test.go
src/crypto/rsa/rsa_test.go

index f00e9c80d3c86af03757960e37749d6d458dbbd8..37fd96a2d9d0b9ef879f7a9eab22eeb2b25f90d0 100644 (file)
@@ -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
        }
index 4f0999d6d97e46df52975186ae15430b6212b495..d03219b540e27fbd9c2b6b0f36ff4483e53c1486 100644 (file)
@@ -67,7 +67,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
index 08d60933ef38b8dad6da6f5df06cf326e8ee24f9..6220e536f4aa6eb6c327ecbd7d7b83a62de87674 100644 (file)
@@ -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)
                }
index d471ecbf8375f36bb680f16ee496fd1f271b2090..0d5b6e08f0e223d451e8dd431c70ddcb92202ca1 100644 (file)
@@ -1246,7 +1246,7 @@ func TestModifiedPrivateKey(t *testing.T) {
        })
 
        t.Run("D+2", func(t *testing.T) {
-               if fips140.Version() == "v1.0" {
+               if fips140.Version() == "v1.0.0" {
                        t.Skip("This was fixed after v1.0.0")
                }
                testModifiedPrivateKey(t, func(k *PrivateKey) {