1 env snap=v1.0.0
2 env alias=inprocess
3
4 env GOFIPS140=$snap
5
6 # Go+BoringCrypto conflicts with GOFIPS140.
7 [GOEXPERIMENT:boringcrypto] skip
8
9 # default GODEBUG includes fips140=on
10 go list -f '{{.DefaultGODEBUG}}'
11 stdout fips140=on
12
13 # std lists fips snapshot and not regular fips
14 go list std
15 stdout crypto/internal/fips140/$snap/sha256
16 ! stdout crypto/internal/fips140/sha256
17 ! stdout crypto/internal/fips140/check
18
19 # build does not use regular fips
20 go list -json -test
21 stdout crypto/internal/fips140/$snap/sha256
22 ! stdout crypto/internal/fips140/sha256
23 ! stdout crypto/internal/fips140/check
24
25 # again with GOFIPS140=$alias
26 # TODO: enable when we add inprocess.txt
27 # env GOFIPS140=$alias
28
29 # default GODEBUG includes fips140=on
30 go list -f '{{.DefaultGODEBUG}}'
31 stdout fips140=on
32
33 # std lists fips snapshot and not regular fips
34 go list std
35 stdout crypto/internal/fips140/$snap/sha256
36 ! stdout crypto/internal/fips140/sha256
37 ! stdout crypto/internal/fips140/check
38
39 # build does not use regular fips
40 go list -json -test
41 stdout crypto/internal/fips140/$snap/sha256
42 ! stdout crypto/internal/fips140/sha256
43 ! stdout crypto/internal/fips140/check
44
45 [short] skip
46
47 # build with GOFIPS140=snap is cached
48 go build -x -o x.exe
49 stderr link.*-fipso
50 go build -x -o x.exe
51 ! stderr link.*-fipso
52
53 # build test with GOFIPS140=snap is cached
54 go test -x -c
55 stderr link.*-fipso
56 go test -x -c
57 ! stderr link
58
59 -- go.mod --
60 module m
61 -- x.go --
62 package main
63 import _ "crypto/sha256"
64 func main() {
65 }
66 -- x_test.go --
67 package main
68 import "testing"
69 func Test(t *testing.T) {}
70
View as plain text