Skip to content

Commit c41bd3e

Browse files
committed
be more strict about reporting fips mode
1 parent 01887cf commit c41bd3e

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

tlz/fips.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
//go:build goexperiment.opensslcrypto
1+
//go:build goexperiment.opensslcrypto && requirefips
22

33
package tlz
44

5-
import "crypto/boring"
5+
import (
6+
"crypto/boring"
7+
_ "crypto/tls/fipsonly"
8+
)
69

7-
// returns true if the binary was built with FIPS mode enabled
10+
// returns true if the OpenSSL FIPS provider is active at runtime
811
func FipsEnabled() bool {
912
return boring.Enabled()
1013
}

tlz/nofips.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//go:build !goexperiment.opensslcrypto
1+
//go:build !goexperiment.opensslcrypto && !requirefips
22

33
package tlz
44

0 commit comments

Comments
 (0)