[PATCH 1/2] crypt32/tests: Skip more tests.

Alexander Morozov amorozov at etersoft.ru
Thu Nov 25 09:11:20 CST 2010


Commit 113c6145253530e64f7592bdef510fe46c64ca0d was not fully correct.
For success of CryptMsgOpenToEncode call after initializing 
envelopedInfo.hCryptProv setting envelopedInfo.rgpRecipientCert is also need. 
If we can not set envelopedInfo.rgpRecipientCert we should skip all tests for 
which it is need.
This patch should fix crash of msg test on some Win98.
-------------- next part --------------
From 18c3f28df42e2b23f0dc6a5c6e98fa6ee5b112dc Mon Sep 17 00:00:00 2001
From: Alexander Morozov <amorozov at etersoft.ru>
Date: Thu, 25 Nov 2010 01:06:32 +0300
Subject: [PATCH 1/2] crypt32/tests: Skip more tests.

---
 dlls/crypt32/tests/msg.c |   28 +++++++++++++---------------
 1 files changed, 13 insertions(+), 15 deletions(-)

diff --git a/dlls/crypt32/tests/msg.c b/dlls/crypt32/tests/msg.c
index 898b10c..60def22 100644
--- a/dlls/crypt32/tests/msg.c
+++ b/dlls/crypt32/tests/msg.c
@@ -2090,23 +2090,21 @@ static void test_enveloped_msg_open(void)
         todo_wine
         ok(msg != NULL, "CryptMsgOpenToEncode failed: %08x\n", GetLastError());
         CryptMsgClose(msg);
+        SetLastError(0xdeadbeef);
+        ret = pCryptAcquireContextA(&envelopedInfo.hCryptProv, NULL, NULL,
+         PROV_RSA_FULL, CRYPT_VERIFYCONTEXT);
+        ok(ret, "CryptAcquireContextA failed: %08x\n", GetLastError());
+        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);
+        CryptReleaseContext(envelopedInfo.hCryptProv, 0);
+        CertFreeCertificateContext(context);
     }
     else
-        win_skip("failed to create certificate context, skipping a test\n");
-
-    SetLastError(0xdeadbeef);
-    ret = pCryptAcquireContextA(&envelopedInfo.hCryptProv, NULL, NULL,
-     PROV_RSA_FULL, CRYPT_VERIFYCONTEXT);
-    ok(ret, "CryptAcquireContextA failed: %08x\n", GetLastError());
-    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);
-
-    CryptReleaseContext(envelopedInfo.hCryptProv, 0);
-    CertFreeCertificateContext(context);
+        win_skip("failed to create certificate context, skipping tests\n");
 }
 
 static void test_enveloped_msg_update(void)
-- 
1.7.3.2



More information about the wine-patches mailing list