Skip to content

Commit

Permalink
pkey.getPrivateKey: use password callback
Browse files Browse the repository at this point in the history
  • Loading branch information
kunkku committed Jun 7, 2018
1 parent 973c8d7 commit 7ef0c5a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/openssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -4110,7 +4110,7 @@ static int pk_getPrivateKey(lua_State *L) {
return luaL_error(L, "pkey:getPrivateKey: unknown cipher: %s", cname);
}

if (!PEM_write_bio_PrivateKey(getbio(L), key, cipher, pass, pass ? strlen(pass) : 0, 0, 0))
if (!PEM_write_bio_PrivateKey(getbio(L), key, cipher, NULL, 0, pem_pw_cb, pass))
return auxL_error(L, auxL_EOPENSSL, "pkey:getPrivateKey");
pushbiostring(L);
return 1;
Expand Down

0 comments on commit 7ef0c5a

Please sign in to comment.