示例#1
0
文件: fips_on.go 项目: vbatts/go-fips
func lastError() string {
	buf := C.malloc(1024)
	e := C.ERR_get_error() // a C.ulong
	C.ERR_load_crypto_strings()
	defer C.ERR_free_strings()
	C.ERR_error_string_n(e, (*C.char)(buf), 1024)
	defer C.free(buf)
	return C.GoString((*C.char)(buf))
}
示例#2
0
文件: init.go 项目: Machyne/mongo
func init() {
	C.ERR_load_crypto_strings()
	C.OPENSSL_config(nil)
	C.ENGINE_load_builtin_engines()
	C.SSL_load_error_strings()
	C.SSL_library_init()
	C.OpenSSL_add_all_algorithms_not_a_macro()
	rc := C.Goopenssl_init_threadsafety()
	if rc != 0 {
		panic(fmt.Errorf("Goopenssl_init_locks failed with %d", rc))
	}
}
示例#3
0
文件: err.go 项目: runcom/gossl
func init() {
	C.ERR_load_ERR_strings()
	C.ERR_load_crypto_strings()
	C.OPENSSL_config(nil)
}