File tree 6 files changed +25
-0
lines changed
6 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -119,6 +119,10 @@ func Init() {
119
119
if Snapshot () {
120
120
fsys .Bind (Dir (), filepath .Join (cfg .GOROOT , "src/crypto/internal/fips140" ))
121
121
}
122
+
123
+ if cfg .Experiment .BoringCrypto && Enabled () {
124
+ base .Fatalf ("go: cannot use GOFIPS140 with GOEXPERIMENT=boringcrypto" )
125
+ }
122
126
}
123
127
124
128
var initDone bool
Original file line number Diff line number Diff line change 1
1
# Test query for non-defaults in the env
2
2
3
+ # Go+BoringCrypto conflicts with GOFIPS140.
4
+ [GOEXPERIMENT:boringcrypto] skip
5
+
3
6
env GOROOT=./a
4
7
env GOTOOLCHAIN=local
5
8
env GOSUMDB=nodefault
Original file line number Diff line number Diff line change
1
+ # Go+BoringCrypto conflicts with GOFIPS140.
2
+ [GOEXPERIMENT:boringcrypto] skip
3
+
1
4
# list with GOFIPS140=off
2
5
env GOFIPS140=off
3
6
go list -f '{{.DefaultGODEBUG}}'
Original file line number Diff line number Diff line change @@ -7,6 +7,9 @@ env alias=inprocess
7
7
skip 'no snapshots yet'
8
8
env GOFIPS140=$snap
9
9
10
+ # Go+BoringCrypto conflicts with GOFIPS140.
11
+ [GOEXPERIMENT:boringcrypto] skip
12
+
10
13
# default GODEBUG includes fips140=on
11
14
go list -f '{{.DefaultGODEBUG}}'
12
15
stdout fips140=on
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ import "C"
16
16
import (
17
17
"crypto/internal/boring/sig"
18
18
_ "crypto/internal/boring/syso"
19
+ "crypto/internal/fips140"
19
20
"internal/stringslite"
20
21
"math/bits"
21
22
"unsafe"
@@ -31,6 +32,12 @@ func init() {
31
32
sig .BoringCrypto ()
32
33
}
33
34
35
+ func init () {
36
+ if fips140 .Enabled {
37
+ panic ("boringcrypto: cannot use GODEBUG=fips140 with GOEXPERIMENT=boringcrypto" )
38
+ }
39
+ }
40
+
34
41
// Unreachable marks code that should be unreachable
35
42
// when BoringCrypto is in use. It panics.
36
43
func Unreachable () {
Original file line number Diff line number Diff line change 5
5
package fipstest
6
6
7
7
import (
8
+ "crypto/internal/boring"
8
9
. "crypto/internal/fips140/check"
9
10
"crypto/internal/fips140/check/checktest"
10
11
"fmt"
@@ -22,6 +23,10 @@ import (
22
23
const enableFIPSTest = true
23
24
24
25
func TestFIPSCheckVerify (t * testing.T ) {
26
+ if boring .Enabled {
27
+ t .Skip ("not testing fips140 with boringcrypto enabled" )
28
+ }
29
+
25
30
if Verified {
26
31
t .Logf ("verified" )
27
32
return
You can’t perform that action at this time.
0 commit comments