Skip to content

Commit

Permalink
fix error condition
Browse files Browse the repository at this point in the history
  • Loading branch information
qmuntal committed Dec 5, 2024
1 parent 6de9c52 commit e9c1e5c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion evp.go
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ func newEVPPKEY(key ossl.EC_KEY_PTR) (ossl.EVP_PKEY_PTR, error) {
// The returned key should not be freed.
func getECKey(pkey ossl.EVP_PKEY_PTR) (key ossl.EC_KEY_PTR) {
if vMajor == 1 && vMinor == 0 {
if key0, err := ossl.EVP_PKEY_get0(pkey); err != nil {
if key0, err := ossl.EVP_PKEY_get0(pkey); err == nil {
key = ossl.EC_KEY_PTR(key0)
}
} else {
Expand Down

0 comments on commit e9c1e5c

Please sign in to comment.