mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-04-20 02:36:39 +02:00
available at https://github.com/wahern/luaossl/pull/128 Earlier, an empty password was returned when the callback raised a Lua error. Now the error is propagated to the OpenSSL level. This commit also enables the -dbg subpackage.
25 lines
818 B
Diff
25 lines
818 B
Diff
From 482c51d69e7985a17c560c9d44e2c60105a814f2 Mon Sep 17 00:00:00 2001
|
|
From: Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>
|
|
Date: Thu, 3 May 2018 21:21:16 +0300
|
|
Subject: [PATCH 8/9] pkey.toPEM: use password callback
|
|
|
|
---
|
|
src/openssl.c | 2 +-
|
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
|
diff --git a/src/openssl.c b/src/openssl.c
|
|
index dd46fb9..9857603 100644
|
|
--- a/src/openssl.c
|
|
+++ b/src/openssl.c
|
|
@@ -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);
|
|
--
|
|
2.48.1
|
|
|