mirror of
https://github.com/brunoos/luasec.git
synced 2024-12-27 04:58:20 +01:00
context: no_compression is options, not verify
The OpenSSL 0.9.8 compat needs to be handled as part of the options, not the verification flags.
This commit is contained in:
parent
f77fb40033
commit
9bda3322fb
@ -406,12 +406,6 @@ static int set_verify(lua_State *L)
|
|||||||
int max = lua_gettop(L);
|
int max = lua_gettop(L);
|
||||||
for (i = 2; i <= max; i++) {
|
for (i = 2; i <= max; i++) {
|
||||||
str = luaL_checkstring(L, i);
|
str = luaL_checkstring(L, i);
|
||||||
#if !defined(SSL_OP_NO_COMPRESSION) && (OPENSSL_VERSION_NUMBER >= 0x0090800f) && (OPENSSL_VERSION_NUMBER < 0x1000000fL)
|
|
||||||
/* Version 0.9.8 has a different way to disable compression */
|
|
||||||
if (!strcmp(luaL_checkstring(L, i), "no_compression"))
|
|
||||||
ctx->comp_methods = NULL;
|
|
||||||
else
|
|
||||||
#endif
|
|
||||||
if (!set_verify_flag(str, &flag)) {
|
if (!set_verify_flag(str, &flag)) {
|
||||||
lua_pushboolean(L, 0);
|
lua_pushboolean(L, 0);
|
||||||
lua_pushstring(L, "invalid verify option");
|
lua_pushstring(L, "invalid verify option");
|
||||||
@ -435,6 +429,12 @@ static int set_options(lua_State *L)
|
|||||||
/* any option? */
|
/* any option? */
|
||||||
if (max > 1) {
|
if (max > 1) {
|
||||||
for (i = 2; i <= max; i++) {
|
for (i = 2; i <= max; i++) {
|
||||||
|
#if !defined(SSL_OP_NO_COMPRESSION) && (OPENSSL_VERSION_NUMBER >= 0x0090800f) && (OPENSSL_VERSION_NUMBER < 0x1000000fL)
|
||||||
|
/* Version 0.9.8 has a different way to disable compression */
|
||||||
|
if (!strcmp(luaL_checkstring(L, i), "no_compression"))
|
||||||
|
ctx->comp_methods = NULL;
|
||||||
|
else
|
||||||
|
#endif
|
||||||
if (!set_option_flag(luaL_checkstring(L, i), &flag)) {
|
if (!set_option_flag(luaL_checkstring(L, i), &flag)) {
|
||||||
lua_pushboolean(L, 0);
|
lua_pushboolean(L, 0);
|
||||||
lua_pushstring(L, "invalid option");
|
lua_pushstring(L, "invalid option");
|
||||||
|
Loading…
Reference in New Issue
Block a user