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:
Mounir IDRASSI committed 2015-04-06 00:22:36 +02:00
1 parent a284922ce4
commit 2784652ab8
13 files changed
+171 -24

No files matched your search

+9 -1
View File
@@ -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);