]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
vici: Support all defined key types
authorTobias Brunner <tobias@strongswan.org>
Thu, 8 Oct 2020 07:32:57 +0000 (09:32 +0200)
committerTobias Brunner <tobias@strongswan.org>
Tue, 27 Oct 2020 10:17:21 +0000 (11:17 +0100)
References #3586.

src/libcharon/plugins/vici/README.md
src/libcharon/plugins/vici/vici_cred.c

index f2c1208219dfb8d11e3f386d641001409f293ed2..cf2e7482eb927fa79ba6ea2a8ace8f918e3bf225 100644 (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>
index 17f3ff0cd8c901d58af161d79ca1afdac2d6b7e9..6310fdcb82fd3a1f676e42da861632a08e40fb56 100644 (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);
        }