From: Filippo Valsorda Date: Tue, 18 Mar 2025 19:21:51 +0000 (+0100) Subject: cmd/compile/internal/amd64: disable FIPS 140-3 mode for TestGoAMD64v1 X-Git-Tag: go1.25rc1~675 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=fcb27f717b0eccb2a3de1bc05a7d222325ad5aeb;p=gostls13.git cmd/compile/internal/amd64: disable FIPS 140-3 mode for TestGoAMD64v1 TestGoAMD64v1 modifies the binary, which will make the FIPS 140-3 integrity self-check fail. Disable FIPS 140-3 mode when running the modified binary. Change-Id: I6a6a46566a38f8c44f996f6e1155dac5f67c56e6 Reviewed-on: https://go-review.googlesource.com/c/go/+/658915 Reviewed-by: Daniel McCarney Reviewed-by: Roland Shoemaker Auto-Submit: Filippo Valsorda LUCI-TryBot-Result: Go LUCI Reviewed-by: Dmitri Shuralyov --- diff --git a/src/cmd/compile/internal/amd64/versions_test.go b/src/cmd/compile/internal/amd64/versions_test.go index 92365fb365..15395fc5e5 100644 --- a/src/cmd/compile/internal/amd64/versions_test.go +++ b/src/cmd/compile/internal/amd64/versions_test.go @@ -75,7 +75,8 @@ func TestGoAMD64v1(t *testing.T) { cmd := testenv.Command(t, dst.Name()) testenv.CleanCmdEnv(cmd) cmd.Env = append(cmd.Env, "TESTGOAMD64V1=yes") - cmd.Env = append(cmd.Env, fmt.Sprintf("GODEBUG=%s", strings.Join(features, ","))) + // Disable FIPS 140-3 mode, since it would detect the modified binary. + cmd.Env = append(cmd.Env, fmt.Sprintf("GODEBUG=%s,fips140=off", strings.Join(features, ","))) out, err := cmd.CombinedOutput() if err != nil { t.Fatalf("couldn't execute test: %s\n%s", err, out)