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

builder на builder.office.etersoft.ru builder на builder.office.etersoft.ru
Ср Ноя 24 21:20:30 MSK 2010


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

    crypt32/tests: Use pCryptAcquireContextA.

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

    crypt32/tests: Fix test failures on WinME and some NT4.

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

    crypt32/tests: Do not crash on some Win98.

---

commit d8cad3eb1be43c44b5d40dbe92559f4f6c746689
Author: Alexander Morozov <amorozov на etersoft.ru>
Date:   Tue Nov 23 13:50:22 2010 +0300

    crypt32/tests: Use pCryptAcquireContextA.

diff --git a/dlls/crypt32/tests/message.c b/dlls/crypt32/tests/message.c
index b7114b7..392ec47 100644
--- a/dlls/crypt32/tests/message.c
+++ b/dlls/crypt32/tests/message.c
@@ -27,6 +27,23 @@
 
 #include "wine/test.h"
 
+static BOOL (WINAPI * pCryptAcquireContextA)
+                        (HCRYPTPROV *, LPCSTR, LPCSTR, DWORD, DWORD);
+
+static void init_function_pointers(void)
+{
+    HMODULE hAdvapi32 = GetModuleHandleA("advapi32.dll");
+
+#define GET_PROC(dll, func) \
+    p ## func = (void *)GetProcAddress(dll, #func); \
+    if(!p ## func) \
+      trace("GetProcAddress(%s) failed\n", #func);
+
+    GET_PROC(hAdvapi32, CryptAcquireContextA)
+
+#undef GET_PROC
+}
+
 static const BYTE dataEmptyBareContent[] = { 0x04,0x00 };
 static const BYTE dataEmptyContent[] = {
 0x30,0x0f,0x06,0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01,0x07,0x01,0xa0,0x02,
@@ -1001,7 +1018,7 @@ static void test_sign_message(void)
     ok(signedBlobSize, "bad size\n");
 
     SetLastError(0xdeadbeef);
-    ret = CryptAcquireContextA(&hCryptProv, NULL, NULL, PROV_RSA_FULL,
+    ret = pCryptAcquireContextA(&hCryptProv, NULL, NULL, PROV_RSA_FULL,
      CRYPT_VERIFYCONTEXT);
     ok(ret, "CryptAcquireContextA failed: %08x\n", GetLastError());
     SetLastError(0xdeadbeef);
@@ -1188,7 +1205,7 @@ static void test_encrypt_message(void)
     DWORD encryptedBlobSize;
 
     SetLastError(0xdeadbeef);
-    ret = CryptAcquireContextA(&hCryptProv, NULL, NULL, PROV_RSA_FULL,
+    ret = pCryptAcquireContextA(&hCryptProv, NULL, NULL, PROV_RSA_FULL,
      CRYPT_VERIFYCONTEXT);
     ok(ret, "CryptAcquireContextA failed: %08x\n", GetLastError());
 
@@ -1343,6 +1360,8 @@ static void test_encrypt_message(void)
 
 START_TEST(message)
 {
+    init_function_pointers();
+
     test_msg_get_signer_count();
     test_verify_detached_message_hash();
     test_verify_message_hash();
diff --git a/dlls/crypt32/tests/msg.c b/dlls/crypt32/tests/msg.c
index 90dd783..898b10c 100644
--- a/dlls/crypt32/tests/msg.c
+++ b/dlls/crypt32/tests/msg.c
@@ -3100,7 +3100,7 @@ static void test_decode_msg_get_param(void)
     check_param("enveloped empty content", msg, CMSG_CONTENT_PARAM, NULL, 0);
     CryptMsgClose(msg);
 
-    CryptAcquireContextA(&hCryptProv, NULL, MS_ENHANCED_PROV_A, PROV_RSA_FULL,
+    pCryptAcquireContextA(&hCryptProv, NULL, MS_ENHANCED_PROV_A, PROV_RSA_FULL,
      CRYPT_VERIFYCONTEXT);
     SetLastError(0xdeadbeef);
     ret = CryptImportKey(hCryptProv, publicPrivateKeyPair,

commit 676d5db65a54e7dc661f3634ea96943943d11bb7
Author: Alexander Morozov <amorozov на etersoft.ru>
Date:   Tue Nov 23 13:42:10 2010 +0300

    crypt32/tests: Fix test failures on WinME and some NT4.

diff --git a/dlls/crypt32/tests/msg.c b/dlls/crypt32/tests/msg.c
index d560c30..90dd783 100644
--- a/dlls/crypt32/tests/msg.c
+++ b/dlls/crypt32/tests/msg.c
@@ -2159,7 +2159,9 @@ static void test_enveloped_msg_update(void)
         SetLastError(0xdeadbeef);
         ret = CryptMsgUpdate(msg, msgData, sizeof(msgData), TRUE);
         todo_wine
-        ok(ret, "CryptMsgUpdate failed: %08x\n", GetLastError());
+        ok(ret ||
+         broken(!ret && GetLastError() == NTE_PERM), /* some NT4 */
+         "CryptMsgUpdate failed: %08x\n", GetLastError());
         SetLastError(0xdeadbeef);
         ret = CryptMsgUpdate(msg, NULL, 0, TRUE);
         todo_wine
@@ -2204,7 +2206,9 @@ static void test_enveloped_msg_update(void)
         SetLastError(0xdeadbeef);
         ret = CryptMsgUpdate(msg, msgData, sizeof(msgData), TRUE);
         todo_wine
-        ok(ret, "CryptMsgUpdate failed: %08x\n", GetLastError());
+        ok(ret ||
+         broken(!ret && GetLastError() == NTE_PERM), /* some NT4 */
+         "CryptMsgUpdate failed: %08x\n", GetLastError());
         CryptMsgClose(msg);
     }
     SetLastError(0xdeadbeef);
@@ -2242,7 +2246,9 @@ static void test_enveloped_msg_update(void)
         SetLastError(0xdeadbeef);
         ret = CryptMsgUpdate(msg, msgData, sizeof(msgData), TRUE);
         todo_wine
-        ok(ret, "CryptMsgUpdate failed: %08x\n", GetLastError());
+        ok(ret ||
+         broken(!ret && GetLastError() == NTE_PERM), /* some NT4 */
+         "CryptMsgUpdate failed: %08x\n", GetLastError());
         CryptMsgClose(msg);
     }
 }
@@ -2863,7 +2869,7 @@ static void test_decode_msg_get_param(void)
 {
     HCRYPTMSG msg;
     HCRYPTPROV hCryptProv;
-    HCRYPTKEY key;
+    HCRYPTKEY key = 0;
     BOOL ret;
     DWORD size = 0, value;
     LPBYTE buf;
@@ -3099,27 +3105,34 @@ static void test_decode_msg_get_param(void)
     SetLastError(0xdeadbeef);
     ret = CryptImportKey(hCryptProv, publicPrivateKeyPair,
      sizeof(publicPrivateKeyPair), 0, 0, &key);
-    ok(ret, "CryptImportKey failed: %08x\n", GetLastError());
+    ok(ret ||
+     broken(!ret && GetLastError() == NTE_PERM), /* WinME and some NT4 */
+     "CryptImportKey failed: %08x\n", GetLastError());
 
     msg = CryptMsgOpenToDecode(PKCS_7_ASN_ENCODING, 0, 0, 0, NULL, NULL);
     CryptMsgUpdate(msg, envelopedMessage, sizeof(envelopedMessage), TRUE);
     todo_wine
     check_param("enveloped message before decrypting", msg, CMSG_CONTENT_PARAM,
      envelopedMessage + sizeof(envelopedMessage) - 4, 4);
-    decryptPara.hCryptProv = hCryptProv;
-    SetLastError(0xdeadbeef);
-    ret = CryptMsgControl(msg, 0, CMSG_CTRL_DECRYPT, &decryptPara);
-    todo_wine
-    ok(ret, "CryptMsgControl failed: %08x\n", GetLastError());
-    decryptPara.hCryptProv = 0;
-    SetLastError(0xdeadbeef);
-    ret = CryptMsgControl(msg, 0, CMSG_CTRL_DECRYPT, &decryptPara);
-    todo_wine
-    ok(!ret && GetLastError() == CRYPT_E_ALREADY_DECRYPTED,
-     "expected CRYPT_E_ALREADY_DECRYPTED, got %08x\n", GetLastError());
-    todo_wine
-    check_param("enveloped message", msg, CMSG_CONTENT_PARAM, msgData,
-     sizeof(msgData));
+    if (key)
+    {
+        decryptPara.hCryptProv = hCryptProv;
+        SetLastError(0xdeadbeef);
+        ret = CryptMsgControl(msg, 0, CMSG_CTRL_DECRYPT, &decryptPara);
+        todo_wine
+        ok(ret, "CryptMsgControl failed: %08x\n", GetLastError());
+        decryptPara.hCryptProv = 0;
+        SetLastError(0xdeadbeef);
+        ret = CryptMsgControl(msg, 0, CMSG_CTRL_DECRYPT, &decryptPara);
+        todo_wine
+        ok(!ret && GetLastError() == CRYPT_E_ALREADY_DECRYPTED,
+         "expected CRYPT_E_ALREADY_DECRYPTED, got %08x\n", GetLastError());
+        todo_wine
+        check_param("enveloped message", msg, CMSG_CONTENT_PARAM, msgData,
+         sizeof(msgData));
+    }
+    else
+        win_skip("failed to import a key, skipping tests\n");
     CryptMsgClose(msg);
 
     msg = CryptMsgOpenToDecode(PKCS_7_ASN_ENCODING, 0, CMSG_ENVELOPED, 0, NULL,
@@ -3130,17 +3143,23 @@ static void test_decode_msg_get_param(void)
     check_param("enveloped bare message before decrypting", msg,
      CMSG_CONTENT_PARAM, envelopedBareMessage +
      sizeof(envelopedBareMessage) - 4, 4);
-    decryptPara.hCryptProv = hCryptProv;
-    SetLastError(0xdeadbeef);
-    ret = CryptMsgControl(msg, 0, CMSG_CTRL_DECRYPT, &decryptPara);
-    todo_wine
-    ok(ret, "CryptMsgControl failed: %08x\n", GetLastError());
-    todo_wine
-    check_param("enveloped bare message", msg, CMSG_CONTENT_PARAM, msgData,
-     sizeof(msgData));
+    if (key)
+    {
+        decryptPara.hCryptProv = hCryptProv;
+        SetLastError(0xdeadbeef);
+        ret = CryptMsgControl(msg, 0, CMSG_CTRL_DECRYPT, &decryptPara);
+        todo_wine
+        ok(ret, "CryptMsgControl failed: %08x\n", GetLastError());
+        todo_wine
+        check_param("enveloped bare message", msg, CMSG_CONTENT_PARAM, msgData,
+         sizeof(msgData));
+    }
+    else
+        win_skip("failed to import a key, skipping tests\n");
     CryptMsgClose(msg);
 
-    CryptDestroyKey(key);
+    if (key)
+        CryptDestroyKey(key);
     CryptReleaseContext(hCryptProv, 0);
 
     msg = CryptMsgOpenToDecode(PKCS_7_ASN_ENCODING, 0, 0, 0, NULL, NULL);

commit 113c6145253530e64f7592bdef510fe46c64ca0d
Author: Alexander Morozov <amorozov на etersoft.ru>
Date:   Tue Nov 23 13:02:22 2010 +0300

    crypt32/tests: Do not crash on some Win98.

diff --git a/dlls/crypt32/tests/msg.c b/dlls/crypt32/tests/msg.c
index 63149e7..d560c30 100644
--- a/dlls/crypt32/tests/msg.c
+++ b/dlls/crypt32/tests/msg.c
@@ -2081,15 +2081,18 @@ static void test_enveloped_msg_open(void)
     SetLastError(0xdeadbeef);
     context = CertCreateCertificateContext(X509_ASN_ENCODING,
      v1CertWithValidPubKey, sizeof(v1CertWithValidPubKey));
-    ok(context != NULL, "CertCreateCertificateContext failed: %08x\n",
-     GetLastError());
-    envelopedInfo.rgpRecipientCert = (PCERT_INFO *)&context->pCertInfo;
-    SetLastError(0xdeadbeef);
-    msg = CryptMsgOpenToEncode(PKCS_7_ASN_ENCODING, 0, CMSG_ENVELOPED,
-     &envelopedInfo, NULL, NULL);
-    todo_wine
-    ok(msg != NULL, "CryptMsgOpenToEncode failed: %08x\n", GetLastError());
-    CryptMsgClose(msg);
+    if (context)
+    {
+        envelopedInfo.rgpRecipientCert = (PCERT_INFO *)&context->pCertInfo;
+        SetLastError(0xdeadbeef);
+        msg = CryptMsgOpenToEncode(PKCS_7_ASN_ENCODING, 0, CMSG_ENVELOPED,
+         &envelopedInfo, NULL, NULL);
+        todo_wine
+        ok(msg != NULL, "CryptMsgOpenToEncode failed: %08x\n", GetLastError());
+        CryptMsgClose(msg);
+    }
+    else
+        win_skip("failed to create certificate context, skipping a test\n");
 
     SetLastError(0xdeadbeef);
     ret = pCryptAcquireContextA(&envelopedInfo.hCryptProv, NULL, NULL,


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