Commit 4fa4f67c authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

crypt32: Implement CertFindCRLInStore for find type CRL_FIND_ISSUED_FOR.

parent a3b462e3
......@@ -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,
&para->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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment