internal, runtime: add internal fips bool

This commit is contained in:
Damian Gryski
2026-03-24 11:53:22 -07:00
committed by Ron Evans
parent f496571747
commit ed1a56785a
2 changed files with 17 additions and 1 deletions
+2 -1
View File
@@ -22,7 +22,8 @@ type Task struct {
state state
// This is needed for some crypto packages.
FipsIndicator uint8
FipsIndicator uint8
FipsOnlyBypass bool
// State of the goroutine: running, paused, or must-resume-next-pause.
// This extra field doesn't increase memory usage on 32-bit CPUs and above,
+15
View File
@@ -67,3 +67,18 @@ func fips_setIndicator(indicator uint8) {
// This indicator is stored per goroutine.
task.Current().FipsIndicator = indicator
}
//go:linkname fips140_setBypass crypto/fips140.setBypass
func fips140_setBypass() {
task.Current().FipsOnlyBypass = true
}
//go:linkname fips140_unsetBypass crypto/fips140.unsetBypass
func fips140_unsetBypass() {
task.Current().FipsOnlyBypass = false
}
//go:linkname fips140_isBypassed crypto/fips140.isBypassed
func fips140_isBypassed() bool {
return task.Current().FipsOnlyBypass
}