cryptnet: If the caller specifies the location of a CRL, check a cert's revocation status against it.
This commit is contained in:
parent
44e4ac2128
commit
60ddb1365d
|
@ -1581,10 +1581,36 @@ static DWORD verify_cert_revocation(PCCERT_CONTEXT cert, DWORD index,
|
||||||
ret = CryptGetObjectUrl(URL_OID_CERTIFICATE_CRL_DIST_POINT, (void *)cert,
|
ret = CryptGetObjectUrl(URL_OID_CERTIFICATE_CRL_DIST_POINT, (void *)cert,
|
||||||
0, NULL, &cbUrlArray, NULL, NULL, NULL);
|
0, NULL, &cbUrlArray, NULL, NULL, NULL);
|
||||||
if (!ret && GetLastError() == CRYPT_E_NOT_FOUND)
|
if (!ret && GetLastError() == CRYPT_E_NOT_FOUND)
|
||||||
|
{
|
||||||
|
if (pRevPara && pRevPara->hCrlStore && pRevPara->pIssuerCert)
|
||||||
|
{
|
||||||
|
PCCRL_CONTEXT crl;
|
||||||
|
|
||||||
|
/* If the caller was helpful enough to tell us where to find a CRL
|
||||||
|
* for the cert, look for one and check it.
|
||||||
|
*/
|
||||||
|
crl = CertFindCRLInStore(pRevPara->hCrlStore,
|
||||||
|
cert->dwCertEncodingType,
|
||||||
|
CRL_FIND_ISSUED_BY_SIGNATURE_FLAG | CRL_FIND_ISSUED_BY_AKI_FLAG,
|
||||||
|
CRL_FIND_ISSUED_BY, pRevPara->pIssuerCert, NULL);
|
||||||
|
if (crl)
|
||||||
|
{
|
||||||
|
error = verify_cert_revocation_with_crl(cert, crl, index,
|
||||||
|
pTime, pRevStatus);
|
||||||
|
CertFreeCRLContext(crl);
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
error = CRYPT_E_NO_REVOCATION_CHECK;
|
error = CRYPT_E_NO_REVOCATION_CHECK;
|
||||||
pRevStatus->dwIndex = index;
|
pRevStatus->dwIndex = index;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
error = CRYPT_E_NO_REVOCATION_CHECK;
|
||||||
|
pRevStatus->dwIndex = index;
|
||||||
|
}
|
||||||
|
}
|
||||||
else if (ret)
|
else if (ret)
|
||||||
{
|
{
|
||||||
CRYPT_URL_ARRAY *urlArray = CryptMemAlloc(cbUrlArray);
|
CRYPT_URL_ARRAY *urlArray = CryptMemAlloc(cbUrlArray);
|
||||||
|
|
Loading…
Reference in New Issue