cleanup, no GODEBUG needed

This commit is contained in:
Wade Simmons
2026-04-28 11:58:43 -04:00
parent 65450f9d21
commit ae58085032
9 changed files with 50 additions and 70 deletions

View File

@@ -2,4 +2,31 @@
package nebula
var boringEnabled = func() bool { return false }
import (
"crypto/fips140"
"runtime/debug"
)
func getFIPS140() string {
switch {
case fips140.Enabled():
return getFIPS140Version()
default:
return "off"
}
}
func getFIPS140Version() string {
// The docs for fips140.Version mention this is more accurate to
// get the exact version
// - https://pkg.go.dev/crypto/fips140#Version
info, ok := debug.ReadBuildInfo()
if ok {
for _, s := range info.Settings {
if s.Key == "GOFIPS140" {
return s.Value
}
}
}
return fips140.Version()
}