Bruno Jesus : rsaenh/tests: Fix some Windows 8 tests.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Jul 21 13:37:10 CDT 2014


Module: wine
Branch: master
Commit: 7e456b8f25cfe2096f96e146e700abaf565a897c
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=7e456b8f25cfe2096f96e146e700abaf565a897c

Author: Bruno Jesus <00cpxxx at gmail.com>
Date:   Sat Jul 19 15:10:30 2014 -0300

rsaenh/tests: Fix some Windows 8 tests.

---

 dlls/rsaenh/tests/rsaenh.c | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/dlls/rsaenh/tests/rsaenh.c b/dlls/rsaenh/tests/rsaenh.c
index 2abdc55..755ca3e 100644
--- a/dlls/rsaenh/tests/rsaenh.c
+++ b/dlls/rsaenh/tests/rsaenh.c
@@ -656,7 +656,8 @@ static void test_hashes(void)
     ok(result, "CryptCreateHash failed 0x%08x\n", GetLastError());
     /* Test that CryptHashData fails on this hash */
     result = CryptHashData(hHash, pbData, sizeof(pbData), 0);
-    ok(!result && GetLastError() == NTE_BAD_ALGID, "%08x\n", GetLastError());
+    ok(!result && (GetLastError() == NTE_BAD_ALGID || broken(GetLastError() == ERROR_INVALID_HANDLE)) /* Win 8 */,
+       "%08x\n", GetLastError());
     result = CryptSetHashParam(hHash, HP_HASHVAL, pbHashValue, 0);
     ok(result, "%08x\n", GetLastError());
     len = (DWORD)sizeof(abPlainPrivateKey);
@@ -779,11 +780,18 @@ static void test_block_cipher_modes(void)
 
     dwMode = CRYPT_MODE_OFB;
     result = CryptSetKeyParam(hKey, KP_MODE, (BYTE*)&dwMode, 0);
-    ok(result, "%08x\n", GetLastError());
-    
-    dwLen = 23;
-    result = CryptEncrypt(hKey, 0, TRUE, 0, abData, &dwLen, 24);
-    ok(!result && GetLastError() == NTE_BAD_ALGID, "%08x\n", GetLastError());
+    if(!result && GetLastError() == ERROR_INTERNAL_ERROR)
+    {
+        ok(broken(1), "OFB mode not supported\n"); /* Windows 8 */
+    }
+    else
+    {
+        ok(result, "%08x\n", GetLastError());
+
+        dwLen = 23;
+        result = CryptEncrypt(hKey, 0, TRUE, 0, abData, &dwLen, 24);
+        ok(!result && GetLastError() == NTE_BAD_ALGID, "%08x\n", GetLastError());
+    }
 
     CryptDestroyKey(hKey);
 }




More information about the wine-cvs mailing list