diff options
| author | daurnimator <quae@daurnimator.com> | 2017-09-03 21:32:55 +1000 |
|---|---|---|
| committer | daurnimator <quae@daurnimator.com> | 2017-09-03 21:32:55 +1000 |
| commit | 3ba26461a7834e86a116463e7ac67ac7f19dfca6 (patch) | |
| tree | f99a466616889049a872b18d776099a7d49f9f0b | |
| parent | f7bd2dec109730b20073ce82d976b026b6e84474 (diff) | |
| download | luaossl-3ba26461a7834e86a116463e7ac67ac7f19dfca6.tar.gz luaossl-3ba26461a7834e86a116463e7ac67ac7f19dfca6.tar.bz2 luaossl-3ba26461a7834e86a116463e7ac67ac7f19dfca6.zip | |
Remove lua 5.1 code that's taken care of by compat-5.3
| -rw-r--r-- | src/openssl.c | 14 |
1 files changed, 0 insertions, 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) { | |||
| 5604 | luaL_Buffer B; | 5604 | luaL_Buffer B; |
| 5605 | unsigned i; | 5605 | unsigned i; |
| 5606 | 5606 | ||
| 5607 | #if LUA_VERSION_NUM < 502 | ||
| 5608 | luaL_buffinit(L, &B); | ||
| 5609 | #else | ||
| 5610 | luaL_buffinitsize(L, &B, 2 * len); | 5607 | luaL_buffinitsize(L, &B, 2 * len); |
| 5611 | #endif | ||
| 5612 | 5608 | ||
| 5613 | for (i = 0; i < len; i++) { | 5609 | for (i = 0; i < len; i++) { |
| 5614 | luaL_addchar(&B, x[0x0f & (md[i] >> 4)]); | 5610 | luaL_addchar(&B, x[0x0f & (md[i] >> 4)]); |
| @@ -8868,19 +8864,9 @@ static int ssl_getClientRandom(lua_State *L) { | |||
| 8868 | unsigned char *out; | 8864 | unsigned char *out; |
| 8869 | 8865 | ||
| 8870 | len = SSL_get_client_random(ssl, NULL, 0); | 8866 | len = SSL_get_client_random(ssl, NULL, 0); |
| 8871 | #if LUA_VERSION_NUM < 502 | ||
| 8872 | if (LUAL_BUFFERSIZE < len) | ||
| 8873 | luaL_error(L, "ssl:getClientRandom: LUAL_BUFFERSIZE(%d) < SSL_get_client_random(ssl, NULL, 0)", (int)LUAL_BUFFERSIZE, (int)len); | ||
| 8874 | luaL_buffinit(L, &B); | ||
| 8875 | out = (unsigned char*)luaL_prepbuffer(&B); | ||
| 8876 | len = SSL_get_client_random(ssl, out, len); | ||
| 8877 | luaL_addsize(&B, len); | ||
| 8878 | luaL_pushresult(&B); | ||
| 8879 | #else | ||
| 8880 | out = (unsigned char*)luaL_buffinitsize(L, &B, len); | 8867 | out = (unsigned char*)luaL_buffinitsize(L, &B, len); |
| 8881 | len = SSL_get_client_random(ssl, out, len); | 8868 | len = SSL_get_client_random(ssl, out, len); |
| 8882 | luaL_pushresultsize(&B, len); | 8869 | luaL_pushresultsize(&B, len); |
| 8883 | #endif | ||
| 8884 | 8870 | ||
| 8885 | return 1; | 8871 | return 1; |
| 8886 | } /* ssl_getClientRandom() */ | 8872 | } /* ssl_getClientRandom() */ |
