VeraCrypt
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2014-12-11 18:27:08 +0100
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2014-12-11 18:31:41 +0100
commitd32826949213d2dada7759bc7641df370875c8ec (patch)
treecc08259847353d889180c401cedfc39dafb98d81
parent134ef041406c78283db0b82760d41248266d481d (diff)
downloadVeraCrypt-d32826949213d2dada7759bc7641df370875c8ec.tar.gz
VeraCrypt-d32826949213d2dada7759bc7641df370875c8ec.zip
Linux/macOSX: always display random gathering dialog/interface before performing sensitive operations that needs good quality random.
-rw-r--r--src/Main/Forms/ChangePasswordDialog.cpp2
-rw-r--r--src/Main/GraphicUserInterface.cpp7
-rw-r--r--src/Main/TextUserInterface.cpp11
3 files changed, 20 insertions, 0 deletions
diff --git a/src/Main/Forms/ChangePasswordDialog.cpp b/src/Main/Forms/ChangePasswordDialog.cpp
index f52e169d..83186c05 100644
--- a/src/Main/Forms/ChangePasswordDialog.cpp
+++ b/src/Main/Forms/ChangePasswordDialog.cpp
@@ -102,6 +102,8 @@ namespace VeraCrypt
else if (DialogMode != Mode::RemoveAllKeyfiles)
newKeyfiles = CurrentPasswordPanel->GetKeyfiles();
+ /* force the display of the random enriching interface */
+ RandomNumberGenerator::SetEnrichedByUserStatus (false);
Gui->UserEnrichRandomPool (this, NewPasswordPanel->GetPkcs5Kdf() ? NewPasswordPanel->GetPkcs5Kdf()->GetHash() : shared_ptr <Hash>());
{
diff --git a/src/Main/GraphicUserInterface.cpp b/src/Main/GraphicUserInterface.cpp
index b135bc55..440125ef 100644
--- a/src/Main/GraphicUserInterface.cpp
+++ b/src/Main/GraphicUserInterface.cpp
@@ -252,6 +252,8 @@ namespace VeraCrypt
backupFile.Open (*files.front(), File::CreateWrite);
RandomNumberGenerator::Start();
+ /* force the display of the random enriching interface */
+ RandomNumberGenerator::SetEnrichedByUserStatus (false);
UserEnrichRandomPool (nullptr);
{
@@ -1233,6 +1235,9 @@ namespace VeraCrypt
default:
return;
}
+
+ /* force the display of the random enriching interface */
+ RandomNumberGenerator::SetEnrichedByUserStatus (false);
if (restoreInternalBackup)
{
@@ -1282,6 +1287,7 @@ namespace VeraCrypt
UserEnrichRandomPool (nullptr);
// Re-encrypt volume header
+ wxBusyCursor busy;
SecureBuffer newHeaderBuffer (volume->GetLayout()->GetHeaderSize());
Core->ReEncryptVolumeHeaderWithNewSalt (newHeaderBuffer, volume->GetHeader(), options.Password, options.Keyfiles);
@@ -1390,6 +1396,7 @@ namespace VeraCrypt
UserEnrichRandomPool (nullptr);
// Re-encrypt volume header
+ wxBusyCursor busy;
SecureBuffer newHeaderBuffer (decryptedLayout->GetHeaderSize());
Core->ReEncryptVolumeHeaderWithNewSalt (newHeaderBuffer, decryptedLayout->GetHeader(), options.Password, options.Keyfiles);
diff --git a/src/Main/TextUserInterface.cpp b/src/Main/TextUserInterface.cpp
index a48470b1..f9693cb1 100644
--- a/src/Main/TextUserInterface.cpp
+++ b/src/Main/TextUserInterface.cpp
@@ -330,6 +330,8 @@ namespace VeraCrypt
backupFile.Open (filePath, File::CreateWrite);
RandomNumberGenerator::Start();
+ /* force the display of the random enriching interface */
+ RandomNumberGenerator::SetEnrichedByUserStatus (false);
UserEnrichRandomPool();
// Re-encrypt volume header
@@ -443,6 +445,8 @@ namespace VeraCrypt
newKeyfiles = AskKeyfiles (_("Enter new keyfile"));
}
+ /* force the display of the random enriching interface */
+ RandomNumberGenerator::SetEnrichedByUserStatus (false);
UserEnrichRandomPool();
Core->ChangePassword (volume, newPassword, newKeyfiles,
@@ -456,6 +460,8 @@ namespace VeraCrypt
FilePath path;
RandomNumberGenerator::Start();
+ /* force the display of the random enriching interface */
+ RandomNumberGenerator::SetEnrichedByUserStatus (false);
UserEnrichRandomPool();
if (keyfilePath)
@@ -742,6 +748,8 @@ namespace VeraCrypt
// Random data
RandomNumberGenerator::Start();
+ /* force the display of the random enriching interface */
+ RandomNumberGenerator::SetEnrichedByUserStatus (false);
UserEnrichRandomPool();
ShowString (L"\n");
@@ -1294,6 +1302,9 @@ namespace VeraCrypt
default:
throw UserAbort (SRC_POS);
}
+
+ /* force the display of the random enriching interface */
+ RandomNumberGenerator::SetEnrichedByUserStatus (false);
if (restoreInternalBackup)
{