Juan Lang : crypt32: Implement CertFindCRLInStore for find type CRL_FIND_ISSUED_FOR.

Alexandre Julliard julliard at winehq.org
Thu Nov 19 10:15:21 CST 2009


Module: wine
Branch: master
Commit: 4fa4f67c79d3aa38e85c8f2ea3658afb7e163864
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=4fa4f67c79d3aa38e85c8f2ea3658afb7e163864

Author: Juan Lang <juan.lang at gmail.com>
Date:   Wed Nov 18 10:40:08 2009 -0800

crypt32: Implement CertFindCRLInStore for find type CRL_FIND_ISSUED_FOR.

---

 dlls/crypt32/crl.c       |   17 +++++++++++++++++
 dlls/crypt32/tests/crl.c |    4 ----
 2 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/dlls/crypt32/crl.c b/dlls/crypt32/crl.c
index 522aadf..f483256 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,
+     &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;
diff --git a/dlls/crypt32/tests/crl.c b/dlls/crypt32/tests/crl.c
index ea344aa..d8d8bfc 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);




More information about the wine-cvs mailing list