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:
kujenga 2016-11-28 16:39:24 -05:00
parent a0b9b65330
commit 6f143c2df6
No known key found for this signature in database
GPG Key ID: 42B14D00D1915CE5

22
fips.go Normal file
View 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
}