mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-04-19 18:26:44 +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.
42 lines
1.4 KiB
Diff
42 lines
1.4 KiB
Diff
From 1d6f15950ae7834e2d49e7709e4a723a96eb8f46 Mon Sep 17 00:00:00 2001
|
|
From: Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>
|
|
Date: Sun, 2 Sep 2018 14:24:51 +0300
|
|
Subject: [PATCH 5/9] pkey.new: opt: rename variable
|
|
|
|
---
|
|
src/openssl.c | 10 +++++-----
|
|
1 file changed, 5 insertions(+), 5 deletions(-)
|
|
|
|
diff --git a/src/openssl.c b/src/openssl.c
|
|
index 7fef0e3..e5a19b8 100644
|
|
--- a/src/openssl.c
|
|
+++ b/src/openssl.c
|
|
@@ -4301,20 +4301,20 @@ static int pk_new(lua_State *L) {
|
|
} else if (lua_isstring(L, 1)) {
|
|
int format = optencoding(L, 2, "*", X509_ANY|X509_PEM|X509_DER);
|
|
int pubonly = 0, prvtonly = 0;
|
|
- const char *opt, *data;
|
|
+ const char *type, *data;
|
|
size_t len;
|
|
BIO *bio;
|
|
EVP_PKEY *pub = NULL, *prvt = NULL;
|
|
int goterr = 0;
|
|
|
|
/* check if specified publickey or privatekey */
|
|
- if ((opt = luaL_optstring(L, 3, NULL))) {
|
|
- if (xtolower(opt[0]) == 'p' && xtolower(opt[1]) == 'u') {
|
|
+ if ((type = luaL_optstring(L, 3, NULL))) {
|
|
+ if (xtolower(type[0]) == 'p' && xtolower(type[1]) == 'u') {
|
|
pubonly = 1;
|
|
- } else if (xtolower(opt[0]) == 'p' && xtolower(opt[1]) == 'r') {
|
|
+ } else if (xtolower(type[0]) == 'p' && xtolower(type[1]) == 'r') {
|
|
prvtonly = 1;
|
|
} else {
|
|
- return luaL_argerror(L, 3, lua_pushfstring(L, "invalid option %s", opt));
|
|
+ return luaL_argerror(L, 3, lua_pushfstring(L, "invalid type: %s", type));
|
|
}
|
|
}
|
|
|
|
--
|
|
2.48.1
|
|
|