From 5ebe73ef61b337ad20f16a3823eaa4001fac29d2 Mon Sep 17 00:00:00 2001 From: Juan Lang Date: Mon, 8 Mar 2010 11:21:51 -0800 Subject: [PATCH] rsaenh: Fix some test failures on Win9x/NT4. --- dlls/rsaenh/tests/rsaenh.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/dlls/rsaenh/tests/rsaenh.c b/dlls/rsaenh/tests/rsaenh.c index 94da11659c..743a300069 100644 --- a/dlls/rsaenh/tests/rsaenh.c +++ b/dlls/rsaenh/tests/rsaenh.c @@ -128,16 +128,28 @@ static int init_base_environment(DWORD dwKeyFlags) hProv = (HCRYPTPROV)INVALID_HANDLE_VALUE; result = CryptAcquireContext(&hProv, szContainer, szProvider, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT); - ok(!result && GetLastError()==NTE_BAD_FLAGS, "%d, %08x\n", result, GetLastError()); + ok(!result && (GetLastError()==NTE_BAD_FLAGS || + broken(GetLastError() == NTE_KEYSET_NOT_DEF /* Win9x/NT4 */)), + "%d, %08x\n", result, GetLastError()); if (!CryptAcquireContext(&hProv, szContainer, szProvider, PROV_RSA_FULL, 0)) { - ok(GetLastError()==NTE_BAD_KEYSET, "%08x\n", GetLastError()); - if (GetLastError()!=NTE_BAD_KEYSET) return 0; + ok(GetLastError()==NTE_BAD_KEYSET || + broken(GetLastError() == NTE_KEYSET_NOT_DEF /* Win9x/NT4 */), + "%08x\n", GetLastError()); + if (GetLastError()!=NTE_BAD_KEYSET) + { + win_skip("RSA full provider not available\n"); + return 0; + } result = CryptAcquireContext(&hProv, szContainer, szProvider, PROV_RSA_FULL, CRYPT_NEWKEYSET); ok(result, "%08x\n", GetLastError()); - if (!result) return 0; + if (!result) + { + win_skip("Couldn't create crypto provider\n"); + return 0; + } result = CryptGenKey(hProv, AT_KEYEXCHANGE, dwKeyFlags, &hKey); ok(result, "%08x\n", GetLastError()); if (result) CryptDestroyKey(hKey); -- 2.32.0.93.g670b81a890