Skip to content

Commit

Permalink
Remove lua 5.1 code that's taken care of by compat-5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
daurnimator committed Sep 3, 2017
1 parent f7bd2de commit 3ba2646
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions src/openssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)]);
Expand Down Expand Up @@ -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() */
Expand Down

0 comments on commit 3ba2646

Please sign in to comment.