diff options
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 @@ -25,8 +25,9 @@ #include "VolumeCreationProgressWizardPage.h" #include "VolumeFormatOptionsWizardPage.h" #include "VolumeLocationWizardPage.h" #include "VolumePasswordWizardPage.h" +#include "VolumePimWizardPage.h" #include "VolumeSizeWizardPage.h" #include "WaitDialog.h" namespace VeraCrypt @@ -195,8 +196,23 @@ 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: { SingleChoiceWizardPage <bool> *page = new SingleChoiceWizardPage <bool> (GetPageParent(), wxEmptyString, true); @@ -707,9 +723,8 @@ namespace VeraCrypt case Step::VolumePassword: { VolumePasswordWizardPage *page = dynamic_cast <VolumePasswordWizardPage *> (GetCurrentPage()); Password = page->GetPassword(); - Pim = page->GetVolumePim(); Kdf = page->GetPkcs5Kdf(); Keyfiles = page->GetKeyfiles(); if (forward && Password && !Password->IsEmpty()) @@ -725,20 +740,34 @@ 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)) { return GetCurrentStep(); |