Juan Lang : wintrust: Check for the presence of required members of WINTRUST_CERT_INFO rather than requiring callers to be compiled with the same SDK version .

Alexandre Julliard julliard at winehq.org
Mon Jun 15 07:59:04 CDT 2009


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

Author: Juan Lang <juan.lang at gmail.com>
Date:   Fri Jun 12 09:35:41 2009 -0700

wintrust: Check for the presence of required members of WINTRUST_CERT_INFO rather than requiring callers to be compiled with the same SDK version.

---

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

diff --git a/dlls/wintrust/softpub.c b/dlls/wintrust/softpub.c
index 9c79fa8..7f5f86f 100644
--- a/dlls/wintrust/softpub.c
+++ b/dlls/wintrust/softpub.c
@@ -256,7 +256,8 @@ static BOOL SOFTPUB_LoadCertMessage(CRYPT_PROVIDER_DATA *data)
     BOOL ret;
 
     if (data->pWintrustData->u.pCert &&
-     data->pWintrustData->u.pCert->cbStruct == sizeof(WINTRUST_CERT_INFO))
+     WVT_IS_CBSTRUCT_GT_MEMBEROFFSET(WINTRUST_CERT_INFO,
+     data->pWintrustData->u.pCert->cbStruct, psCertContext))
     {
         if (data->psPfns)
         {
@@ -266,7 +267,9 @@ static BOOL SOFTPUB_LoadCertMessage(CRYPT_PROVIDER_DATA *data)
             /* Add a signer with nothing but the time to verify, so we can
              * add a cert to it
              */
-            if (data->pWintrustData->u.pCert->psftVerifyAsOf)
+            if (WVT_ISINSTRUCT(WINTRUST_CERT_INFO,
+             data->pWintrustData->u.pCert->cbStruct, psftVerifyAsOf) &&
+             data->pWintrustData->u.pCert->psftVerifyAsOf)
                 data->sftSystemTime = signer.sftVerifyAsOf;
             else
             {
@@ -280,10 +283,12 @@ static BOOL SOFTPUB_LoadCertMessage(CRYPT_PROVIDER_DATA *data)
             {
                 ret = data->psPfns->pfnAddCert2Chain(data, 0, FALSE, 0,
                  data->pWintrustData->u.pCert->psCertContext);
-                for (i = 0; ret && i < data->pWintrustData->u.pCert->chStores;
-                 i++)
-                    ret = data->psPfns->pfnAddStore2Chain(data,
-                     data->pWintrustData->u.pCert->pahStores[i]);
+                if (WVT_ISINSTRUCT(WINTRUST_CERT_INFO,
+                 data->pWintrustData->u.pCert->cbStruct, pahStores))
+                        for (i = 0;
+                         ret && i < data->pWintrustData->u.pCert->chStores; i++)
+                            ret = data->psPfns->pfnAddStore2Chain(data,
+                             data->pWintrustData->u.pCert->pahStores[i]);
             }
         }
         else




More information about the wine-cvs mailing list