diff --git a/dlls/crypt32/crl.c b/dlls/crypt32/crl.c index 522aadf616e..f4832562827 100644 --- a/dlls/crypt32/crl.c +++ b/dlls/crypt32/crl.c @@ -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; diff --git a/dlls/crypt32/tests/crl.c b/dlls/crypt32/tests/crl.c index ea344aa8154..d8d8bfcd092 100644 --- a/dlls/crypt32/tests/crl.c +++ b/dlls/crypt32/tests/crl.c @@ -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);