コード例 #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
ファイル: err.go プロジェクト: runcom/gossl
// OpenSSL cleanup and freeing
func Cleanup() {
	C.ERR_free_strings()
}