From 39fb2edc25f2703744932f25d956bf7af604fc5f Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Tue, 9 Feb 2016 00:49:04 +0100 Subject: Linux/MacOSX: add progress bar for mouse collected entropy in GUI of volume creation wizard. Add mutex protection in event handler for shared counter variable --- src/Main/Forms/KeyfileGeneratorDialog.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/Main/Forms/KeyfileGeneratorDialog.cpp') diff --git a/src/Main/Forms/KeyfileGeneratorDialog.cpp b/src/Main/Forms/KeyfileGeneratorDialog.cpp index 157f74e5..61f16287 100644 --- a/src/Main/Forms/KeyfileGeneratorDialog.cpp +++ b/src/Main/Forms/KeyfileGeneratorDialog.cpp @@ -33,6 +33,8 @@ namespace VeraCrypt HideBytes (RandomPoolStaticText, 24); MouseStaticText->Wrap (Gui->GetCharWidth (MouseStaticText) * 70); + + CollectedEntropy->SetRange (RNG_POOL_SIZE * 8); MainSizer->SetMinSize (wxSize (-1, Gui->GetCharHeight (this) * 24)); @@ -177,7 +179,8 @@ namespace VeraCrypt /* conservative estimate: 1 mouse move event brings 1 bit of entropy * https://security.stackexchange.com/questions/32844/for-how-much-time-should-i-randomly-move-the-mouse-for-generating-encryption-key/32848#32848 */ - if (MouseEventsCounter < 2560) + ScopeLock lock (AccessMutex); + if (MouseEventsCounter < (RNG_POOL_SIZE * 8)) CollectedEntropy->SetValue (++MouseEventsCounter); } -- cgit v1.2.3