diff options
author | william <william@25thandclement.com> | 2015-04-22 18:07:35 -0700 |
---|---|---|
committer | william <william@25thandclement.com> | 2015-04-22 18:07:35 -0700 |
commit | a0a568175c3a91d055a9a646d69fc252938d79e8 (patch) | |
tree | 8dca7e9496a6b0437e49a45724902e34b27a0a69 /src | |
parent | 782ee9a568b34ae2c2e0837d36ac048b811becc5 (diff) | |
download | luaossl-a0a568175c3a91d055a9a646d69fc252938d79e8.tar.gz luaossl-a0a568175c3a91d055a9a646d69fc252938d79e8.tar.bz2 luaossl-a0a568175c3a91d055a9a646d69fc252938d79e8.zip |
Fix BN_CTX and BIO caching for LuaJIT
Diffstat (limited to 'src')
-rw-r--r-- | src/openssl.c | 8 |
1 files changed, 4 insertions, 4 deletions
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); } |