aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLibravatarLibravatar William Ahern <william@25thandclement.com> 2016-11-02 11:06:18 -0700
committerLibravatarLibravatar William Ahern <william@25thandclement.com> 2016-11-02 11:06:18 -0700
commit8ea3249320e8380c9abd2a119c7c450c0701cbf5 (patch)
tree17db9e7f135d4b512915c16d2443dd43dc836764 /src
parente3a15d0a7c8a1ee43e39c151bc517e9190b109b3 (diff)
downloadluaossl-8ea3249320e8380c9abd2a119c7c450c0701cbf5.tar.gz
luaossl-8ea3249320e8380c9abd2a119c7c450c0701cbf5.tar.bz2
luaossl-8ea3249320e8380c9abd2a119c7c450c0701cbf5.zip
auxL_absindex too clever; stay simple
Diffstat (limited to 'src')
-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;
}