From bd2f2b11fc630b336a73c985fefbf7856952775d Mon Sep 17 00:00:00 2001 From: Andreas Steffen Date: Sat, 17 Dec 2016 18:06:11 +0100 Subject: [PATCH] stroke: Load general PKCS#8 private keys --- src/libcharon/plugins/stroke/stroke_cred.c | 10 +++++++--- src/libcharon/plugins/stroke/stroke_plugin.c | 2 ++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/libcharon/plugins/stroke/stroke_cred.c b/src/libcharon/plugins/stroke/stroke_cred.c index 77911c7b0..9b61afb5c 100644 --- a/src/libcharon/plugins/stroke/stroke_cred.c +++ b/src/libcharon/plugins/stroke/stroke_cred.c @@ -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; } } diff --git a/src/libcharon/plugins/stroke/stroke_plugin.c b/src/libcharon/plugins/stroke/stroke_plugin.c index f64b99f08..62095e368 100644 --- a/src/libcharon/plugins/stroke/stroke_plugin.c +++ b/src/libcharon/plugins/stroke/stroke_plugin.c @@ -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),