From 9913af3a8ed61333cafd0e611f214f7c86652423 Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Wed, 24 Jun 2015 14:14:34 +0200 Subject: Linux/MacOSX: first dynamic mode implementation --- src/Main/Forms/VolumeCreationWizard.cpp | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) (limited to 'src/Main/Forms/VolumeCreationWizard.cpp') diff --git a/src/Main/Forms/VolumeCreationWizard.cpp b/src/Main/Forms/VolumeCreationWizard.cpp index 12dc7457..e7f3fb46 100755 --- a/src/Main/Forms/VolumeCreationWizard.cpp +++ b/src/Main/Forms/VolumeCreationWizard.cpp @@ -276,6 +276,7 @@ namespace VeraCrypt MountOptions mountOptions; mountOptions.Keyfiles = Keyfiles; mountOptions.Password = Password; + mountOptions.Pim = Pim; mountOptions.Path = make_shared (SelectedVolumePath); try @@ -436,6 +437,7 @@ namespace VeraCrypt mountOptions.NoFilesystem = true; mountOptions.Protection = VolumeProtection::None; mountOptions.Password = Password; + mountOptions.Pim = Pim; mountOptions.Keyfiles = Keyfiles; mountOptions.Kdf = Kdf; mountOptions.TrueCryptMode = false; @@ -706,6 +708,7 @@ namespace VeraCrypt { VolumePasswordWizardPage *page = dynamic_cast (GetCurrentPage()); Password = page->GetPassword(); + Pim = page->GetVolumePim(); Kdf = page->GetPkcs5Kdf(); Keyfiles = page->GetKeyfiles(); @@ -721,12 +724,28 @@ namespace VeraCrypt return GetCurrentStep(); } - if (Password->Size() < VolumePassword::WarningSizeThreshold - && !Gui->AskYesNo (LangString["PASSWORD_LENGTH_WARNING"], false, true)) + if (Password->Size() < VolumePassword::WarningSizeThreshold) { - return GetCurrentStep(); + 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) + { + if (!Gui->AskYesNo (LangString["PIM_SMALL_WARNING"], false, true)) + { + return GetCurrentStep(); + } } } + if (forward && OuterVolume) { @@ -864,6 +883,7 @@ namespace VeraCrypt options->SectorSize = SectorSize; options->EA = SelectedEncryptionAlgorithm; options->Password = Password; + options->Pim = Pim; options->Keyfiles = Keyfiles; options->Path = SelectedVolumePath; options->Quick = QuickFormatEnabled; @@ -946,7 +966,7 @@ namespace VeraCrypt }); #endif - shared_ptr outerVolume = Core->OpenVolume (make_shared (SelectedVolumePath), true, Password, Kdf, false, Keyfiles, VolumeProtection::ReadOnly); + shared_ptr outerVolume = Core->OpenVolume (make_shared (SelectedVolumePath), true, Password, Pim, Kdf, false, Keyfiles, VolumeProtection::ReadOnly); MaxHiddenVolumeSize = Core->GetMaxHiddenVolumeSize (outerVolume); // Add a reserve (in case the user mounts the outer volume and creates new files -- cgit v1.2.3