mirror of
https://github.com/libp2p/go-openssl.git
synced 2024-12-28 23:50:14 +08:00
Work with versions pickier about C types
Newer versions of Go (at least 1.4) do not like mixing C pointer types. Cast an unsafe.Pointer to *C.char to make the compiler see matching types.
This commit is contained in:
parent
2156e293c7
commit
20fdb1c664
2
key.go
2
key.go
@ -321,7 +321,7 @@ func GenerateRSAKey(bits int) (PrivateKey, error) {
|
||||
if key == nil {
|
||||
return nil, errors.New("failed to allocate EVP_PKEY")
|
||||
}
|
||||
if C.EVP_PKEY_assign(key, C.EVP_PKEY_RSA, unsafe.Pointer(rsa)) != 1 {
|
||||
if C.EVP_PKEY_assign(key, C.EVP_PKEY_RSA, (*C.char)(unsafe.Pointer(rsa))) != 1 {
|
||||
C.EVP_PKEY_free(key)
|
||||
return nil, errors.New("failed to assign RSA key")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user