Skip to content

Commit 66cb087

Browse files
committed
pkey.toPEM: use password callback
1 parent 0ac6b9f commit 66cb087

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
@@ -4786,7 +4786,7 @@ static int pk_toPEM(lua_State *L) {
47864786
return luaL_error(L, "pkey:toPEM: password not defined");
47874787
}
47884788

4789-
if (!PEM_write_bio_PrivateKey(bio, key, cipher, pass, pass ? strlen(pass) : 0, 0, 0))
4789+
if (!PEM_write_bio_PrivateKey(bio, key, cipher, NULL, 0, pem_pw_cb, pass))
47904790
return auxL_error(L, auxL_EOPENSSL, "pkey:__tostring");
47914791

47924792
len = BIO_get_mem_data(bio, &pem);

0 commit comments

Comments
 (0)