aboutsummaryrefslogtreecommitdiffstats
path: root/main/lua-ossl/0009-pkey.toPEM-use-password-callback.patch
diff options
context:
space:
mode:
Diffstat (limited to 'main/lua-ossl/0009-pkey.toPEM-use-password-callback.patch')
-rw-r--r--main/lua-ossl/0009-pkey.toPEM-use-password-callback.patch25
1 files changed, 25 insertions, 0 deletions
diff --git a/main/lua-ossl/0009-pkey.toPEM-use-password-callback.patch b/main/lua-ossl/0009-pkey.toPEM-use-password-callback.patch
new file mode 100644
index 0000000000..108621099e
--- /dev/null
+++ b/main/lua-ossl/0009-pkey.toPEM-use-password-callback.patch
@@ -0,0 +1,25 @@
+From 4899a210dfdd91fa75b77601d29df0152aecc382 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 09/10] 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 937ffa6..3af285b 100644
+--- a/src/openssl.c
++++ b/src/openssl.c
+@@ -4748,7 +4748,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.24.1
+