show more information if building a credential fails
This commit is contained in:
@@ -150,6 +150,7 @@ static void* create(private_credential_factory_t *this, credential_type_t type,
|
|||||||
builder_part_t part;
|
builder_part_t part;
|
||||||
va_list args;
|
va_list args;
|
||||||
void* construct = NULL, *fn, *data;
|
void* construct = NULL, *fn, *data;
|
||||||
|
int failures = 0;
|
||||||
|
|
||||||
enumerator = create_builder_enumerator(this, type, subtype);
|
enumerator = create_builder_enumerator(this, type, subtype);
|
||||||
while (enumerator->enumerate(enumerator, &builder))
|
while (enumerator->enumerate(enumerator, &builder))
|
||||||
@@ -212,12 +213,19 @@ static void* create(private_credential_factory_t *this, credential_type_t type,
|
|||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
failures++;
|
||||||
}
|
}
|
||||||
enumerator->destroy(enumerator);
|
enumerator->destroy(enumerator);
|
||||||
if (!construct)
|
if (!construct)
|
||||||
{
|
{
|
||||||
DBG1("failed to create a builder for credential type %N,"
|
enum_name_t *names = key_type_names;
|
||||||
" subtype (%d)", credential_type_names, type, subtype);
|
|
||||||
|
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;
|
return construct;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user