stroke: Load general PKCS#8 private keys
authorAndreas Steffen <andreas.steffen@strongswan.org>
Sat, 17 Dec 2016 17:06:11 +0000 (18:06 +0100)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Sat, 17 Dec 2016 17:06:11 +0000 (18:06 +0100)
src/libcharon/plugins/stroke/stroke_cred.c
src/libcharon/plugins/stroke/stroke_plugin.c

index 77911c7..9b61afb 100644 (file)
@@ -1310,7 +1310,7 @@ static void load_secrets(private_stroke_cred_t *this, mem_cred_t *secrets,
                        break;
                }
                if (match("RSA", &token) || match("ECDSA", &token) ||
-                       match("BLISS", &token))
+                       match("BLISS", &token) || match("PKCS8", &token))
                {
                        if (match("RSA", &token))
                        {
@@ -1320,10 +1320,14 @@ static void load_secrets(private_stroke_cred_t *this, mem_cred_t *secrets,
                        {
                                key_type = KEY_ECDSA;
                        }
-                       else
+                       else if (match("BLISS", &token))
                        {
                                key_type = KEY_BLISS;
                        }
+                       else
+                       {
+                               key_type = KEY_ANY;
+                       }
                        if (!load_private(secrets, line, line_nr, prompt, key_type))
                        {
                                break;
@@ -1356,7 +1360,7 @@ static void load_secrets(private_stroke_cred_t *this, mem_cred_t *secrets,
                else
                {
                        DBG1(DBG_CFG, "line %d: token must be either RSA, ECDSA, BLISS, "
-                                                 "P12, PIN, PSK, EAP, XAUTH or NTLM", line_nr);
+                                                 "PKCS8 P12, PIN, PSK, EAP, XAUTH or NTLM", line_nr);
                        break;
                }
        }
index f64b99f..62095e3 100644 (file)
@@ -70,6 +70,8 @@ METHOD(plugin_t, get_features, int,
                                PLUGIN_SDEPEND(PRIVKEY, KEY_ECDSA),
                                PLUGIN_SDEPEND(PRIVKEY, KEY_DSA),
                                PLUGIN_SDEPEND(PRIVKEY, KEY_BLISS),
+                               PLUGIN_SDEPEND(PRIVKEY, KEY_ED25519),
+                               PLUGIN_SDEPEND(PRIVKEY, KEY_ED448),
                                PLUGIN_SDEPEND(CERT_DECODE, CERT_ANY),
                                PLUGIN_SDEPEND(CERT_DECODE, CERT_X509),
                                PLUGIN_SDEPEND(CERT_DECODE, CERT_X509_CRL),