From a0a568175c3a91d055a9a646d69fc252938d79e8 Mon Sep 17 00:00:00 2001 From: william Date: Wed, 22 Apr 2015 18:07:35 -0700 Subject: Fix BN_CTX and BIO caching for LuaJIT --- src/openssl.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/openssl.c b/src/openssl.c index 6f41bda..edd3048 100644 --- a/src/openssl.c +++ b/src/openssl.c @@ -1548,7 +1548,7 @@ static int ctx__gc(lua_State *L) { static BN_CTX *getctx(lua_State *L) { BN_CTX **ctx; - lua_pushcfunction(L, &ctx__gc); + lua_pushlightuserdata(L, (void *)&ctx__gc); lua_gettable(L, LUA_REGISTRYINDEX); if (lua_isnil(L, -1)) { @@ -1559,7 +1559,7 @@ static BN_CTX *getctx(lua_State *L) { if (!(*ctx = BN_CTX_new())) auxL_error(L, auxL_EOPENSSL, "bignum"); - lua_pushcfunction(L, &ctx__gc); + lua_pushlightuserdata(L, (void *)&ctx__gc); lua_pushvalue(L, -2); lua_settable(L, LUA_REGISTRYINDEX); } @@ -1767,7 +1767,7 @@ static int bio__gc(lua_State *L) { static BIO *getbio(lua_State *L) { BIO **bio; - lua_pushcfunction(L, &bio__gc); + lua_pushlightuserdata(L, (void *)&bio__gc); lua_gettable(L, LUA_REGISTRYINDEX); if (lua_isnil(L, -1)) { @@ -1778,7 +1778,7 @@ static BIO *getbio(lua_State *L) { if (!(*bio = BIO_new(BIO_s_mem()))) auxL_error(L, auxL_EOPENSSL, "BIO_new"); - lua_pushcfunction(L, &bio__gc); + lua_pushlightuserdata(L, (void *)&bio__gc); lua_pushvalue(L, -2); lua_settable(L, LUA_REGISTRYINDEX); } -- cgit v1.2.3-59-g8ed1b