vici: Support all defined key types

References #3586.
This commit is contained in:
Tobias Brunner 2020-10-08 09:32:57 +02:00
parent 7efe92130a
commit 6839256773
2 changed files with 2 additions and 18 deletions

View File

@ -483,7 +483,7 @@ Load a certificate into the daemon.
Load a private key into the daemon.
{
type = <private key type, rsa|ecdsa|bliss|any>
type = <private key type, rsa|ecdsa|ed25519|ed448|bliss|any>
data = <PEM or DER encoded key data>
} => {
success = <yes or no>

View File

@ -226,23 +226,7 @@ CALLBACK(load_key, vici_message_t*,
{
return create_reply("key type missing");
}
if (strcaseeq(str, "any"))
{
type = KEY_ANY;
}
else if (strcaseeq(str, "rsa"))
{
type = KEY_RSA;
}
else if (strcaseeq(str, "ecdsa"))
{
type = KEY_ECDSA;
}
else if (strcaseeq(str, "bliss"))
{
type = KEY_BLISS;
}
else
if (!enum_from_name(key_type_names, str, &type))
{
return create_reply("invalid key type: %s", str);
}