summaryrefslogtreecommitdiff
path: root/src/openssl.c
diff options
context:
space:
mode:
authorwilliam <william@25thandclement.com>2015-04-22 18:07:35 -0700
committerwilliam <william@25thandclement.com>2015-04-22 18:07:35 -0700
commita0a568175c3a91d055a9a646d69fc252938d79e8 (patch)
tree8dca7e9496a6b0437e49a45724902e34b27a0a69 /src/openssl.c
parent782ee9a568b34ae2c2e0837d36ac048b811becc5 (diff)
downloadluaossl-a0a568175c3a91d055a9a646d69fc252938d79e8.tar.gz
luaossl-a0a568175c3a91d055a9a646d69fc252938d79e8.tar.bz2
luaossl-a0a568175c3a91d055a9a646d69fc252938d79e8.zip
Fix BN_CTX and BIO caching for LuaJIT
Diffstat (limited to 'src/openssl.c')
-rw-r--r--src/openssl.c8
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) {
1548static BN_CTX *getctx(lua_State *L) { 1548static BN_CTX *getctx(lua_State *L) {
1549 BN_CTX **ctx; 1549 BN_CTX **ctx;
1550 1550
1551 lua_pushcfunction(L, &ctx__gc); 1551 lua_pushlightuserdata(L, (void *)&ctx__gc);
1552 lua_gettable(L, LUA_REGISTRYINDEX); 1552 lua_gettable(L, LUA_REGISTRYINDEX);
1553 1553
1554 if (lua_isnil(L, -1)) { 1554 if (lua_isnil(L, -1)) {
@@ -1559,7 +1559,7 @@ static BN_CTX *getctx(lua_State *L) {
1559 if (!(*ctx = BN_CTX_new())) 1559 if (!(*ctx = BN_CTX_new()))
1560 auxL_error(L, auxL_EOPENSSL, "bignum"); 1560 auxL_error(L, auxL_EOPENSSL, "bignum");
1561 1561
1562 lua_pushcfunction(L, &ctx__gc); 1562 lua_pushlightuserdata(L, (void *)&ctx__gc);
1563 lua_pushvalue(L, -2); 1563 lua_pushvalue(L, -2);
1564 lua_settable(L, LUA_REGISTRYINDEX); 1564 lua_settable(L, LUA_REGISTRYINDEX);
1565 } 1565 }
@@ -1767,7 +1767,7 @@ static int bio__gc(lua_State *L) {
1767static BIO *getbio(lua_State *L) { 1767static BIO *getbio(lua_State *L) {
1768 BIO **bio; 1768 BIO **bio;
1769 1769
1770 lua_pushcfunction(L, &bio__gc); 1770 lua_pushlightuserdata(L, (void *)&bio__gc);
1771 lua_gettable(L, LUA_REGISTRYINDEX); 1771 lua_gettable(L, LUA_REGISTRYINDEX);
1772 1772
1773 if (lua_isnil(L, -1)) { 1773 if (lua_isnil(L, -1)) {
@@ -1778,7 +1778,7 @@ static BIO *getbio(lua_State *L) {
1778 if (!(*bio = BIO_new(BIO_s_mem()))) 1778 if (!(*bio = BIO_new(BIO_s_mem())))
1779 auxL_error(L, auxL_EOPENSSL, "BIO_new"); 1779 auxL_error(L, auxL_EOPENSSL, "BIO_new");
1780 1780
1781 lua_pushcfunction(L, &bio__gc); 1781 lua_pushlightuserdata(L, (void *)&bio__gc);
1782 lua_pushvalue(L, -2); 1782 lua_pushvalue(L, -2);
1783 lua_settable(L, LUA_REGISTRYINDEX); 1783 lua_settable(L, LUA_REGISTRYINDEX);
1784 } 1784 }