Module: wine
Branch: refs/heads/master
Commit: 30bf5d9adb55dc0879e47a9790961b4bc3507ad8
URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=30bf5d9adb55dc0879e47a9…
Author: Juan Lang <juan_lang(a)yahoo.com>
Date: Mon Jul 17 23:02:57 2006 -0700
crypt32: Fix reading key prov info from serialized data.
---
dlls/crypt32/cert.c | 7 +------
dlls/crypt32/crypt32_private.h | 8 ++++++++
dlls/crypt32/serialize.c | 10 ++++++++++
3 files changed, 19 insertions(+), 6 deletions(-)
diff --git a/dlls/crypt32/cert.c b/dlls/crypt32/cert.c
index b5d510d..6297e72 100644
--- a/dlls/crypt32/cert.c
+++ b/dlls/crypt32/cert.c
@@ -244,12 +244,7 @@ static BOOL WINAPI CertContext_GetProper
return ret;
}
-/* info is assumed to be a CRYPT_KEY_PROV_INFO, followed by its container name,
- * provider name, and any provider parameters, in a contiguous buffer, but
- * where info's pointers are assumed to be invalid. Upon return, info's
- * pointers point to the appropriate memory locations.
- */
-static void CRYPT_FixKeyProvInfoPointers(PCRYPT_KEY_PROV_INFO info)
+void CRYPT_FixKeyProvInfoPointers(PCRYPT_KEY_PROV_INFO info)
{
DWORD i, containerLen, provNameLen;
LPBYTE data = (LPBYTE)info + sizeof(CRYPT_KEY_PROV_INFO);
diff --git a/dlls/crypt32/crypt32_private.h b/dlls/crypt32/crypt32_private.h
index 3ef44b4..99c1dfe 100644
--- a/dlls/crypt32/crypt32_private.h
+++ b/dlls/crypt32/crypt32_private.h
@@ -97,6 +97,14 @@ extern PCWINE_CONTEXT_INTERFACE pCTLInte
const void *CRYPT_ReadSerializedElement(const BYTE *pbElement,
DWORD cbElement, DWORD dwContextTypeFlags, DWORD *pdwContentType);
+/* Fixes up the the pointers in info, where info is assumed to be a
+ * CRYPT_KEY_PROV_INFO, followed by its container name, provider name, and any
+ * provider parameters, in a contiguous buffer, but where info's pointers are
+ * assumed to be invalid. Upon return, info's pointers point to the
+ * appropriate memory locations.
+ */
+void CRYPT_FixKeyProvInfoPointers(PCRYPT_KEY_PROV_INFO info);
+
DWORD CertStore_GetAccessState(HCERTSTORE hCertStore);
/**
diff --git a/dlls/crypt32/serialize.c b/dlls/crypt32/serialize.c
index b0765a7..afcd13f 100644
--- a/dlls/crypt32/serialize.c
+++ b/dlls/crypt32/serialize.c
@@ -363,6 +363,16 @@ const void *CRYPT_ReadSerializedElement(
ret = contextInterface->setProp(context,
hdr->propID, 0, pbElement);
break;
+ case CERT_KEY_PROV_INFO_PROP_ID:
+ {
+ PCRYPT_KEY_PROV_INFO info =
+ (PCRYPT_KEY_PROV_INFO)pbElement;
+
+ CRYPT_FixKeyProvInfoPointers(info);
+ ret = contextInterface->setProp(context,
+ hdr->propID, 0, pbElement);
+ break;
+ }
default:
FIXME("prop ID %ld: stub\n", hdr->propID);
}