aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcharon/plugins/stroke
diff options
context:
space:
mode:
authorTobias Brunner <tobias@strongswan.org>2013-07-15 10:59:13 +0200
committerTobias Brunner <tobias@strongswan.org>2013-07-15 10:59:13 +0200
commit591f923134091ada2b2a195cb4c784f3eb5a63c0 (patch)
tree3c6d88f4c92aa4ce331ec1d57c9f5624023c60fe /src/libcharon/plugins/stroke
parente0b868f79ebc06efabd14df982fe9ca1ecef7de5 (diff)
downloadstrongswan-591f923134091ada2b2a195cb4c784f3eb5a63c0.tar.bz2
strongswan-591f923134091ada2b2a195cb4c784f3eb5a63c0.tar.xz
stroke: Add certificates extracted from PKCS#12 files to correct credential set
Only keys and shared secrets are moved from the temporary credential set after loading all secrets.
Diffstat (limited to 'src/libcharon/plugins/stroke')
-rw-r--r--src/libcharon/plugins/stroke/stroke_cred.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libcharon/plugins/stroke/stroke_cred.c b/src/libcharon/plugins/stroke/stroke_cred.c
index 474417886..8d0001271 100644
--- a/src/libcharon/plugins/stroke/stroke_cred.c
+++ b/src/libcharon/plugins/stroke/stroke_cred.c
@@ -975,8 +975,8 @@ static bool load_private(mem_cred_t *secrets, chunk_t line, int line_nr,
/**
* Load a PKCS#12 container
*/
-static bool load_pkcs12(mem_cred_t *secrets, chunk_t line, int line_nr,
- FILE *prompt)
+static bool load_pkcs12(private_stroke_cred_t *this, mem_cred_t *secrets,
+ chunk_t line, int line_nr, FILE *prompt)
{
enumerator_t *enumerator;
char path[PATH_MAX];
@@ -1009,7 +1009,7 @@ static bool load_pkcs12(mem_cred_t *secrets, chunk_t line, int line_nr,
DBG1(DBG_CFG, " loaded certificate \"%Y\" from '%s'",
cert->get_subject(cert), path);
}
- secrets->add_cert(secrets, TRUE, cert->get_ref(cert));
+ this->creds->add_cert(this->creds, TRUE, cert->get_ref(cert));
}
enumerator->destroy(enumerator);
enumerator = pkcs12->create_key_enumerator(pkcs12);
@@ -1243,7 +1243,7 @@ static void load_secrets(private_stroke_cred_t *this, mem_cred_t *secrets,
}
else if (match("P12", &token))
{
- if (!load_pkcs12(secrets, line, line_nr, prompt))
+ if (!load_pkcs12(this, secrets, line, line_nr, prompt))
{
break;
}