Juan Lang : wintrust: Search all additional stores when building a chain, not just the first one.

Alexandre Julliard julliard at winehq.org
Tue Sep 23 09:28:19 CDT 2008


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

Author: Juan Lang <juan.lang at gmail.com>
Date:   Mon Sep 22 10:56:19 2008 -0700

wintrust: Search all additional stores when building a chain, not just the first one.

---

 dlls/wintrust/softpub.c |   17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/dlls/wintrust/softpub.c b/dlls/wintrust/softpub.c
index f8bf69e..8e58f3f 100644
--- a/dlls/wintrust/softpub.c
+++ b/dlls/wintrust/softpub.c
@@ -599,7 +599,20 @@ static BOOL WINTRUST_CreateChainForSigner(CRYPT_PROVIDER_DATA *data,
  PCERT_CHAIN_PARA chainPara)
 {
     BOOL ret = TRUE;
+    HCERTSTORE store = NULL;
 
+    if (data->chStores)
+    {
+        store = CertOpenStore(CERT_STORE_PROV_COLLECTION, 0, 0,
+         CERT_STORE_CREATE_NEW_FLAG, NULL);
+        if (store)
+        {
+            DWORD i;
+
+            for (i = 0; i < data->chStores; i++)
+                CertAddStoreToCollection(store, data->pahStores[i], 0, 0);
+        }
+    }
     /* Expect the end certificate for each signer to be the only cert in the
      * chain:
      */
@@ -608,8 +621,7 @@ static BOOL WINTRUST_CreateChainForSigner(CRYPT_PROVIDER_DATA *data,
         /* Create a certificate chain for each signer */
         ret = CertGetCertificateChain(createInfo->hChainEngine,
          data->pasSigners[signer].pasCertChain[0].pCert,
-         &data->pasSigners[signer].sftVerifyAsOf,
-         data->chStores ? data->pahStores[0] : NULL,
+         &data->pasSigners[signer].sftVerifyAsOf, store,
          chainPara, createInfo->dwFlags, createInfo->pvReserved,
          &data->pasSigners[signer].pChainContext);
         if (ret)
@@ -627,6 +639,7 @@ static BOOL WINTRUST_CreateChainForSigner(CRYPT_PROVIDER_DATA *data,
             }
         }
     }
+    CertCloseStore(store, 0);
     return ret;
 }
 




More information about the wine-cvs mailing list