Juan Lang : crypt32:
Pass crypto provider and appropriate flags when opening PKCS messages,
and don't store a redundant copy of the crypto provider in message
stores.
Alexandre Julliard
julliard at wine.codeweavers.com
Mon Aug 20 07:42:38 CDT 2007
Module: wine
Branch: master
Commit: 4e1108533b98f0c50519eb7dd2227a9c0c3f214a
URL: http://source.winehq.org/git/wine.git/?a=commit;h=4e1108533b98f0c50519eb7dd2227a9c0c3f214a
Author: Juan Lang <juan.lang at gmail.com>
Date: Fri Aug 17 11:57:48 2007 -0700
crypt32: Pass crypto provider and appropriate flags when opening PKCS messages, and don't store a redundant copy of the crypto provider in message stores.
---
dlls/crypt32/store.c | 11 ++++++-----
1 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/dlls/crypt32/store.c b/dlls/crypt32/store.c
index 43e724f..28c8433 100644
--- a/dlls/crypt32/store.c
+++ b/dlls/crypt32/store.c
@@ -96,7 +96,6 @@ typedef struct _WINE_MEMSTORE
typedef struct _WINE_MSGSTOREINFO
{
DWORD dwOpenFlags;
- HCRYPTPROV cryptProv;
HCERTSTORE memStore;
HCRYPTMSG msg;
} WINE_MSGSTOREINFO, *PWINE_MSGSTOREINFO;
@@ -603,7 +602,6 @@ static PWINECRYPT_CERTSTORE CRYPT_MsgOpenStore(HCRYPTPROV hCryptProv,
CERT_STORE_PROV_INFO provInfo = { 0 };
info->dwOpenFlags = dwFlags;
- info->cryptProv = hCryptProv;
info->memStore = memStore;
info->msg = CryptMsgDuplicate(msg);
provInfo.cbSize = sizeof(provInfo);
@@ -631,16 +629,19 @@ static PWINECRYPT_CERTSTORE CRYPT_PKCSOpenStore(HCRYPTPROV hCryptProv,
PWINECRYPT_CERTSTORE store = NULL;
const CRYPT_DATA_BLOB *data = (const CRYPT_DATA_BLOB *)pvPara;
BOOL ret;
+ DWORD msgOpenFlags = dwFlags & CERT_STORE_NO_CRYPT_RELEASE_FLAG ? 0 :
+ CMSG_CRYPT_RELEASE_CONTEXT_FLAG;
TRACE("(%ld, %08x, %p)\n", hCryptProv, dwFlags, pvPara);
- msg = CryptMsgOpenToDecode(PKCS_7_ASN_ENCODING, 0, CMSG_SIGNED, 0, NULL,
- NULL);
+ msg = CryptMsgOpenToDecode(PKCS_7_ASN_ENCODING, msgOpenFlags, CMSG_SIGNED,
+ hCryptProv, NULL, NULL);
ret = CryptMsgUpdate(msg, data->pbData, data->cbData, TRUE);
if (!ret)
{
CryptMsgClose(msg);
- msg = CryptMsgOpenToDecode(PKCS_7_ASN_ENCODING, 0, 0, 0, NULL, NULL);
+ msg = CryptMsgOpenToDecode(PKCS_7_ASN_ENCODING, msgOpenFlags, 0,
+ hCryptProv, NULL, NULL);
ret = CryptMsgUpdate(msg, data->pbData, data->cbData, TRUE);
if (ret)
{
More information about the wine-cvs
mailing list