You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fipsutil: report which module is linked, not just the mode
Enabled() and Only() answer whether the process is in FIPS 140-3 mode. They
cannot answer which cryptographic module it is running, and the two are
independent: a process built without GOFIPS140 but run with
GODEBUG=fips140=on performs the integrity self-check, the known-answer
tests and the TLS restriction, yet does all of it with the toolchain's
in-tree crypto packages rather than a CMVP-validated code set. Nothing
observable distinguishes that from the real thing except the version, so a
caller with a certificate to point at had no way to tell.
Adds Version() (the module version, "latest" when no frozen module is
linked), BuildVersion() (the resolved GOFIPS140 build setting) and
Validated() (whether a frozen snapshot is linked at all).
Also fixes Only() on Go 1.26+. It decided by parsing the GODEBUG environment
variable, which misses a default baked in at build time by GOFIPS140 or a
//go:debug directive. A binary with //go:debug fips140=only and no
GODEBUG set reported Only() == false while genuinely being in only-mode.
crypto/fips140.Enforced, added in Go 1.26, is the runtime's own answer;
older toolchains keep the environment scan since they have nothing better.
crypto/fips140.Version and .Enforced are both Go 1.26, so the version-gated
halves are split out and the pre-1.26 build falls back to the recorded build
setting. That fallback carries the snapshot suffix ("v1.0.0-c2097c7c") where
Go 1.26 reports the formal version ("v1.0.0"); the doc comment says so.
0 commit comments