credmgr: introduce a hook function to catch trust chain validation errors

This commit is contained in:
Martin Willi
2013-07-18 16:00:30 +02:00
parent f7cff7fac4
commit 4d7a762871
7 changed files with 120 additions and 7 deletions
@@ -167,6 +167,8 @@ METHOD(cert_validator_t, validate, bool,
{
DBG1(DBG_CFG, "coupling new certificate '%Y' failed",
subject->get_subject(subject));
lib->credmgr->call_hook(lib->credmgr
CRED_HOOK_POLICY_VIOLATION, subject);
}
}
else
@@ -174,6 +176,8 @@ METHOD(cert_validator_t, validate, bool,
DBG1(DBG_CFG, "coupling new certificate '%Y' failed, limit of %d "
"couplings reached", subject->get_subject(subject),
this->max_couplings);
lib->credmgr->call_hook(lib->credmgr, CRED_HOOK_POLICY_VIOLATION,
subject);
}
this->mutex->unlock(this->mutex);
}