change CryptAcquireContextW to try CRYPT_NEWKEYSET flag if key container doesnt exist already < https://msdn.microsoft.com/en-us/library/windows/desktop/aa379886(v=vs.85).aspx >
This commit is contained in:
@@ -11,7 +11,7 @@ const HCRYPTPROV s_crypto_provider = []() -> HCRYPTPROV
|
|||||||
{
|
{
|
||||||
HCRYPTPROV result;
|
HCRYPTPROV result;
|
||||||
|
|
||||||
if (!CryptAcquireContextW(&result, nullptr, nullptr, PROV_RSA_FULL, 0))
|
if (!CryptAcquireContextW(&result, nullptr, nullptr, PROV_RSA_FULL, 0) && !CryptAcquireContextW(&result, nullptr, nullptr, PROV_RSA_FULL, CRYPT_NEWKEYSET))
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user