aboutsummaryrefslogtreecommitdiffstats
path: root/src/openssl.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/openssl.c')
-rw-r--r--src/openssl.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/openssl.c b/src/openssl.c
index f4bba40..63db361 100644
--- a/src/openssl.c
+++ b/src/openssl.c
@@ -799,11 +799,6 @@ static _Bool auxS_txt2nid(int *nid, const char *txt) {
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-static int auxL_absindex(lua_State *L, int *index) {
- *index = lua_absindex(L, *index);
- return *index;
-} /* auxL_absindex() */
-
typedef int auxref_t;
typedef int auxtype_t;
@@ -1166,16 +1161,18 @@ static const char *auxL_pushnid(lua_State *L, int nid) {
} /* auxL_pushnid() */
static const EVP_MD *auxL_optdigest(lua_State *L, int index, EVP_PKEY *key, const EVP_MD *def) {
- const char *name = luaL_optstring(L, auxL_absindex(L, &index), NULL);
+ const char *name = luaL_optstring(L, index, NULL);
const EVP_MD *md;
if ((md = auxS_todigest(name, key, NULL)))
return md;
if (name) {
+ index = lua_absindex(L, index);
luaL_argerror(L, index, lua_pushfstring(L, "invalid digest type (%s)", name));
NOTREACHED;
} else if (key) {
+ index = lua_absindex(L, index);
luaL_argerror(L, index, lua_pushfstring(L, "no digest type for key type (%d)", EVP_PKEY_base_id(key)));
NOTREACHED;
}