/**
* validate a x509 certificate using OCSP
*/
-static cert_validation_t check_ocsp(x509_t *subject, x509_t *issuer,
+static cert_validation_t check_ocsp(private_revocation_validator_t *this,
+ x509_t *subject, x509_t *issuer,
auth_cfg_t *auth, u_int timeout,
certificate_t **response)
{
/**
* Find or fetch a certificate for a given crlIssuer
*/
-static cert_validation_t find_crl(x509_t *subject, identification_t *issuer,
+static cert_validation_t find_crl(private_revocation_validator_t *this,
+ x509_t *subject, identification_t *issuer,
crl_t *base, certificate_t **best,
bool *uri_found, u_int timeout)
{
/**
* Look for a delta CRL for a given base CRL
*/
-static cert_validation_t check_delta_crl(x509_t *subject, x509_t *issuer,
+static cert_validation_t check_delta_crl(private_revocation_validator_t *this,
+ x509_t *subject, x509_t *issuer,
crl_t *base, cert_validation_t base_valid,
u_int timeout)
{
if (chunk.len)
{
id = identification_create_from_encoding(ID_KEY_ID, chunk);
- valid = find_crl(subject, id, base, &best, &uri, timeout);
+ valid = find_crl(this, subject, id, base, &best, &uri, timeout);
id->destroy(id);
}
{
if (cdp->issuer)
{
- valid = find_crl(subject, cdp->issuer, base, &best, &uri, timeout);
+ valid = find_crl(this, subject, cdp->issuer, base, &best, &uri,
+ timeout);
}
}
enumerator->destroy(enumerator);
/**
* validate a x509 certificate using CRL
*/
-static cert_validation_t check_crl(x509_t *subject, x509_t *issuer,
+static cert_validation_t check_crl(private_revocation_validator_t *this,
+ x509_t *subject, x509_t *issuer,
auth_cfg_t *auth, u_int timeout)
{
cert_validation_t valid = VALIDATION_SKIPPED;
if (chunk.len)
{
id = identification_create_from_encoding(ID_KEY_ID, chunk);
- valid = find_crl(subject, id, NULL, &best, &uri_found, timeout);
+ valid = find_crl(this, subject, id, NULL, &best, &uri_found, timeout);
id->destroy(id);
}
{
if (cdp->issuer)
{
- valid = find_crl(subject, cdp->issuer, NULL, &best, &uri_found,
- timeout);
+ valid = find_crl(this, subject, cdp->issuer, NULL, &best,
+ &uri_found, timeout);
}
}
enumerator->destroy(enumerator);
/* look for delta CRLs */
if (best && (valid == VALIDATION_GOOD || valid == VALIDATION_STALE))
{
- valid = check_delta_crl(subject, issuer, (crl_t*)best, valid, timeout);
+ valid = check_delta_crl(this, subject, issuer, (crl_t*)best, valid,
+ timeout);
}
/* an uri was found, but no result. switch validation state to failed */
if (enable_ocsp)
{
- switch (check_ocsp((x509_t*)subject, (x509_t*)issuer, auth, timeout,
- NULL))
+ switch (check_ocsp(this, (x509_t*)subject, (x509_t*)issuer,
+ auth, timeout, NULL))
{
case VALIDATION_GOOD:
DBG1(DBG_CFG, "certificate status is good");
if (enable_crl)
{
- switch (check_crl((x509_t*)subject, (x509_t*)issuer, auth, timeout))
+ switch (check_crl(this, (x509_t*)subject, (x509_t*)issuer, auth,
+ timeout))
{
case VALIDATION_GOOD:
DBG1(DBG_CFG, "certificate status is good");
subject->get_subject(subject));
auth = auth_cfg_create();
- switch (check_ocsp((x509_t*)subject, (x509_t*)issuer, auth, timeout,
- &response))
+ switch (check_ocsp(this, (x509_t*)subject, (x509_t*)issuer,
+ auth, timeout, &response))
{
case VALIDATION_GOOD:
case VALIDATION_ON_HOLD: