Merge pull request #147 from Zash/issue146

Special case listing of TLS 1.3 EC curves
This commit is contained in:
Bruno Silvestre 2019-08-28 11:10:37 -03:00 committed by GitHub
commit 2480572bdf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -56,25 +56,24 @@ void lsec_load_curves(lua_State *L)
lua_pushnumber(L, curves[i].nid);
lua_rawset(L, -3);
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);
}
/* 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);
}