Juan Lang : wintrust: Partially implement SoftpubLoadMessage for catalog files.

Alexandre Julliard julliard at winehq.org
Fri Oct 24 08:12:43 CDT 2008


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

Author: Juan Lang <juan.lang at gmail.com>
Date:   Thu Oct 23 17:14:13 2008 -0700

wintrust: Partially implement SoftpubLoadMessage for catalog files.

---

 dlls/wintrust/softpub.c |   40 ++++++++++++++++++++++++++++++++++++++++
 1 files changed, 40 insertions(+), 0 deletions(-)

diff --git a/dlls/wintrust/softpub.c b/dlls/wintrust/softpub.c
index 57b581a..e0acf03 100644
--- a/dlls/wintrust/softpub.c
+++ b/dlls/wintrust/softpub.c
@@ -329,6 +329,43 @@ error:
     return ret;
 }
 
+static BOOL SOFTPUB_LoadCatalogMessage(CRYPT_PROVIDER_DATA *data)
+{
+    BOOL ret;
+    HANDLE catalog = INVALID_HANDLE_VALUE;
+
+    if (!data->pWintrustData->u.pCatalog)
+    {
+        SetLastError(ERROR_INVALID_PARAMETER);
+        return FALSE;
+    }
+    catalog = CreateFileW(data->pWintrustData->u.pCatalog->pcwszCatalogFilePath,
+     GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL,
+     NULL);
+    if (catalog == INVALID_HANDLE_VALUE)
+        return FALSE;
+    ret = CryptSIPRetrieveSubjectGuid(
+     data->pWintrustData->u.pCatalog->pcwszCatalogFilePath, catalog,
+     &data->u.pPDSip->gSubject);
+    if (!ret)
+        goto error;
+    ret = SOFTPUB_GetSIP(data);
+    if (!ret)
+        goto error;
+    ret = SOFTPUB_GetMessageFromFile(data, catalog,
+     data->pWintrustData->u.pCatalog->pcwszCatalogFilePath);
+    if (!ret)
+        goto error;
+    ret = SOFTPUB_CreateStoreFromMessage(data);
+    if (!ret)
+        goto error;
+    ret = SOFTPUB_DecodeInnerContent(data);
+    /* FIXME: this loads the catalog file, but doesn't validate the member. */
+error:
+    CloseHandle(catalog);
+    return ret;
+}
+
 HRESULT WINAPI SoftpubLoadMessage(CRYPT_PROVIDER_DATA *data)
 {
     BOOL ret;
@@ -346,6 +383,9 @@ HRESULT WINAPI SoftpubLoadMessage(CRYPT_PROVIDER_DATA *data)
     case WTD_CHOICE_FILE:
         ret = SOFTPUB_LoadFileMessage(data);
         break;
+    case WTD_CHOICE_CATALOG:
+        ret = SOFTPUB_LoadCatalogMessage(data);
+        break;
     default:
         FIXME("unimplemented for %d\n", data->pWintrustData->dwUnionChoice);
         SetLastError(ERROR_INVALID_PARAMETER);




More information about the wine-cvs mailing list