mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2025-11-11 11:08:02 -06:00
Windows: always display random gathering dialog when UserEnrichRandomPool is called instead of once per application run. This is implemented through the call SetRandomPoolEnrichedByUserStatus(FALSE) at the begining of sensitive operations instead of changing UserEnrichRandomPool because in the same call there can be many calls to UserEnrichRandomPool which can result in displaying the dialog many times.
This commit is contained in:
@@ -1290,6 +1290,9 @@ namespace VeraCrypt
|
||||
if (Randinit() != ERR_SUCCESS)
|
||||
throw ParameterIncorrect (SRC_POS);
|
||||
|
||||
/* force the display of the random enriching dialog */
|
||||
SetRandomPoolEnrichedByUserStatus (FALSE);
|
||||
|
||||
UserEnrichRandomPool (ParentWindow);
|
||||
|
||||
if (!RandgetBytes (request.WipeKey, sizeof (request.WipeKey), TRUE))
|
||||
@@ -2175,6 +2178,9 @@ namespace VeraCrypt
|
||||
throw_sys_if (Randinit () != 0);
|
||||
finally_do ({ RandStop (FALSE); });
|
||||
|
||||
/* force the display of the random enriching dialog */
|
||||
SetRandomPoolEnrichedByUserStatus (FALSE);
|
||||
|
||||
NormalCursor();
|
||||
UserEnrichRandomPool (ParentWindow);
|
||||
WaitCursor();
|
||||
|
||||
@@ -232,6 +232,8 @@ int ChangePwd (const char *lpszVolume, Password *oldPassword, Password *newPassw
|
||||
if (Randinit ())
|
||||
goto error;
|
||||
|
||||
SetRandomPoolEnrichedByUserStatus (FALSE); /* force the display of the random enriching dialog */
|
||||
|
||||
if (!bDevice && bPreserveTimestamp)
|
||||
{
|
||||
if (GetFileTime ((HANDLE) dev, &ftCreationTime, &ftLastAccessTime, &ftLastWriteTime) == 0)
|
||||
|
||||
@@ -7652,6 +7652,9 @@ noHidden:
|
||||
goto error;
|
||||
}
|
||||
|
||||
/* force the display of the random enriching dialog */
|
||||
SetRandomPoolEnrichedByUserStatus (FALSE);
|
||||
|
||||
NormalCursor();
|
||||
UserEnrichRandomPool (hwndDlg);
|
||||
WaitCursor();
|
||||
@@ -7807,6 +7810,9 @@ int RestoreVolumeHeader (HWND hwndDlg, const char *lpszVolume)
|
||||
OpenVolumeContext volume;
|
||||
volume.VolumeIsOpen = FALSE;
|
||||
|
||||
/* force the display of the random enriching dialog */
|
||||
SetRandomPoolEnrichedByUserStatus (FALSE);
|
||||
|
||||
WaitCursor();
|
||||
|
||||
if (restoreInternalBackup)
|
||||
|
||||
Reference in New Issue
Block a user