mirror of
https://github.com/brunoos/luasec.git
synced 2025-02-13 23:42:49 +01:00
Special case listing of TLS 1.3 EC curves (fixes #146)
This commit is contained in:
parent
f64e660de0
commit
c26513f4f7
27
src/ec.c
27
src/ec.c
@ -56,25 +56,24 @@ void lsec_load_curves(lua_State *L)
|
|||||||
lua_pushnumber(L, curves[i].nid);
|
lua_pushnumber(L, curves[i].nid);
|
||||||
lua_rawset(L, -3);
|
lua_rawset(L, -3);
|
||||||
break;
|
break;
|
||||||
#ifdef NID_X25519
|
|
||||||
case NID_X25519:
|
|
||||||
lua_pushstring(L, "X25519");
|
|
||||||
lua_pushnumber(L, curves[i].nid);
|
|
||||||
lua_rawset(L, -3);
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
#ifdef NID_X448
|
|
||||||
case NID_X448:
|
|
||||||
lua_pushstring(L, "X448");
|
|
||||||
lua_pushnumber(L, curves[i].nid);
|
|
||||||
lua_rawset(L, -3);
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
free(curves);
|
free(curves);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* These are special so are manually added here */
|
||||||
|
#ifdef NID_X25519
|
||||||
|
lua_pushstring(L, "X25519");
|
||||||
|
lua_pushnumber(L, NID_X25519);
|
||||||
|
lua_rawset(L, -3);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef NID_X448
|
||||||
|
lua_pushstring(L, "X448");
|
||||||
|
lua_pushnumber(L, NID_X448);
|
||||||
|
lua_rawset(L, -3);
|
||||||
|
#endif
|
||||||
|
|
||||||
lua_rawset(L, LUA_REGISTRYINDEX);
|
lua_rawset(L, LUA_REGISTRYINDEX);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user