Skip to content

Commit 7ef0c5a

Browse files
committed
pkey.getPrivateKey: use password callback
1 parent 973c8d7 commit 7ef0c5a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/openssl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4110,7 +4110,7 @@ static int pk_getPrivateKey(lua_State *L) {
41104110
return luaL_error(L, "pkey:getPrivateKey: unknown cipher: %s", cname);
41114111
}
41124112

4113-
if (!PEM_write_bio_PrivateKey(getbio(L), key, cipher, pass, pass ? strlen(pass) : 0, 0, 0))
4113+
if (!PEM_write_bio_PrivateKey(getbio(L), key, cipher, NULL, 0, pem_pw_cb, pass))
41144114
return auxL_error(L, auxL_EOPENSSL, "pkey:getPrivateKey");
41154115
pushbiostring(L);
41164116
return 1;

0 commit comments

Comments
 (0)