Signed-off-by: YeshunYe yeyeshun@uniontech.com
The flag CRYPT_VERIFYCONTEXT | CRYPT_NEWKEYSET is valid in Windows. Here is the test case: [testCPAcquireContext.cpp](/uploads/c3c4fea3046bb48cb7a284e0b568704e/testCPAcquireContext.cpp)
-- v2: dssenh/tests: Add test for CryptAcquireContextA
From: YeshunYe yeyeshun@uniontech.com
Signed-off-by: YeshunYe yeyeshun@uniontech.com --- dlls/dssenh/main.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/dlls/dssenh/main.c b/dlls/dssenh/main.c index 0dbb78ad708..6387eeb77b2 100644 --- a/dlls/dssenh/main.c +++ b/dlls/dssenh/main.c @@ -305,6 +305,7 @@ BOOL WINAPI CPAcquireContext( HCRYPTPROV *ret_prov, LPSTR container, DWORD flags
case CRYPT_VERIFYCONTEXT: case CRYPT_VERIFYCONTEXT | CRYPT_MACHINE_KEYSET: + case CRYPT_VERIFYCONTEXT | CRYPT_NEWKEYSET: ret = create_key_container( "", flags, vtable->dwProvType ); break;
From: YeshunYe yeyeshun@uniontech.com
Signed-off-by: YeshunYe yeyeshun@uniontech.com --- dlls/dssenh/tests/dssenh.c | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/dlls/dssenh/tests/dssenh.c b/dlls/dssenh/tests/dssenh.c index 75fc88fe623..9c9b18ed4ba 100644 --- a/dlls/dssenh/tests/dssenh.c +++ b/dlls/dssenh/tests/dssenh.c @@ -149,6 +149,13 @@ static void test_acquire_context(void) result = CryptReleaseContext(hProv, 0); ok(result, "Expected release of the provider.\n");
+ result = CryptAcquireContextA(&hProv, NULL, MS_ENH_DSS_DH_PROV_A, PROV_DSS_DH, + CRYPT_VERIFYCONTEXT | CRYPT_NEWKEYSET); + ok(result, "Expected no errors.\n"); + + result = CryptReleaseContext(hProv, 0); + ok(result, "Expected release of the provider.\n"); + /* test DSS Schannel provider (PROV_DH_SCHANNEL) */
result = CryptAcquireContextA(
On Fri May 9 11:06:10 2025 +0000, Hans Leidekker wrote:
Thanks, would you be able to add a test to dssenh/tests/dssenh.c? A single CryptAcquireContextA() call with those flags (and cleanup) would be sufficient.
Sure. I've added the test case to dssenh/tests/dssenh.c
This merge request was approved by Hans Leidekker.