From: Filippo Valsorda Date: Mon, 29 Sep 2025 11:36:28 +0000 (+0200) Subject: crypto/internal/fips140test: make entropy file pair names match X-Git-Tag: go1.26rc1~660 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=ae094a1397d03aafde380cdb79e0d6a5731c8dbc;p=gostls13.git crypto/internal/fips140test: make entropy file pair names match Change-Id: I6a6a69642d00e3994277d9b5631d1d7f18f3f356 Reviewed-on: https://go-review.googlesource.com/c/go/+/710055 Reviewed-by: Roland Shoemaker Reviewed-by: Daniel McCarney LUCI-TryBot-Result: Go LUCI Auto-Submit: Filippo Valsorda Reviewed-by: Michael Pratt --- diff --git a/src/crypto/internal/fips140test/entropy_test.go b/src/crypto/internal/fips140test/entropy_test.go index 76c2428952..a84b50c62b 100644 --- a/src/crypto/internal/fips140test/entropy_test.go +++ b/src/crypto/internal/fips140test/entropy_test.go @@ -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 {