mirror of
https://github.com/libp2p/go-openssl.git
synced 2025-01-15 02:40:09 +08:00
add FIPS mode from fork
This introduces this file: https://github.com/10gen/openssl/blob/master/fips.go Which was pointed to from this issue: https://github.com/spacemonkeygo/openssl/issues/37
This commit is contained in:
parent
a0b9b65330
commit
6f143c2df6
22
fips.go
Normal file
22
fips.go
Normal file
@ -0,0 +1,22 @@
|
||||
// +build cgo
|
||||
// +build -darwin
|
||||
|
||||
package openssl
|
||||
|
||||
/*
|
||||
#include <openssl/ssl.h>
|
||||
*/
|
||||
import "C"
|
||||
|
||||
func FIPSModeSet(mode bool) error {
|
||||
var r C.int
|
||||
if mode {
|
||||
r = C.FIPS_mode_set(1)
|
||||
} else {
|
||||
r = C.FIPS_mode_set(0)
|
||||
}
|
||||
if r != 1 {
|
||||
return errorFromErrorQueue()
|
||||
}
|
||||
return nil
|
||||
}
|
Loading…
Reference in New Issue
Block a user