fixed a certinfo_t memory leak in verify()
This commit is contained in:
@@ -621,7 +621,7 @@ static bool verify(private_local_credential_store_t *this, x509_t *cert, bool *f
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* first check certificate revocation using ocsp */
|
/* first check certificate revocation using ocsp */
|
||||||
status = issuer->verify_by_ocsp(issuer, cert, certinfo, &this->public);
|
status = issuer->verify_by_ocsp(issuer, cert, certinfo, &this->public.credential_store);
|
||||||
|
|
||||||
/* if ocsp service is not available then fall back to crl */
|
/* if ocsp service is not available then fall back to crl */
|
||||||
if ((status == CERT_UNDEFINED) || (status == CERT_UNKNOWN && this->strict))
|
if ((status == CERT_UNDEFINED) || (status == CERT_UNKNOWN && this->strict))
|
||||||
@@ -642,6 +642,7 @@ static bool verify(private_local_credential_store_t *this, x509_t *cert, bool *f
|
|||||||
if (this->strict && nextUpdate < time(NULL))
|
if (this->strict && nextUpdate < time(NULL))
|
||||||
{
|
{
|
||||||
DBG2(DBG_CFG, "certificate is good but status is stale");
|
DBG2(DBG_CFG, "certificate is good but status is stale");
|
||||||
|
certinfo->destroy(certinfo);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
DBG2(DBG_CFG, "certificate is good");
|
DBG2(DBG_CFG, "certificate is good");
|
||||||
@@ -677,6 +678,7 @@ static bool verify(private_local_credential_store_t *this, x509_t *cert, bool *f
|
|||||||
certinfo->get_revocationTime(certinfo));
|
certinfo->get_revocationTime(certinfo));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
certinfo->destroy(certinfo);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
case CERT_UNKNOWN:
|
case CERT_UNKNOWN:
|
||||||
@@ -690,6 +692,7 @@ static bool verify(private_local_credential_store_t *this, x509_t *cert, bool *f
|
|||||||
{
|
{
|
||||||
cert_copy->set_status(cert_copy, CERT_UNTRUSTED);
|
cert_copy->set_status(cert_copy, CERT_UNTRUSTED);
|
||||||
}
|
}
|
||||||
|
certinfo->destroy(certinfo);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user