[Bug 47038] Zero Time Dilemma: CryptAcquireContext fails when asked to return default container

wine-bugs at winehq.org wine-bugs at winehq.org
Sat Apr 20 08:10:48 CDT 2019


https://bugs.winehq.org/show_bug.cgi?id=47038

--- Comment #2 from tijs96 at hotmail.com ---
I don't have a windows machine to test right now, but the documentation
suggests wine is correct in returning an error.

The documentation for the NTE_BAD_KEYSET error code says:

"The key container could not be opened. A common cause of this error is that
the key container does not exist. To create a key container, call
CryptAcquireContext using the CRYPT_NEWKEYSET flag."
https://docs.microsoft.com/en-us/windows/desktop/api/wincrypt/nf-wincrypt-cryptacquirecontexta

The application never makes a call with that flag set. The application might be
relying on *phProv getting set to null when an error occurs. In that case
CryptGenRandom would also just return an error instead of crashing.

Example code on
https://docs.microsoft.com/en-us/windows/desktop/SecCrypto/example-c-program-creating-a-key-container-and-generating-keys
also checks for that error and tries again with the CRYPT_NEWKEYSET flag.

-- 
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.



More information about the wine-bugs mailing list