Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=57566
Hopefully safe enough to be accepted during code freeze.
From: Dmitry Timoshkov dmitry@baikal.ru
Signed-off-by: Dmitry Timoshkov dmitry@baikal.ru --- 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 36ddc8ffdb6..9659cf53316 100644 --- a/dlls/rsaenh/tests/rsaenh.c +++ b/dlls/rsaenh/tests/rsaenh.c @@ -4255,7 +4255,7 @@ static void test_RC4_salt(void) HCRYPTKEY hkey, hkeyx; DWORD i, key_length, size, blob_size; void *blob; - BYTE salt[16], salt2[16]; + BYTE salt[16]; CRYPT_DATA_BLOB data; BOOL ret;
@@ -4309,6 +4309,10 @@ static void test_RC4_salt(void)
CryptDestroyKey(hkey); CryptDestroyKey(hkeyx); + CryptReleaseContext(hprov, 0); + + ret = CryptAcquireContextA(&hprov, NULL, td[i].prov, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT); + ok(ret, "error %#lx\n", GetLastError());
ret = CryptImportKey(hprov, PRIVATE_EXCH_blob, sizeof(PRIVATE_EXCH_blob), 0, 0, &hkeyx); ok(ret, "error %#lx\n", GetLastError()); @@ -4322,9 +4326,9 @@ static void test_RC4_salt(void) ok(size == 11, "got %lu, expected 11\n", size); else ok(size == 0, "got %lu, expected 0\n", size); - ret = CryptGetKeyParam(hkey, KP_SALT, salt2, &size, 0); + ret = CryptGetKeyParam(hkey, KP_SALT, salt, &size, 0); ok(ret, "error %#lx\n", GetLastError()); - ok(!memcmp(salt2, zero, size), "wrong salt %.11s\n", salt2); + ok(!memcmp(salt, zero, size), "wrong salt %.11s\n", salt);
free(blob); CryptDestroyKey(hkey); @@ -4339,7 +4343,7 @@ static void test_RC4_session_key(void) { static const BYTE zero[11]; static const char hello_world[12] = "Hello World!"; - BYTE data[sizeof(hello_world)], salt[11], salt2[11]; + BYTE data[sizeof(hello_world)], salt[11]; HCRYPTPROV hprov; HCRYPTKEY hkey, hkeyx; DWORD size, blob_size; @@ -4380,6 +4384,10 @@ static void test_RC4_session_key(void)
CryptDestroyKey(hkeyx); CryptDestroyKey(hkey); + CryptReleaseContext(hprov, 0); + + ret = CryptAcquireContextA(&hprov, NULL, MS_DEF_PROV_A, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT); + ok(ret, "error %#lx\n", GetLastError());
/* Server: Use the server's private key */ ret = CryptImportKey(hprov, PRIVATE_EXCH_blob, sizeof(PRIVATE_EXCH_blob), 0, 0, &hkeyx); @@ -4392,9 +4400,9 @@ static void test_RC4_session_key(void) ret = CryptGetKeyParam(hkey, KP_SALT, NULL, &size, 0); ok(ret, "error %#lx\n", GetLastError()); ok(size == 11, "got %lu\n", size); - ret = CryptGetKeyParam(hkey, KP_SALT, salt2, &size, 0); + ret = CryptGetKeyParam(hkey, KP_SALT, salt, &size, 0); ok(ret, "error %#lx\n", GetLastError()); - ok(!memcmp(salt2, zero, size), "wrong salt %.11s\n", salt2); + ok(!memcmp(salt, zero, size), "wrong salt %.11s\n", salt);
/* Server: Decrypt data using the session key */ size = sizeof(hello_world);
From: Dmitry Timoshkov dmitry@baikal.ru
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=57566 Signed-off-by: Dmitry Timoshkov dmitry@baikal.ru --- dlls/rsaenh/rsaenh.c | 4 ++++ dlls/rsaenh/tests/rsaenh.c | 4 +--- 2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/dlls/rsaenh/rsaenh.c b/dlls/rsaenh/rsaenh.c index 310982445cd..36c8a4bb4d8 100644 --- a/dlls/rsaenh/rsaenh.c +++ b/dlls/rsaenh/rsaenh.c @@ -3646,6 +3646,10 @@ BOOL WINAPI RSAENH_CPGenKey(HCRYPTPROV hProv, ALG_ID Algid, DWORD dwFlags, HCRYP pCryptKey->abKeyValue[0] = RSAENH_TLS1_VERSION_MAJOR; pCryptKey->abKeyValue[1] = RSAENH_TLS1_VERSION_MINOR; break; + case CALG_RC4: + if (!(dwFlags & CRYPT_CREATE_SALT)) + memset(pCryptKey->abKeyValue + pCryptKey->dwKeyLen, 0, pCryptKey->dwSaltLen); + break; } setup_key(pCryptKey); } diff --git a/dlls/rsaenh/tests/rsaenh.c b/dlls/rsaenh/tests/rsaenh.c index 9659cf53316..f0c3f828aca 100644 --- a/dlls/rsaenh/tests/rsaenh.c +++ b/dlls/rsaenh/tests/rsaenh.c @@ -4288,7 +4288,7 @@ static void test_RC4_salt(void) ok(ret, "error %#lx\n", GetLastError()); if (td[i].flags & CRYPT_CREATE_SALT) ok(memcmp(salt, zero, size) != 0, "wrong salt %.11s\n", salt); - else todo_wine_if(i == 0 || i == 1 || i == 6) + else ok(memcmp(salt, zero, size) == 0, "wrong salt %.11s\n", salt); }
@@ -4362,7 +4362,6 @@ static void test_RC4_session_key(void) ok(size == 11, "got %lu\n", size); ret = CryptGetKeyParam(hkey, KP_SALT, salt, &size, 0); ok(ret, "error %#lx\n", GetLastError()); - todo_wine ok(!memcmp(salt, zero, size), "wrong salt %.11s\n", salt);
/* Client: Import the server's public key */ @@ -4409,7 +4408,6 @@ static void test_RC4_session_key(void) ret = CryptDecrypt(hkey, 0, TRUE, 0, data, &size); ok(ret, "error %#lx\n", GetLastError()); ok(size == sizeof(hello_world), "got %lu\n", size); - todo_wine ok(!memcmp(data, hello_world, size), "wrong data\n");
free(blob);
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=150810
Your paranoid android.
=== debian11b (64 bit WoW report) ===
mshtml: xmlhttprequest.c:460: Test failed: AllResponseHeaders(L"Date: Thu, 09 Jan 2025 07:46:51 GMT\r\nContent-Type: application/xml\r\nTransfer-Encoding: chunked\r\nConnection: keep-alive\r\nLast-Modified: Tue, 14 Jun 2022 15:45:18 GMT\r\nETag: W/"33-5e16a4aa23f18"\r\nCF-Cache-Status: DYNAMIC\r\nReport-To: {"endpoints":[{"url":"https:\/\/a.n"...) don't have expected substr(L"Content-Length: 51") xmlhttprequest.c:460: Test failed: AllResponseHeaders(L"Date: Thu, 09 Jan 2025 07:46:52 GMT\r\nContent-Type: application/xml\r\nTransfer-Encoding: chunked\r\nConnection: keep-alive\r\nLast-Modified: Tue, 14 Jun 2022 15:45:18 GMT\r\nETag: W/"33-5e16a4aa23f18"\r\nCF-Cache-Status: DYNAMIC\r\nReport-To: {"endpoints":[{"url":"https:\/\/a.n"...) don't have expected substr(L"Content-Length: 51")
winhttp: notification.c:734: Test failed: got unexpected thread 0x113c, err 0 winhttp.c:1205: Test failed: available_size = 537