...
1# Go+BoringCrypto conflicts with GOFIPS140.
2[GOEXPERIMENT:boringcrypto] skip
3
4# list with GOFIPS140=off
5env GOFIPS140=off
6go list -f '{{.DefaultGODEBUG}}'
7! stdout fips140
8
9# list with GOFIPS140=latest
10env GOFIPS140=latest
11go list -f '{{.DefaultGODEBUG}}'
12stdout fips140=on
13
14[short] skip
15
16# build with GOFIPS140=off is cached
17env GOFIPS140=off
18go build -x -o x.exe
19! stderr .-fipso
20go build -x -o x.exe
21! stderr link
22
23# build with GOFIPS140=latest is cached too
24env GOFIPS140=latest
25go build -x -o x.exe
26stderr link.*-fipso
27go build -x -o x.exe
28! stderr link.*-fipso
29
30# build test with GOFIPS140=off is cached
31env GOFIPS140=off
32go test -x -c
33! stderr .-fipso
34go test -x -c
35! stderr link
36
37# build test with GOFIPS140=latest is cached
38env GOFIPS140=latest
39go test -x -c
40stderr link.*-fipso
41go test -x -c
42! stderr link
43
44-- go.mod --
45module m
46-- x.go --
47package main
48import _ "crypto/sha256"
49func main() {
50}
51-- x_test.go --
52package main
53import "testing"
54func Test(t *testing.T) {}
View as plain text