]> Cypherpunks repositories - gostls13.git/commitdiff
crypto/internal/fips140test: make entropy file pair names match
authorFilippo Valsorda <filippo@golang.org>
Mon, 29 Sep 2025 11:36:28 +0000 (13:36 +0200)
committerGopher Robot <gobot@golang.org>
Wed, 8 Oct 2025 21:06:44 +0000 (14:06 -0700)
Change-Id: I6a6a69642d00e3994277d9b5631d1d7f18f3f356
Reviewed-on: https://go-review.googlesource.com/c/go/+/710055
Reviewed-by: Roland Shoemaker <roland@golang.org>
Reviewed-by: Daniel McCarney <daniel@binaryparadox.net>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Michael Pratt <mpratt@google.com>
src/crypto/internal/fips140test/entropy_test.go

index 76c24289520e170214f994b0a021cb3ec51f6c0b..a84b50c62b22b687fb620b9904433a20a5fda200 100644 (file)
@@ -31,11 +31,12 @@ var flagNISTSP80090B = flag.Bool("nist-sp800-90b", false, "run NIST SP 800-90B t
 
 func TestEntropySamples(t *testing.T) {
        cryptotest.MustSupportFIPS140(t)
+       now := time.Now().UTC()
 
        var seqSamples [1_000_000]uint8
        samplesOrTryAgain(t, seqSamples[:])
        seqSamplesName := fmt.Sprintf("entropy_samples_sequential_%s_%s_%s_%s_%s.bin", entropy.Version(),
-               runtime.GOOS, runtime.GOARCH, *flagEntropySamples, time.Now().Format("20060102T150405Z"))
+               runtime.GOOS, runtime.GOARCH, *flagEntropySamples, now.Format("20060102T150405Z"))
        if *flagEntropySamples != "" {
                if err := os.WriteFile(seqSamplesName, seqSamples[:], 0644); err != nil {
                        t.Fatalf("failed to write samples to %q: %v", seqSamplesName, err)
@@ -50,7 +51,7 @@ func TestEntropySamples(t *testing.T) {
                copy(restartSamples[i][:], samples[:])
        }
        restartSamplesName := fmt.Sprintf("entropy_samples_restart_%s_%s_%s_%s_%s.bin", entropy.Version(),
-               runtime.GOOS, runtime.GOARCH, *flagEntropySamples, time.Now().Format("20060102T150405Z"))
+               runtime.GOOS, runtime.GOARCH, *flagEntropySamples, now.Format("20060102T150405Z"))
        if *flagEntropySamples != "" {
                f, err := os.Create(restartSamplesName)
                if err != nil {