core: FIPS (#9683)

Co-authored-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>
This commit is contained in:
Jens L
2024-05-23 19:34:52 +02:00
committed by GitHub
parent c2da6822dc
commit c3445374c2
24 changed files with 222 additions and 57 deletions

View File

@ -0,0 +1,5 @@
//go:build requirefips
package backend
var FipsEnabled = true

View File

@ -0,0 +1,5 @@
//go:build !requirefips
package backend
var FipsEnabled = false

View File

@ -0,0 +1,5 @@
//go:build !goexperiment.systemcrypto
package backend
var OpensslEnabled = false

View File

@ -0,0 +1,5 @@
//go:build goexperiment.systemcrypto
package backend
var OpensslEnabled = true

View File

@ -0,0 +1,17 @@
package backend
import (
"bytes"
"os/exec"
)
func OpensslVersion() string {
cmd := exec.Command("openssl", "version")
var out bytes.Buffer
cmd.Stdout = &out
err := cmd.Run()
if err != nil {
return ""
}
return out.String()
}