Skip to content

Commit

Permalink
fix: remove initialized evp_pkey_ctx
Browse files Browse the repository at this point in the history
  • Loading branch information
mertakman committed Oct 8, 2024
1 parent f9b1c2c commit b3981d2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ed25519.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,12 @@ func SupportsEd25519() bool {
onceSupportsEd25519.Do(func() {
switch vMajor {
case 1:
supportsEd25519 = versionAtOrAbove(1, 1, 1) && C.go_openssl_EVP_PKEY_CTX_new_id(C.GO_EVP_PKEY_ED25519, nil) != nil
ctx := C.go_openssl_EVP_PKEY_CTX_new_id(C.GO_EVP_PKEY_ED25519, nil)
if ctx != nil {
defer C.go_openssl_EVP_PKEY_CTX_free(ctx)
}

supportsEd25519 = versionAtOrAbove(1, 1, 1) && ctx != nil
case 3:
name := C.CString("ED25519")
defer C.free(unsafe.Pointer(name))
Expand Down

0 comments on commit b3981d2

Please sign in to comment.