Skip to content

Commit

Permalink
pkey.toPEM: use password callback
Browse files Browse the repository at this point in the history
  • Loading branch information
kunkku committed Jun 19, 2020
1 parent 89f26bb commit 4f41ae9
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 @@ -4743,7 +4743,7 @@ static int pk_toPEM(lua_State *L) {
return luaL_error(L, "pkey:toPEM: password not defined");
}

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

len = BIO_get_mem_data(bio, &pem);
Expand Down

0 comments on commit 4f41ae9

Please sign in to comment.