runtime: add FIPS helper functions

Not entirely sure what they're for, but the Go runtime also stores this
information per goroutine so let's go with that.
This commit is contained in:
Ayke van Laethem
2025-02-18 14:19:46 +01:00
committed by Ron Evans
parent a1be8cd9fe
commit 07c7eff3c3
3 changed files with 19 additions and 0 deletions
+11
View File
@@ -31,3 +31,14 @@ func scheduleLogChan(msg string, ch *channel, t *task.Task) {
func Goexit() {
panicOrGoexit(nil, panicGoexit)
}
//go:linkname fips_getIndicator crypto/internal/fips140.getIndicator
func fips_getIndicator() uint8 {
return task.Current().FipsIndicator
}
//go:linkname fips_setIndicator crypto/internal/fips140.setIndicator
func fips_setIndicator(indicator uint8) {
// This indicator is stored per goroutine.
task.Current().FipsIndicator = indicator
}