mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-12 14:09:12 +00:00
Make key type optional in crypto.generateKeyPair. Defaults to rsa
This commit is contained in:
parent
e1403ff9a9
commit
c1be35a820
1 changed files with 1 additions and 1 deletions
|
@ -1110,7 +1110,7 @@ static int LuaCryptoDecrypt(lua_State *L) {
|
|||
}
|
||||
|
||||
static int LuaCryptoGenerateKeyPair(lua_State *L) {
|
||||
const char *key_type = luaL_checkstring(L, 1); // Key type (e.g., "rsa", "ecdsa")
|
||||
const char *key_type = luaL_optstring(L, 1, "rsa"); // Key type (e.g., "rsa", "ecdsa")
|
||||
lua_remove(L, 1); // Remove the first argument (key type or cipher type) before dispatching
|
||||
|
||||
if (strcasecmp(key_type, "rsa") == 0) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue