Skip to content

Commit ccfb4be

Browse files
committed
pkey.getPrivateKey: use password callback
1 parent 94ea1e2 commit ccfb4be

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
@@ -4106,7 +4106,7 @@ static int pk_getPrivateKey(lua_State *L) {
41064106
char *str;
41074107
long len;
41084108

4109-
if (!PEM_write_bio_PrivateKey(bio, key, cipher, pass, pass ? strlen(pass) : 0, 0, 0))
4109+
if (!PEM_write_bio_PrivateKey(bio, key, cipher, NULL, 0, pem_pw_cb, pass))
41104110
return auxL_error(L, auxL_EOPENSSL, "pkey:getPrivateKey");
41114111
len = BIO_get_mem_data(bio, &str);
41124112
lua_pushlstring(L, str, len);

0 commit comments

Comments
 (0)