crypt32: Implement CertFindCRLInStore for find type CRL_FIND_ISSUED_FOR.
This commit is contained in:
parent
a3b462e3ea
commit
4fa4f67c79
|
@ -137,6 +137,20 @@ static BOOL compare_crl_existing(PCCRL_CONTEXT pCrlContext, DWORD dwType,
|
|||
return ret;
|
||||
}
|
||||
|
||||
static BOOL compare_crl_issued_for(PCCRL_CONTEXT pCrlContext, DWORD dwType,
|
||||
DWORD dwFlags, const void *pvPara)
|
||||
{
|
||||
const CRL_FIND_ISSUED_FOR_PARA *para = pvPara;
|
||||
BOOL ret;
|
||||
|
||||
ret = CertCompareCertificateName(para->pIssuerCert->dwCertEncodingType,
|
||||
¶->pIssuerCert->pCertInfo->Issuer, &pCrlContext->pCrlInfo->Issuer);
|
||||
if (ret)
|
||||
ret = CertIsValidCRLForCertificate(para->pSubjectCert, pCrlContext,
|
||||
0, NULL);
|
||||
return ret;
|
||||
}
|
||||
|
||||
PCCRL_CONTEXT WINAPI CertFindCRLInStore(HCERTSTORE hCertStore,
|
||||
DWORD dwCertEncodingType, DWORD dwFindFlags, DWORD dwFindType,
|
||||
const void *pvFindPara, PCCRL_CONTEXT pPrevCrlContext)
|
||||
|
@ -158,6 +172,9 @@ PCCRL_CONTEXT WINAPI CertFindCRLInStore(HCERTSTORE hCertStore,
|
|||
case CRL_FIND_EXISTING:
|
||||
compare = compare_crl_existing;
|
||||
break;
|
||||
case CRL_FIND_ISSUED_FOR:
|
||||
compare = compare_crl_issued_for;
|
||||
break;
|
||||
default:
|
||||
FIXME("find type %08x unimplemented\n", dwFindType);
|
||||
compare = NULL;
|
||||
|
|
|
@ -390,7 +390,6 @@ static void testFindCRL(void)
|
|||
issuedForPara.pIssuerCert = cert;
|
||||
context = pCertFindCRLInStore(store, 0, 0, CRL_FIND_ISSUED_FOR,
|
||||
&issuedForPara, NULL);
|
||||
todo_wine
|
||||
ok(context != NULL, "Expected a context\n");
|
||||
if (context)
|
||||
{
|
||||
|
@ -433,12 +432,10 @@ static void testFindCRL(void)
|
|||
* match cert's issuer, but verisignCRL does not, so the expected count
|
||||
* is 0.
|
||||
*/
|
||||
todo_wine
|
||||
ok(count == 3, "expected 3 matching CRLs, got %d\n", count);
|
||||
/* Only v1CRLWithIssuerAndEntry and v2CRLWithIssuingDistPoint contain
|
||||
* entries, so the count of CRL entries that match cert is 2.
|
||||
*/
|
||||
todo_wine
|
||||
ok(revoked_count == 2, "expected 2 matching CRL entries, got %d\n",
|
||||
revoked_count);
|
||||
|
||||
|
@ -495,7 +492,6 @@ static void testFindCRL(void)
|
|||
revoked_count++;
|
||||
}
|
||||
} while (context);
|
||||
todo_wine
|
||||
ok(count == 1, "expected 1 matching CRLs, got %d\n", count);
|
||||
ok(revoked_count == 0, "expected 0 matching CRL entries, got %d\n",
|
||||
revoked_count);
|
||||
|
|
Loading…
Reference in New Issue