diff options
author | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2015-06-28 20:19:19 +0200 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2015-06-28 20:25:22 +0200 |
commit | 439e0a9588f83e93b609563bcef0a03b13928534 (patch) | |
tree | 371492ae2fdb8c448deaa82358ac26e846f7a021 /src/Main/Forms/VolumeCreationWizard.cpp | |
parent | da8aec4292ab27928f4f9a2f2645c46029de7553 (diff) | |
download | VeraCrypt-439e0a9588f83e93b609563bcef0a03b13928534.tar.gz VeraCrypt-439e0a9588f83e93b609563bcef0a03b13928534.zip |
Linux/MacOSX: Add dedicated PIM page in the volume creation wizard. Correct PIM value check logic.
Diffstat (limited to 'src/Main/Forms/VolumeCreationWizard.cpp')
-rw-r--r-- | src/Main/Forms/VolumeCreationWizard.cpp | 45 |
1 files changed, 37 insertions, 8 deletions
diff --git a/src/Main/Forms/VolumeCreationWizard.cpp b/src/Main/Forms/VolumeCreationWizard.cpp index e7f3fb46..8382127a 100644 --- a/src/Main/Forms/VolumeCreationWizard.cpp +++ b/src/Main/Forms/VolumeCreationWizard.cpp @@ -26,6 +26,7 @@ #include "VolumeFormatOptionsWizardPage.h" #include "VolumeLocationWizardPage.h" #include "VolumePasswordWizardPage.h" +#include "VolumePimWizardPage.h" #include "VolumeSizeWizardPage.h" #include "WaitDialog.h" @@ -196,6 +197,21 @@ namespace VeraCrypt page->SetPageText (LangString[OuterVolume ? "PASSWORD_HIDDENVOL_HOST_HELP" : "PASSWORD_HELP"]); return page; } + + case Step::VolumePim: + { + VolumePimWizardPage *page = new VolumePimWizardPage (GetPageParent()); + + if (OuterVolume) + page->SetPageTitle (LangString["PIM_HIDVOL_HOST_TITLE"]); + else if (SelectedVolumeType == VolumeType::Hidden) + page->SetPageTitle (LangString["PIM_HIDVOL_TITLE"]); + else + page->SetPageTitle (LangString["PIM_TITLE"]); + + page->SetPageText (LangString["PIM_HELP"]); + return page; + } case Step::LargeFilesSupport: { @@ -708,7 +724,6 @@ namespace VeraCrypt { VolumePasswordWizardPage *page = dynamic_cast <VolumePasswordWizardPage *> (GetCurrentPage()); Password = page->GetPassword(); - Pim = page->GetVolumePim(); Kdf = page->GetPkcs5Kdf(); Keyfiles = page->GetKeyfiles(); @@ -726,18 +741,32 @@ namespace VeraCrypt if (Password->Size() < VolumePassword::WarningSizeThreshold) { - if (Pim < 485) - { - Gui->ShowError ("PIM_REQUIRE_LONG_PASSWORD"); - return GetCurrentStep(); - } - if (!Gui->AskYesNo (LangString["PASSWORD_LENGTH_WARNING"], false, true)) { return GetCurrentStep(); } } - else if (Pim < 485) + } + + return Step::VolumePim; + } + + case Step::VolumePim: + { + VolumePimWizardPage *page = dynamic_cast <VolumePimWizardPage *> (GetCurrentPage()); + Pim = page->GetVolumePim(); + + if (forward && Password && !Password->IsEmpty()) + { + if (Password->Size() < VolumePassword::WarningSizeThreshold) + { + if (Pim > 0 && Pim < 485) + { + Gui->ShowError ("PIM_REQUIRE_LONG_PASSWORD"); + return GetCurrentStep(); + } + } + else if (Pim > 0 && Pim < 485) { if (!Gui->AskYesNo (LangString["PIM_SMALL_WARNING"], false, true)) { |