fips

package
v2.7.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 6, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Enabled  = fips140.Enabled
	Enforced = fips140.Enforced
	Version  = fips140.Version
)

Indirection vars so tests can drive every branch without controlling the Go toolchain. Production paths read crypto/fips140.Enabled / Enforced / Version; tests swap the function pointer.

View Source
var BuildSetting = func(key string) string {
	info, ok := debug.ReadBuildInfo()
	if !ok {
		return ""
	}
	for _, s := range info.Settings {
		if s.Key == key {
			return s.Value
		}
	}
	return ""
}

BuildSetting walks runtime/debug.ReadBuildInfo().Settings and returns the value for the given key (or "" when ReadBuildInfo fails or key is absent). Used to surface DefaultGODEBUG and GOFIPS140.

View Source
var GODEBUGRaw = func() string { return os.Getenv("GODEBUG") }

GODEBUGRaw returns the raw GODEBUG env var. Indirection seam so the FIPS info dump can distinguish GODEBUG unset from fips140=on.

Functions

func PrintInfo

func PrintInfo(w io.Writer, binaryName, version, gitCommit, buildDate string)

PrintInfo writes a human-readable FIPS build + runtime posture dump to w. Surfaces every field a customer or auditor would otherwise retrieve via `go version -m <binary>` (which requires a local Go toolchain) plus the live crypto/fips140 introspection.

Output is line-oriented `key: value` so tests can grep without a parser.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL