[Wine-devel] Eter's patch is applied to winehq repo 11/22/11

builder на builder.office.etersoft.ru builder на builder.office.etersoft.ru
Вт Ноя 22 22:20:57 MSK 2011


New Etersoft's patches since last build time:
commit 9d63e6f944d570c9e0dac175d6ecf4f2df4e45f9
Author: Alexander Morozov <amorozov на etersoft.ru>

    crypt32: Initialize a pointer for dynamic data.

commit fc78c2242ea1cb92c1bede700066bafd33736995
Author: Alexander Morozov <amorozov на etersoft.ru>

    crypt32/tests: Add some tests for CryptDecodeObjectEx without CRYPT_DECODE_ALLOC_FLAG.

---

commit 9d63e6f944d570c9e0dac175d6ecf4f2df4e45f9
Author: Alexander Morozov <amorozov на etersoft.ru>
Date:   Mon Nov 21 19:52:31 2011 +0400

    crypt32: Initialize a pointer for dynamic data.

diff --git a/dlls/crypt32/decode.c b/dlls/crypt32/decode.c
index 649ca55..4a22533 100644
--- a/dlls/crypt32/decode.c
+++ b/dlls/crypt32/decode.c
@@ -1465,7 +1465,10 @@ static BOOL WINAPI CRYPT_AsnDecodeExtensions(DWORD dwCertEncodingType,
          sizeof(CERT_EXTENSIONS),
          CRYPT_AsnDecodeExtension, sizeof(CERT_EXTENSION), TRUE,
          offsetof(CERT_EXTENSION, pszObjId) };
+        CERT_EXTENSIONS *exts = pvStructInfo;
 
+        if (pvStructInfo && !(dwFlags & CRYPT_DECODE_ALLOC_FLAG))
+            exts->rgExtension = (CERT_EXTENSION *)(exts + 1);
         ret = CRYPT_AsnDecodeArray(&arrayDesc, pbEncoded, cbEncoded,
          dwFlags, pDecodePara, pvStructInfo, pcbStructInfo, NULL);
     }
@@ -2356,7 +2359,10 @@ static BOOL WINAPI CRYPT_AsnDecodeSMIMECapabilities(DWORD dwCertEncodingType,
          sizeof(CRYPT_SMIME_CAPABILITIES),
          CRYPT_AsnDecodeSMIMECapability, sizeof(CRYPT_SMIME_CAPABILITY), TRUE,
          offsetof(CRYPT_SMIME_CAPABILITY, pszObjId) };
+        CRYPT_SMIME_CAPABILITIES *capabilities = pvStructInfo;
 
+        if (pvStructInfo && !(dwFlags & CRYPT_DECODE_ALLOC_FLAG))
+            capabilities->rgCapability = (CRYPT_SMIME_CAPABILITY *)(capabilities + 1);
         ret = CRYPT_AsnDecodeArray(&arrayDesc, pbEncoded, cbEncoded,
          dwFlags, pDecodePara, pvStructInfo, pcbStructInfo, NULL);
     }
@@ -2832,7 +2838,10 @@ static BOOL WINAPI CRYPT_AsnDecodePKCSAttributes(DWORD dwCertEncodingType,
          sizeof(CRYPT_ATTRIBUTES),
          CRYPT_AsnDecodePKCSAttributeInternal, sizeof(CRYPT_ATTRIBUTE),
          TRUE, offsetof(CRYPT_ATTRIBUTE, pszObjId) };
+        CRYPT_ATTRIBUTES *attrs = pvStructInfo;
 
+        if (pvStructInfo && !(dwFlags & CRYPT_DECODE_ALLOC_FLAG))
+            attrs->rgAttr = (CRYPT_ATTRIBUTE *)(attrs + 1);
         ret = CRYPT_AsnDecodeArray(&arrayDesc, pbEncoded, cbEncoded,
          dwFlags, pDecodePara, pvStructInfo, pcbStructInfo, NULL);
     }
@@ -3232,7 +3241,10 @@ static BOOL WINAPI CRYPT_AsnDecodeAuthorityInfoAccess(DWORD dwCertEncodingType,
          sizeof(CERT_AUTHORITY_INFO_ACCESS),
          CRYPT_AsnDecodeAccessDescription, sizeof(CERT_ACCESS_DESCRIPTION),
          TRUE, offsetof(CERT_ACCESS_DESCRIPTION, pszAccessMethod) };
+        CERT_AUTHORITY_INFO_ACCESS *info = pvStructInfo;
 
+        if (pvStructInfo && !(dwFlags & CRYPT_DECODE_ALLOC_FLAG))
+            info->rgAccDescr = (CERT_ACCESS_DESCRIPTION *)(info + 1);
         ret = CRYPT_AsnDecodeArray(&arrayDesc, pbEncoded, cbEncoded,
          dwFlags, pDecodePara, pvStructInfo, pcbStructInfo, NULL);
     }
@@ -3653,6 +3665,10 @@ static BOOL WINAPI CRYPT_AsnDecodeCertPolicies(DWORD dwCertEncodingType,
          sizeof(CERT_POLICIES_INFO),
          CRYPT_AsnDecodeCertPolicy, sizeof(CERT_POLICY_INFO), TRUE,
          offsetof(CERT_POLICY_INFO, pszPolicyIdentifier) };
+        CERT_POLICIES_INFO *info = pvStructInfo;
+
+        if (pvStructInfo && !(dwFlags & CRYPT_DECODE_ALLOC_FLAG))
+            info->rgPolicyInfo = (CERT_POLICY_INFO *)(info + 1);
 
         ret = CRYPT_AsnDecodeArray(&arrayDesc, pbEncoded, cbEncoded,
          dwFlags, pDecodePara, pvStructInfo, pcbStructInfo, NULL);
@@ -3706,7 +3722,10 @@ static BOOL WINAPI CRYPT_AsnDecodeCertPolicyMappings(DWORD dwCertEncodingType,
          sizeof(CERT_POLICY_MAPPING),
          CRYPT_AsnDecodeCertPolicyMapping, sizeof(CERT_POLICY_MAPPING), TRUE,
          offsetof(CERT_POLICY_MAPPING, pszIssuerDomainPolicy) };
+        CERT_POLICY_MAPPINGS_INFO *info = pvStructInfo;
 
+        if (pvStructInfo && !(dwFlags & CRYPT_DECODE_ALLOC_FLAG))
+            info->rgPolicyMapping = (CERT_POLICY_MAPPING *)(info + 1);
         ret = CRYPT_AsnDecodeArray(&arrayDesc, pbEncoded, cbEncoded,
          dwFlags, pDecodePara, pvStructInfo, pcbStructInfo, NULL);
     }
@@ -5020,7 +5039,10 @@ static BOOL WINAPI CRYPT_AsnDecodeCRLDistPoints(DWORD dwCertEncodingType,
          sizeof(CRL_DIST_POINTS_INFO),
          CRYPT_AsnDecodeDistPoint, sizeof(CRL_DIST_POINT), TRUE,
          offsetof(CRL_DIST_POINT, DistPointName.u.FullName.rgAltEntry) };
+        CRL_DIST_POINTS_INFO *info = pvStructInfo;
 
+        if (pvStructInfo && !(dwFlags & CRYPT_DECODE_ALLOC_FLAG))
+            info->rgDistPoint = (CRL_DIST_POINT *)(info + 1);
         ret = CRYPT_AsnDecodeArray(&arrayDesc, pbEncoded, cbEncoded,
          dwFlags, pDecodePara, pvStructInfo, pcbStructInfo, NULL);
     }
@@ -5049,7 +5071,10 @@ static BOOL WINAPI CRYPT_AsnDecodeEnhancedKeyUsage(DWORD dwCertEncodingType,
          offsetof(CERT_ENHKEY_USAGE, rgpszUsageIdentifier),
          sizeof(CERT_ENHKEY_USAGE),
          CRYPT_AsnDecodeOidInternal, sizeof(LPSTR), TRUE, 0 };
+        CERT_ENHKEY_USAGE *usage = pvStructInfo;
 
+        if (pvStructInfo && !(dwFlags & CRYPT_DECODE_ALLOC_FLAG))
+            usage->rgpszUsageIdentifier = (LPSTR *)(usage + 1);
         ret = CRYPT_AsnDecodeArray(&arrayDesc, pbEncoded, cbEncoded,
          dwFlags, pDecodePara, pvStructInfo, pcbStructInfo, NULL);
     }
diff --git a/dlls/crypt32/tests/encode.c b/dlls/crypt32/tests/encode.c
index d74b1c9..5d9e76b 100644
--- a/dlls/crypt32/tests/encode.c
+++ b/dlls/crypt32/tests/encode.c
@@ -2718,11 +2718,7 @@ static void test_decodeExtensions(DWORD dwEncoding)
         {
             ret = pCryptDecodeObjectEx(dwEncoding, X509_EXTENSIONS,
              exts[i].encoded, exts[i].encoded[1] + 2, 0, NULL, buf, &bufSize);
-            if (!i)
-                ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
-            else
-                todo_wine
-                ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
+            ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
             HeapFree(GetProcessHeap(), 0, buf);
         }
     }
@@ -3626,7 +3622,6 @@ static void test_decodeCRLDistPoints(DWORD dwEncoding)
         ret = pCryptDecodeObjectEx(dwEncoding, X509_CRL_DIST_POINTS,
          distPointWithUrlAndIssuer, distPointWithUrlAndIssuer[1] + 2, 0,
          NULL, buf, &size);
-        todo_wine
         ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
         HeapFree(GetProcessHeap(), 0, buf);
     }
@@ -4778,7 +4773,6 @@ static void test_decodeEnhancedKeyUsage(DWORD dwEncoding)
     {
         ret = pCryptDecodeObjectEx(dwEncoding, X509_ENHANCED_KEY_USAGE,
          encodedUsage, sizeof(encodedUsage), 0, NULL, buf, &size);
-        todo_wine
         ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
         HeapFree(GetProcessHeap(), 0, buf);
     }
@@ -5266,7 +5260,6 @@ static void test_decodeAuthorityInfoAccess(DWORD dwEncoding)
         ret = pCryptDecodeObjectEx(dwEncoding, X509_AUTHORITY_INFO_ACCESS,
          authorityInfoAccessWithUrlAndIPAddr,
          sizeof(authorityInfoAccessWithUrlAndIPAddr), 0, NULL, buf, &size);
-        todo_wine
         ok(ret, "CryptDecodeObjectEx failed: %x\n", GetLastError());
         HeapFree(GetProcessHeap(), 0, buf);
     }
@@ -6231,7 +6224,6 @@ static void test_decodePKCSAttributes(DWORD dwEncoding)
     {
         ret = pCryptDecodeObjectEx(dwEncoding, PKCS_ATTRIBUTES,
          doublePKCSAttributes, sizeof(doublePKCSAttributes), 0, NULL, buf, &size);
-        todo_wine
         ok(ret, "CryptDecodeObjectEx failed: %x\n", GetLastError());
         HeapFree(GetProcessHeap(), 0, buf);
     }
@@ -6402,7 +6394,6 @@ static void test_decodePKCSSMimeCapabilities(DWORD dwEncoding)
         SetLastError(0xdeadbeef);
         ret = pCryptDecodeObjectEx(dwEncoding, PKCS_SMIME_CAPABILITIES,
          twoCapabilities, sizeof(twoCapabilities), 0, NULL, ptr, &size);
-        todo_wine
         ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
         HeapFree(GetProcessHeap(), 0, ptr);
     }
@@ -7576,7 +7567,6 @@ static void test_decodeCertPolicies(DWORD dwEncoding)
     {
         ret = pCryptDecodeObjectEx(dwEncoding, X509_CERT_POLICIES,
          twoPolicies, sizeof(twoPolicies), 0, NULL, info, &size);
-        todo_wine
         ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
         HeapFree(GetProcessHeap(), 0, info);
     }
@@ -7733,7 +7723,6 @@ static void test_decodeCertPolicyMappings(DWORD dwEncoding)
             ret = pCryptDecodeObjectEx(dwEncoding, mappingOids[i],
              policyMappingWithTwoMappings, sizeof(policyMappingWithTwoMappings), 0,
              NULL, info, &size);
-            todo_wine
             ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
             HeapFree(GetProcessHeap(), 0, info);
         }

commit fc78c2242ea1cb92c1bede700066bafd33736995
Author: Alexander Morozov <amorozov на etersoft.ru>
Date:   Mon Nov 21 19:47:32 2011 +0400

    crypt32/tests: Add some tests for CryptDecodeObjectEx without CRYPT_DECODE_ALLOC_FLAG.

diff --git a/dlls/crypt32/tests/encode.c b/dlls/crypt32/tests/encode.c
index b79c34d..d74b1c9 100644
--- a/dlls/crypt32/tests/encode.c
+++ b/dlls/crypt32/tests/encode.c
@@ -2710,6 +2710,21 @@ static void test_decodeExtensions(DWORD dwEncoding)
             }
             LocalFree(buf);
         }
+        ret = pCryptDecodeObjectEx(dwEncoding, X509_EXTENSIONS,
+         exts[i].encoded, exts[i].encoded[1] + 2, 0, NULL, NULL, &bufSize);
+        ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
+        buf = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, bufSize);
+        if (buf)
+        {
+            ret = pCryptDecodeObjectEx(dwEncoding, X509_EXTENSIONS,
+             exts[i].encoded, exts[i].encoded[1] + 2, 0, NULL, buf, &bufSize);
+            if (!i)
+                ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
+            else
+                todo_wine
+                ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
+            HeapFree(GetProcessHeap(), 0, buf);
+        }
     }
 }
 
@@ -3601,6 +3616,20 @@ static void test_decodeCRLDistPoints(DWORD dwEncoding)
         ok(!lstrcmpW(U(*entry).pwszURL, url), "Unexpected name\n");
         LocalFree(buf);
     }
+    ret = pCryptDecodeObjectEx(dwEncoding, X509_CRL_DIST_POINTS,
+     distPointWithUrlAndIssuer, distPointWithUrlAndIssuer[1] + 2, 0,
+     NULL, NULL, &size);
+    ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
+    buf = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size);
+    if (buf)
+    {
+        ret = pCryptDecodeObjectEx(dwEncoding, X509_CRL_DIST_POINTS,
+         distPointWithUrlAndIssuer, distPointWithUrlAndIssuer[1] + 2, 0,
+         NULL, buf, &size);
+        todo_wine
+        ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
+        HeapFree(GetProcessHeap(), 0, buf);
+    }
 }
 
 static const BYTE badFlagsIDP[] = { 0x30,0x06,0x81,0x01,0xff,0x82,0x01,0xff };
@@ -4741,6 +4770,18 @@ static void test_decodeEnhancedKeyUsage(DWORD dwEncoding)
              usage->rgpszUsageIdentifier[i]);
         LocalFree(buf);
     }
+    ret = pCryptDecodeObjectEx(dwEncoding, X509_ENHANCED_KEY_USAGE,
+     encodedUsage, sizeof(encodedUsage), 0, NULL, NULL, &size);
+    ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
+    buf = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size);
+    if (buf)
+    {
+        ret = pCryptDecodeObjectEx(dwEncoding, X509_ENHANCED_KEY_USAGE,
+         encodedUsage, sizeof(encodedUsage), 0, NULL, buf, &size);
+        todo_wine
+        ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
+        HeapFree(GetProcessHeap(), 0, buf);
+    }
 }
 
 static BYTE keyId[] = { 1,2,3,4 };
@@ -5215,6 +5256,20 @@ static void test_decodeAuthorityInfoAccess(DWORD dwEncoding)
         LocalFree(buf);
         buf = NULL;
     }
+    ret = pCryptDecodeObjectEx(dwEncoding, X509_AUTHORITY_INFO_ACCESS,
+     authorityInfoAccessWithUrlAndIPAddr,
+     sizeof(authorityInfoAccessWithUrlAndIPAddr), 0, NULL, NULL, &size);
+    ok(ret, "CryptDecodeObjectEx failed: %x\n", GetLastError());
+    buf = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size);
+    if (buf)
+    {
+        ret = pCryptDecodeObjectEx(dwEncoding, X509_AUTHORITY_INFO_ACCESS,
+         authorityInfoAccessWithUrlAndIPAddr,
+         sizeof(authorityInfoAccessWithUrlAndIPAddr), 0, NULL, buf, &size);
+        todo_wine
+        ok(ret, "CryptDecodeObjectEx failed: %x\n", GetLastError());
+        HeapFree(GetProcessHeap(), 0, buf);
+    }
 }
 
 static const BYTE emptyCTL[] = {
@@ -6168,6 +6223,18 @@ static void test_decodePKCSAttributes(DWORD dwEncoding)
          attributes->rgAttr[1].rgValue[0].cbData), "Unexpected value\n");
         LocalFree(buf);
     }
