Add a cert_validator hook allowing plugins to provide custom lifetime checking

This commit is contained in:
Martin Willi
2013-02-19 14:31:18 +01:00
parent 790e00aaa9
commit de399f550d
2 changed files with 64 additions and 10 deletions
@@ -34,6 +34,22 @@ typedef struct cert_validator_t cert_validator_t;
*/
struct cert_validator_t {
/**
* Check the lifetime of a certificate.
*
* If this function returns SUCCESS or FAILED, the certificate lifetime is
* considered definitely (in-)valid, without asking other validators.
* If all registered validaters return NEED_MORE, the default
* lifetime check is performed.
*
* @param cert certificate to check lifetime
* @param pathlen the current length of the path bottom-up
* @param anchor is certificate trusted root anchor?
* @param auth container for resulting authentication info
* @return SUCCESS, FAILED or NEED_MORE to ask next validator
*/
status_t (*check_lifetime)(cert_validator_t *this, certificate_t *cert,
int pathlen, bool anchor, auth_cfg_t *auth);
/**
* Validate a subject certificate in relation to its issuer.
*