From 3ba26461a7834e86a116463e7ac67ac7f19dfca6 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Sun, 3 Sep 2017 21:32:55 +1000 Subject: Remove lua 5.1 code that's taken care of by compat-5.3 --- src/openssl.c | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/openssl.c b/src/openssl.c index 0d0208e..fd7d28e 100644 --- a/src/openssl.c +++ b/src/openssl.c @@ -5604,11 +5604,7 @@ static int xc_digest(lua_State *L) { luaL_Buffer B; unsigned i; -#if LUA_VERSION_NUM < 502 - luaL_buffinit(L, &B); -#else luaL_buffinitsize(L, &B, 2 * len); -#endif for (i = 0; i < len; i++) { luaL_addchar(&B, x[0x0f & (md[i] >> 4)]); @@ -8868,19 +8864,9 @@ static int ssl_getClientRandom(lua_State *L) { unsigned char *out; len = SSL_get_client_random(ssl, NULL, 0); -#if LUA_VERSION_NUM < 502 - if (LUAL_BUFFERSIZE < len) - luaL_error(L, "ssl:getClientRandom: LUAL_BUFFERSIZE(%d) < SSL_get_client_random(ssl, NULL, 0)", (int)LUAL_BUFFERSIZE, (int)len); - luaL_buffinit(L, &B); - out = (unsigned char*)luaL_prepbuffer(&B); - len = SSL_get_client_random(ssl, out, len); - luaL_addsize(&B, len); - luaL_pushresult(&B); -#else out = (unsigned char*)luaL_buffinitsize(L, &B, len); len = SSL_get_client_random(ssl, out, len); luaL_pushresultsize(&B, len); -#endif return 1; } /* ssl_getClientRandom() */ -- cgit v1.2.3-59-g8ed1b