mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2025-11-12 03:18:26 -06:00
Windows vulnerability fix: CryptAcquireContext vulnerability fix. Add checks to random generator to abort in case of error and display a diagnose message to the user.
This commit is contained in:
@@ -9000,7 +9000,15 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, char *lpszComm
|
||||
nPbar = IDC_PROGRESS_BAR;
|
||||
|
||||
if (Randinit ())
|
||||
AbortProcess ("INIT_RAND");
|
||||
{
|
||||
DWORD dwLastError = GetLastError ();
|
||||
wchar_t szTmp[4096];
|
||||
if (CryptoAPILastError == ERROR_SUCCESS)
|
||||
StringCbPrintfW (szTmp, sizeof(szTmp), GetString ("INIT_RAND"), SRC_POS, dwLastError);
|
||||
else
|
||||
StringCbPrintfW (szTmp, sizeof(szTmp), GetString ("CAPI_RAND"), SRC_POS, CryptoAPILastError);
|
||||
AbortProcessDirect (szTmp);
|
||||
}
|
||||
|
||||
RegisterRedTick(hInstance);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user