diff --git a/src/libcharon/plugins/vici/README.md b/src/libcharon/plugins/vici/README.md index f2c1208219..cf2e7482eb 100644 --- a/src/libcharon/plugins/vici/README.md +++ b/src/libcharon/plugins/vici/README.md @@ -483,7 +483,7 @@ Load a certificate into the daemon. Load a private key into the daemon. { - type = + type = data = } => { success = diff --git a/src/libcharon/plugins/vici/vici_cred.c b/src/libcharon/plugins/vici/vici_cred.c index 17f3ff0cd8..6310fdcb82 100644 --- a/src/libcharon/plugins/vici/vici_cred.c +++ b/src/libcharon/plugins/vici/vici_cred.c @@ -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); }