From 8ea3249320e8380c9abd2a119c7c450c0701cbf5 Mon Sep 17 00:00:00 2001 From: William Ahern Date: Wed, 2 Nov 2016 11:06:18 -0700 Subject: auxL_absindex too clever; stay simple --- src/openssl.c | 9 +++------ 1 file 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; } -- cgit v1.2.3-59-g8ed1b