VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2014-12-11 00:36:20 +0100
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2014-12-11 18:31:39 +0100
commit134ef041406c78283db0b82760d41248266d481d (patch)
treef0d367f3c6a4d1450c70102b4fda2fb125099afa /src/Common
parentc8c8cc517dae089c1241890133837339a716f225 (diff)
downloadVeraCrypt-134ef041406c78283db0b82760d41248266d481d.tar.gz
VeraCrypt-134ef041406c78283db0b82760d41248266d481d.zip
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.
Diffstat (limited to 'src/Common')
-rw-r--r--src/Common/BootEncryption.cpp6
-rw-r--r--src/Common/Password.c2
2 files changed, 8 insertions, 0 deletions
diff --git a/src/Common/BootEncryption.cpp b/src/Common/BootEncryption.cpp
index be521fd6..824e3b6d 100644
--- a/src/Common/BootEncryption.cpp
+++ b/src/Common/BootEncryption.cpp
@@ -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();
diff --git a/src/Common/Password.c b/src/Common/Password.c
index b1fa83ef..2c065b68 100644
--- a/src/Common/Password.c
+++ b/src/Common/Password.c
@@ -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)