Export configuration (protocols, options, curves, algorithms, capabilities)

This commit is contained in:
Bruno Silvestre
2017-06-16 22:50:27 -03:00
parent fc757e1fd0
commit 0b99832ec7
4 changed files with 29 additions and 4 deletions

View File

@ -47,6 +47,23 @@ void lsec_load_curves(lua_State *L)
lua_rawset(L, LUA_REGISTRYINDEX);
}
void lsec_get_curves(lua_State *L)
{
lua_newtable(L);
lua_pushstring(L, "SSL:EC:CURVES");
lua_rawget(L, LUA_REGISTRYINDEX);
lua_pushnil(L);
while (lua_next(L, -2) != 0) {
lua_pop(L, 1);
lua_pushvalue(L, -1);
lua_pushboolean(L, 1);
lua_rawset(L, -5);
}
lua_pop(L, 1);
}
#else
void lsec_load_curves(lua_State *L)
@ -54,4 +71,9 @@ void lsec_load_curves(lua_State *L)
// do nothing
}
void lsec_get_curves(lua_State *L)
{
lua_newtable(L);
}
#endif