aboutsummaryrefslogtreecommitdiffstats
path: root/lib/crypto/c_src/crypto.c
diff options
context:
space:
mode:
authorHans Nilsson <[email protected]>2017-11-22 11:55:04 +0100
committerHans Nilsson <[email protected]>2017-11-22 11:55:04 +0100
commita41bfcdf524dd94a9a760ab3dd0d375896e5a7f7 (patch)
treeabefeeb67dd14084fa0c2d0fc3a8442668f51192 /lib/crypto/c_src/crypto.c
parent43c5b9621e4c7054378e9ff96907cca4fd92ecc7 (diff)
parent6817c0a02c1271d5c92a4fbceafaf71a0cb7e5e2 (diff)
downloadotp-a41bfcdf524dd94a9a760ab3dd0d375896e5a7f7.tar.gz
otp-a41bfcdf524dd94a9a760ab3dd0d375896e5a7f7.tar.bz2
otp-a41bfcdf524dd94a9a760ab3dd0d375896e5a7f7.zip
Merge branch 'hans/crypto/cuddle_tests' into maint
Diffstat (limited to 'lib/crypto/c_src/crypto.c')
-rw-r--r--lib/crypto/c_src/crypto.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/crypto/c_src/crypto.c b/lib/crypto/c_src/crypto.c
index 72429c51fb..f05bfa10b3 100644
--- a/lib/crypto/c_src/crypto.c
+++ b/lib/crypto/c_src/crypto.c
@@ -4011,7 +4011,7 @@ static int get_pkey_private_key(ErlNifEnv *env, ERL_NIF_TERM algorithm, ERL_NIF_
return PKEY_BADARG;
password = get_key_password(env, key);
*pkey = ENGINE_load_private_key(e, id, NULL, password);
- if (!pkey)
+ if (!*pkey)
return PKEY_BADARG;
enif_free(id);
#else
@@ -4794,7 +4794,6 @@ static ERL_NIF_TERM privkey_to_pubkey_nif(ErlNifEnv* env, int argc, const ERL_NI
EVP_PKEY *pkey;
ERL_NIF_TERM alg = argv[0];
ERL_NIF_TERM result[8];
-
if (get_pkey_private_key(env, alg, argv[1], &pkey) != PKEY_OK) {
return enif_make_badarg(env);
}