When container key doesn't exist yet.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=30244 Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/dssenh/tests/dssenh.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
diff --git a/dlls/dssenh/tests/dssenh.c b/dlls/dssenh/tests/dssenh.c index 4d33fc86cd8..8a53e210ce3 100644 --- a/dlls/dssenh/tests/dssenh.c +++ b/dlls/dssenh/tests/dssenh.c @@ -71,6 +71,20 @@ static void test_acquire_context(void)
/* test base DSS provider (PROV_DSS) */
+ SetLastError(0xdeadbeef); + result = CryptAcquireContextA(&hProv, NULL, NULL, PROV_DSS, 0); + if (!result) + { + todo_wine ok(GetLastError() == NTE_BAD_KEYSET, "Expected NTE_BAD_KEYSET, got %08x\n", GetLastError()); + SetLastError(0xdeadbeef); + result = CryptAcquireContextA(&hProv, NULL, NULL, PROV_DSS, CRYPT_NEWKEYSET); + } + ok(result, "CryptAcquireContextA succeeded\n"); + ok(GetLastError() == 0, "Expected 0, got %08x\n", GetLastError()); + + result = CryptReleaseContext(hProv, 0); + ok(result, "CryptReleaseContext failed.\n"); + result = CryptAcquireContextA( &hProv, NULL, MS_DEF_DSS_PROV_A, PROV_DSS, CRYPT_VERIFYCONTEXT); if(!result)
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=30244 Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/dssenh/main.c | 3 ++- dlls/dssenh/tests/dssenh.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/dlls/dssenh/main.c b/dlls/dssenh/main.c index 6cfa04393fd..b03c05195cd 100644 --- a/dlls/dssenh/main.c +++ b/dlls/dssenh/main.c @@ -284,7 +284,8 @@ BOOL WINAPI CPAcquireContext( HCRYPTPROV *ret_prov, LPSTR container, DWORD flags { case 0: case 0 | CRYPT_MACHINE_KEYSET: - ret = read_key_container( name, flags ); + if (!(ret = read_key_container( name, flags ))) + SetLastError( NTE_BAD_KEYSET ); break;
case CRYPT_NEWKEYSET: diff --git a/dlls/dssenh/tests/dssenh.c b/dlls/dssenh/tests/dssenh.c index 8a53e210ce3..4b9cb25c5a4 100644 --- a/dlls/dssenh/tests/dssenh.c +++ b/dlls/dssenh/tests/dssenh.c @@ -75,7 +75,7 @@ static void test_acquire_context(void) result = CryptAcquireContextA(&hProv, NULL, NULL, PROV_DSS, 0); if (!result) { - todo_wine ok(GetLastError() == NTE_BAD_KEYSET, "Expected NTE_BAD_KEYSET, got %08x\n", GetLastError()); + ok(GetLastError() == NTE_BAD_KEYSET, "Expected NTE_BAD_KEYSET, got %08x\n", GetLastError()); SetLastError(0xdeadbeef); result = CryptAcquireContextA(&hProv, NULL, NULL, PROV_DSS, CRYPT_NEWKEYSET); }
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=91188
Your paranoid android.
=== debiant2 (32 bit report) ===
dssenh: dssenh.c:83: Test failed: Expected 0, got 0000007a
=== debiant2 (32 bit Arabic:Morocco report) ===
dssenh: dssenh.c:83: Test failed: Expected 0, got 0000007a
=== debiant2 (32 bit French report) ===
dssenh: dssenh.c:83: Test failed: Expected 0, got 0000007a
=== debiant2 (32 bit Hebrew:Israel report) ===
dssenh: dssenh.c:83: Test failed: Expected 0, got 0000007a
=== debiant2 (32 bit Hindi:India report) ===
dssenh: dssenh.c:83: Test failed: Expected 0, got 0000007a
=== debiant2 (32 bit Japanese:Japan report) ===
dssenh: dssenh.c:83: Test failed: Expected 0, got 0000007a
=== debiant2 (32 bit Chinese:China report) ===
dssenh: dssenh.c:83: Test failed: Expected 0, got 0000007a
=== debiant2 (32 bit WoW report) ===
dssenh: dssenh.c:83: Test failed: Expected 0, got 0000007a
=== debiant2 (64 bit WoW report) ===
dssenh: dssenh.c:83: Test failed: Expected 0, got 0000007a
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=30244 Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/dssenh/main.c | 2 +- dlls/dssenh/tests/dssenh.c | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/dlls/dssenh/main.c b/dlls/dssenh/main.c index b03c05195cd..8344b5a321b 100644 --- a/dlls/dssenh/main.c +++ b/dlls/dssenh/main.c @@ -940,7 +940,7 @@ BOOL WINAPI CPGetHashParam( HCRYPTPROV hprov, HCRYPTHASH hhash, DWORD param, BYT SetLastError( ERROR_MORE_DATA ); return FALSE; } - memcpy( data, hash->value, hash->len ); + if (data) memcpy( data, hash->value, hash->len ); *len = hash->len; return TRUE;
diff --git a/dlls/dssenh/tests/dssenh.c b/dlls/dssenh/tests/dssenh.c index 4b9cb25c5a4..a3012b6703f 100644 --- a/dlls/dssenh/tests/dssenh.c +++ b/dlls/dssenh/tests/dssenh.c @@ -473,9 +473,16 @@ static void test_hash(const struct hash_test *tests, int testLen) ok(result && (hashLen == tests[i].hashLen), "Expected %d hash len, got %d.Error: %x\n", tests[i].hashLen, hashLen, GetLastError());
+ dataLen = 0xdeadbeef; + result = CryptGetHashParam(hHash, HP_HASHVAL, 0, &dataLen, 0); + ok(result, "Expected hash value return.\n"); + ok(dataLen == hashLen, "Expected hash length to match.\n"); + + hashLen = 0xdeadbeef; result = CryptGetHashParam(hHash, HP_HASHVAL, hashValue, &hashLen, 0); ok(result, "Expected hash value return.\n");
+ ok(dataLen == hashLen, "Expected hash length to match.\n"); ok(!memcmp(hashValue, tests[i].hash, tests[i].hashLen), "Incorrect hash output.\n");
result = CryptHashData(hHash, data, dataLen, 0);
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=91189
Your paranoid android.
=== debiant2 (32 bit report) ===
dssenh: dssenh.c:83: Test failed: Expected 0, got 0000007a
=== debiant2 (32 bit Arabic:Morocco report) ===
dssenh: dssenh.c:83: Test failed: Expected 0, got 0000007a
=== debiant2 (32 bit French report) ===
dssenh: dssenh.c:83: Test failed: Expected 0, got 0000007a
=== debiant2 (32 bit Hebrew:Israel report) ===
dssenh: dssenh.c:83: Test failed: Expected 0, got 0000007a
=== debiant2 (32 bit Hindi:India report) ===
dssenh: dssenh.c:83: Test failed: Expected 0, got 0000007a
=== debiant2 (32 bit Japanese:Japan report) ===
dssenh: dssenh.c:83: Test failed: Expected 0, got 0000007a
=== debiant2 (32 bit Chinese:China report) ===
dssenh: dssenh.c:83: Test failed: Expected 0, got 0000007a
=== debiant2 (32 bit WoW report) ===
dssenh: dssenh.c:83: Test failed: Expected 0, got 0000007a
=== debiant2 (64 bit WoW report) ===
dssenh: dssenh.c:83: Test failed: Expected 0, got 0000007a
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=91187
Your paranoid android.
=== debiant2 (32 bit report) ===
dssenh: dssenh.c:83: Test failed: Expected 0, got 0000007a
=== debiant2 (32 bit Arabic:Morocco report) ===
dssenh: dssenh.c:83: Test failed: Expected 0, got 0000007a
=== debiant2 (32 bit French report) ===
dssenh: dssenh.c:83: Test failed: Expected 0, got 0000007a
=== debiant2 (32 bit Hebrew:Israel report) ===
dssenh: dssenh.c:83: Test failed: Expected 0, got 0000007a
=== debiant2 (32 bit Hindi:India report) ===
dssenh: dssenh.c:83: Test failed: Expected 0, got 0000007a
=== debiant2 (32 bit Japanese:Japan report) ===
dssenh: dssenh.c:83: Test failed: Expected 0, got 0000007a
=== debiant2 (32 bit Chinese:China report) ===
dssenh: dssenh.c:83: Test failed: Expected 0, got 0000007a
=== debiant2 (32 bit WoW report) ===
dssenh: dssenh.c:83: Test failed: Expected 0, got 0000007a
=== debiant2 (64 bit WoW report) ===
dssenh: dssenh.c:83: Test failed: Expected 0, got 0000007a