crypto/tls/internal/fips140tls: use crypto/fips140

There is no need for fips140tls to depend on an internal package, it
can use crypto/fips140 directly.

Both approaches are equivalent, but using crypto/fips140 makes us
exercise a public API and sets precedence.

Change-Id: I668e80ee62b711bc60821cee3a54232a33295ee1
Reviewed-on: https://go-review.googlesource.com/c/go/+/642035
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
This commit is contained in:
qmuntal 2025-01-10 13:38:35 +01:00 committed by Quim Muntal
parent 6114b69e0c
commit d704ef7606
2 changed files with 3 additions and 3 deletions

View File

@ -6,14 +6,14 @@
package fips140tls
import (
"crypto/internal/fips140"
"crypto/fips140"
"sync/atomic"
)
var required atomic.Bool
func init() {
if fips140.Enabled {
if fips140.Enabled() {
Force()
}
}

View File

@ -552,7 +552,7 @@ var depsRules = `
# TLS, Prince of Dependencies.
FIPS, sync/atomic < crypto/tls/internal/fips140tls;
crypto/fips140, sync/atomic < crypto/tls/internal/fips140tls;
crypto/internal/boring/sig, crypto/tls/internal/fips140tls < crypto/tls/fipsonly;