aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMartin Willi <martin@strongswan.org>2009-08-14 13:19:47 +0200
committerMartin Willi <martin@strongswan.org>2009-08-26 11:23:50 +0200
commit7c2d883af79ded800a19179bdb061210ac30e4fc (patch)
treef31733939457b2765c733c696a82cf081fb3e8e2 /src
parent833dcfa5300d707cb42a1fcd844d1ad5834d8bf6 (diff)
downloadstrongswan-7c2d883af79ded800a19179bdb061210ac30e4fc.tar.bz2
strongswan-7c2d883af79ded800a19179bdb061210ac30e4fc.tar.xz
show more information if building a credential fails
Diffstat (limited to 'src')
-rw-r--r--src/libstrongswan/credentials/credential_factory.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/libstrongswan/credentials/credential_factory.c b/src/libstrongswan/credentials/credential_factory.c
index 40638119f..bce9c7d9e 100644
--- a/src/libstrongswan/credentials/credential_factory.c
+++ b/src/libstrongswan/credentials/credential_factory.c
@@ -150,6 +150,7 @@ static void* create(private_credential_factory_t *this, credential_type_t type,
builder_part_t part;
va_list args;
void* construct = NULL, *fn, *data;
+ int failures = 0;
enumerator = create_builder_enumerator(this, type, subtype);
while (enumerator->enumerate(enumerator, &builder))
@@ -212,12 +213,19 @@ static void* create(private_credential_factory_t *this, credential_type_t type,
{
break;
}
+ failures++;
}
enumerator->destroy(enumerator);
if (!construct)
{
- DBG1("failed to create a builder for credential type %N,"
- " subtype (%d)", credential_type_names, type, subtype);
+ enum_name_t *names = key_type_names;
+
+ if (type == CRED_CERTIFICATE)
+ {
+ names = certificate_type_names;
+ }
+ DBG1("building %N - %N failed, tried %d builders",
+ credential_type_names, type, names, subtype, failures);
}
return construct;
}