[PATCH] bcrypt/tests: Fix some failures on Windows 7.

Zebediah Figura z.figura12 at gmail.com
Sat Jun 20 10:31:54 CDT 2020


Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
---
 dlls/bcrypt/tests/bcrypt.c | 29 +++++++++++++++++++++++++----
 1 file changed, 25 insertions(+), 4 deletions(-)

diff --git a/dlls/bcrypt/tests/bcrypt.c b/dlls/bcrypt/tests/bcrypt.c
index e4a99d63048..f6e5c84e8d2 100644
--- a/dlls/bcrypt/tests/bcrypt.c
+++ b/dlls/bcrypt/tests/bcrypt.c
@@ -2381,16 +2381,37 @@ static void test_BcryptDeriveKeyCapi(void)
     }
 
     ret = pBCryptDeriveKeyCapi(NULL, NULL, NULL, 0, 0);
-    ok(ret == STATUS_INVALID_PARAMETER, "got %08x\n", ret);
+    ok(ret == STATUS_INVALID_PARAMETER || ret == STATUS_INVALID_HANDLE /* win7 */, "got %08x\n", ret);
 
     ret = pBCryptDeriveKeyCapi(hash, NULL, NULL, 0, 0);
-    ok(ret == STATUS_INVALID_PARAMETER, "got %08x\n", ret);
+    ok(ret == STATUS_INVALID_PARAMETER || !ret /* win7 */, "got %08x\n", ret);
+
+    ret = pBCryptDestroyHash(hash);
+    ok(!ret, "got %08x\n", ret);
+
+    ret = pBCryptCreateHash(alg, &hash, NULL, 0, NULL, 0, 0);
+    ok(!ret, "got %08x\n", ret);
 
     ret = pBCryptDeriveKeyCapi(hash, NULL, key, 0, 0);
-    ok(ret == STATUS_INVALID_PARAMETER, "got %08x\n", ret);
+    ok(ret == STATUS_INVALID_PARAMETER || !ret /* win7 */, "got %08x\n", ret);
+
+    ret = pBCryptDestroyHash(hash);
+    ok(!ret, "got %08x\n", ret);
 
+    ret = pBCryptCreateHash(alg, &hash, NULL, 0, NULL, 0, 0);
+    ok(!ret, "got %08x\n", ret);
+
+    memset(key, 0, sizeof(key));
     ret = pBCryptDeriveKeyCapi(hash, NULL, key, 41, 0);
-    ok(ret == STATUS_INVALID_PARAMETER, "got %08x\n", ret);
+    ok(ret == STATUS_INVALID_PARAMETER || !ret /* win7 */, "got %08x\n", ret);
+    if (!ret)
+        ok(!memcmp(key, expect, sizeof(expect) - 1), "wrong key data\n");
+
+    ret = pBCryptDestroyHash(hash);
+    ok(!ret, "got %08x\n", ret);
+
+    ret = pBCryptCreateHash(alg, &hash, NULL, 0, NULL, 0, 0);
+    ok(!ret, "got %08x\n", ret);
 
     memset(key, 0, sizeof(key));
     ret = pBCryptDeriveKeyCapi(hash, NULL, key, 20, 0);
-- 
2.27.0




More information about the wine-devel mailing list