aboutsummaryrefslogtreecommitdiffstats
path: root/src/conftest/conftest.c
diff options
context:
space:
mode:
authorMartin Willi <martin@revosec.ch>2010-11-09 14:19:59 +0100
committerMartin Willi <martin@revosec.ch>2011-01-05 16:45:43 +0100
commita784c9e030876758de8bd9cd3714c6dc6dcde470 (patch)
tree01ffdeb48cd3f87092e0007031495b163cd08954 /src/conftest/conftest.c
parent4a2f7f05dfdadc990012ff6d59b13360e83e17d3 (diff)
downloadstrongswan-a784c9e030876758de8bd9cd3714c6dc6dcde470.tar.bz2
strongswan-a784c9e030876758de8bd9cd3714c6dc6dcde470.tar.xz
Specify the type of the certificate to load, currently X509 only
Diffstat (limited to 'src/conftest/conftest.c')
-rw-r--r--src/conftest/conftest.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/conftest/conftest.c b/src/conftest/conftest.c
index 0d610c5b4..38ec833ca 100644
--- a/src/conftest/conftest.c
+++ b/src/conftest/conftest.c
@@ -110,6 +110,12 @@ static bool load_certs(settings_t *settings, char *dir)
enumerator = settings->create_key_value_enumerator(settings, "certs.trusted");
while (enumerator->enumerate(enumerator, &key, &value))
{
+ if (!strcaseeq(key, "x509"))
+ {
+ fprintf(stderr, "certificate type '%s' not supported\n", key);
+ enumerator->destroy(enumerator);
+ return FALSE;
+ }
cert = lib->creds->create(lib->creds, CRED_CERTIFICATE, CERT_X509,
BUILD_FROM_FILE, value, BUILD_END);
if (!cert)
@@ -126,6 +132,12 @@ static bool load_certs(settings_t *settings, char *dir)
enumerator = settings->create_key_value_enumerator(settings, "certs.untrusted");
while (enumerator->enumerate(enumerator, &key, &value))
{
+ if (!strcaseeq(key, "x509"))
+ {
+ fprintf(stderr, "certificate type '%s' not supported\n", key);
+ enumerator->destroy(enumerator);
+ return FALSE;
+ }
cert = lib->creds->create(lib->creds, CRED_CERTIFICATE, CERT_X509,
BUILD_FROM_FILE, value, BUILD_END);
if (!cert)