+    ret = pCryptDecodeObjectEx(dwEncoding, PKCS_ATTRIBUTES,
+     doublePKCSAttributes, sizeof(doublePKCSAttributes), 0, NULL, NULL, &size);
+    ok(ret, "CryptDecodeObjectEx failed: %x\n", GetLastError());
+    buf = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size);
+    if (buf)
+    {
+        ret = pCryptDecodeObjectEx(dwEncoding, PKCS_ATTRIBUTES,
+         doublePKCSAttributes, sizeof(doublePKCSAttributes), 0, NULL, buf, &size);
+        todo_wine
+        ok(ret, "CryptDecodeObjectEx failed: %x\n", GetLastError());
+        HeapFree(GetProcessHeap(), 0, buf);
+    }
 }
 
 static const BYTE singleCapability[] = {
@@ -6325,6 +6392,20 @@ static void test_decodePKCSSMimeCapabilities(DWORD dwEncoding)
         compareSMimeCapabilities("two capabilities", &capabilities, ptr);
         LocalFree(ptr);
     }
+    SetLastError(0xdeadbeef);
+    ret = pCryptDecodeObjectEx(dwEncoding, PKCS_SMIME_CAPABILITIES,
+     twoCapabilities, sizeof(twoCapabilities), 0, NULL, NULL, &size);
+    ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
+    ptr = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size);
+    if (ptr)
+    {
+        SetLastError(0xdeadbeef);
+        ret = pCryptDecodeObjectEx(dwEncoding, PKCS_SMIME_CAPABILITIES,
+         twoCapabilities, sizeof(twoCapabilities), 0, NULL, ptr, &size);
+        todo_wine
+        ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
+        HeapFree(GetProcessHeap(), 0, ptr);
+    }
 }
 
 static BYTE encodedCommonNameNoNull[] = { 0x30,0x14,0x31,0x12,0x30,0x10,
@@ -7487,6 +7568,18 @@ static void test_decodeCertPolicies(DWORD dwEncoding)
          "unexpected qualifier value\n");
         LocalFree(info);
     }
+    ret = pCryptDecodeObjectEx(dwEncoding, X509_CERT_POLICIES,
+     twoPolicies, sizeof(twoPolicies), 0, NULL, NULL, &size);
+    ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
+    info = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size);
+    if (info)
+    {
+        ret = pCryptDecodeObjectEx(dwEncoding, X509_CERT_POLICIES,
+         twoPolicies, sizeof(twoPolicies), 0, NULL, info, &size);
+        todo_wine
+        ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
+        HeapFree(GetProcessHeap(), 0, info);
+    }
 }
 
 static const BYTE policyMappingWithOneMapping[] = {
@@ -7630,6 +7723,20 @@ static void test_decodeCertPolicyMappings(DWORD dwEncoding)
              info->rgPolicyMapping[1].pszSubjectDomainPolicy);
             LocalFree(info);
         }
+        ret = pCryptDecodeObjectEx(dwEncoding, mappingOids[i],
+         policyMappingWithTwoMappings, sizeof(policyMappingWithTwoMappings), 0,
+         NULL, NULL, &size);
+        ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
+        info = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size);
+        if (info)
+        {
+            ret = pCryptDecodeObjectEx(dwEncoding, mappingOids[i],
+             policyMappingWithTwoMappings, sizeof(policyMappingWithTwoMappings), 0,
+             NULL, info, &size);
+            todo_wine
+            ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
+            HeapFree(GetProcessHeap(), 0, info);
+        }
     }
 }
 


Подробная информация о списке рассылки Wine-devel