Assuming curves list is available if EC is available

This commit is contained in:
Bruno Silvestre 2018-09-12 18:26:19 -03:00
parent 5ece6049e5
commit 8440bc3d59
2 changed files with 1 additions and 12 deletions

View File

@ -71,16 +71,12 @@ LSEC_API int luaopen_ssl_config(lua_State *L)
lua_rawset(L, -3);
#ifndef OPENSSL_NO_EC
#if defined(SSL_CTRL_SET_ECDH_AUTO) || defined(SSL_CTRL_SET_CURVES_LIST) || defined(SSL_CTX_set1_curves_list)
lua_pushstring(L, "curves_list");
lua_pushboolean(L, 1);
lua_rawset(L, -3);
#ifdef SSL_CTRL_SET_ECDH_AUTO
lua_pushstring(L, "ecdh_auto");
lua_pushboolean(L, 1);
lua_rawset(L, -3);
#endif
#endif
#endif
lua_rawset(L, -3);

View File

@ -571,9 +571,7 @@ static int set_curve(lua_State *L)
lua_pushboolean(L, 1);
return 1;
}
#endif
#if !defined(OPENSSL_NO_EC) && (defined(SSL_CTRL_SET_CURVES_LIST) || defined(SSL_CTX_set1_curves_list) || defined(SSL_CTRL_SET_ECDH_AUTO))
/**
* Set elliptic curves list.
*/
@ -590,9 +588,7 @@ static int set_curves_list(lua_State *L)
return 2;
}
#ifdef SSL_CTRL_SET_ECDH_AUTO
SSL_CTX_set_ecdh_auto(ctx, 1);
#endif
lua_pushboolean(L, 1);
return 1;
@ -703,10 +699,7 @@ static luaL_Reg funcs[] = {
{"setmode", set_mode},
#if !defined(OPENSSL_NO_EC)
{"setcurve", set_curve},
#endif
#if !defined(OPENSSL_NO_EC) && (defined(SSL_CTRL_SET_CURVES_LIST) || defined(SSL_CTX_set1_curves_list) || defined(SSL_CTRL_SET_ECDH_AUTO))
{"setcurve", set_curve},
{"setcurveslist", set_curves_list},
#endif