Author: akhaldi
Date: Thu Mar 19 13:19:05 2015
New Revision: 66808
URL:
http://svn.reactos.org/svn/reactos?rev=66808&view=rev
Log:
[CRYPTNET] Sync with Wine Staging 1.7.37. CORE-9246
Modified:
trunk/reactos/dll/win32/cryptnet/cryptnet_main.c
trunk/reactos/media/doc/README.WINE
Modified: trunk/reactos/dll/win32/cryptnet/cryptnet_main.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/cryptnet/cryptne…
==============================================================================
--- trunk/reactos/dll/win32/cryptnet/cryptnet_main.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/cryptnet/cryptnet_main.c [iso-8859-1] Thu Mar 19 13:19:05
2015
@@ -1186,10 +1186,27 @@
typedef BOOL (WINAPI *AddContextToStore)(HCERTSTORE hCertStore,
const void *pContext, DWORD dwAddDisposition, const void **ppStoreContext);
+static BOOL decode_base64_blob( const CRYPT_DATA_BLOB *in, CRYPT_DATA_BLOB *out )
+{
+ BOOL ret;
+ DWORD len = in->cbData;
+
+ while (len && !in->pbData[len - 1]) len--;
+ if (!CryptStringToBinaryA( (char *)in->pbData, len, CRYPT_STRING_BASE64_ANY,
+ NULL, &out->cbData, NULL, NULL )) return FALSE;
+
+ if (!(out->pbData = CryptMemAlloc( out->cbData ))) return FALSE;
+ ret = CryptStringToBinaryA( (char *)in->pbData, len, CRYPT_STRING_BASE64_ANY,
+ out->pbData, &out->cbData, NULL, NULL );
+ if (!ret) CryptMemFree( out->pbData );
+ return ret;
+}
+
static BOOL CRYPT_CreateContext(const CRYPT_BLOB_ARRAY *pObject,
DWORD dwExpectedContentTypeFlags, AddContextToStore addFunc, void **ppvContext)
{
BOOL ret = TRUE;
+ CRYPT_DATA_BLOB blob;
if (!pObject->cBlob)
{
@@ -1199,9 +1216,20 @@
}
else if (pObject->cBlob == 1)
{
- if (!CryptQueryObject(CERT_QUERY_OBJECT_BLOB, &pObject->rgBlob[0],
- dwExpectedContentTypeFlags, CERT_QUERY_FORMAT_FLAG_BINARY, 0, NULL,
- NULL, NULL, NULL, NULL, (const void **)ppvContext))
+ if (decode_base64_blob(&pObject->rgBlob[0], &blob))
+ {
+ ret = CryptQueryObject(CERT_QUERY_OBJECT_BLOB, &blob,
+ dwExpectedContentTypeFlags, CERT_QUERY_FORMAT_FLAG_BINARY, 0,
+ NULL, NULL, NULL, NULL, NULL, (const void **)ppvContext);
+ CryptMemFree(blob.pbData);
+ }
+ else
+ {
+ ret = CryptQueryObject(CERT_QUERY_OBJECT_BLOB, &pObject->rgBlob[0],
+ dwExpectedContentTypeFlags, CERT_QUERY_FORMAT_FLAG_BINARY, 0,
+ NULL, NULL, NULL, NULL, NULL, (const void **)ppvContext);
+ }
+ if (!ret)
{
SetLastError(CRYPT_E_NO_MATCH);
ret = FALSE;
@@ -1219,10 +1247,21 @@
for (i = 0; i < pObject->cBlob; i++)
{
- if (CryptQueryObject(CERT_QUERY_OBJECT_BLOB,
- &pObject->rgBlob[i], dwExpectedContentTypeFlags,
- CERT_QUERY_FORMAT_FLAG_BINARY, 0, NULL, NULL, NULL, NULL,
- NULL, &context))
+ if (decode_base64_blob(&pObject->rgBlob[i], &blob))
+ {
+ ret = CryptQueryObject(CERT_QUERY_OBJECT_BLOB, &blob,
+ dwExpectedContentTypeFlags, CERT_QUERY_FORMAT_FLAG_BINARY,
+ 0, NULL, NULL, NULL, NULL, NULL, &context);
+ CryptMemFree(blob.pbData);
+ }
+ else
+ {
+ ret = CryptQueryObject(CERT_QUERY_OBJECT_BLOB,
+ &pObject->rgBlob[i], dwExpectedContentTypeFlags,
+ CERT_QUERY_FORMAT_FLAG_BINARY, 0, NULL, NULL, NULL, NULL,
+ NULL, &context);
+ }
+ if (ret)
{
if (!addFunc(store, context, CERT_STORE_ADD_ALWAYS, NULL))
ret = FALSE;
Modified: trunk/reactos/media/doc/README.WINE
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
==============================================================================
--- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original)
+++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Thu Mar 19 13:19:05 2015
@@ -68,7 +68,7 @@
reactos/dll/win32/crypt32 # Synced to WineStaging-1.7.37
reactos/dll/win32/cryptdlg # Synced to Wine-1.7.27
reactos/dll/win32/cryptdll # Synced to Wine-1.7.27
-reactos/dll/win32/cryptnet # Synced to Wine-1.7.27
+reactos/dll/win32/cryptnet # Synced to WineStaging-1.7.37
reactos/dll/win32/cryptui # Synced to Wine-1.7.27
reactos/dll/win32/dbghelp # Synced to Wine-1.7.27
reactos/dll/win32/dciman32 # Synced to Wine-1.7.27