diff options
Diffstat (limited to 'src/Main/Forms/VolumeCreationWizard.cpp')
-rwxr-xr-x | src/Main/Forms/VolumeCreationWizard.cpp | 28 |
1 files changed, 24 insertions, 4 deletions
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 @@ -275,8 +275,9 @@ namespace VeraCrypt MountOptions mountOptions; mountOptions.Keyfiles = Keyfiles; mountOptions.Password = Password; + mountOptions.Pim = Pim; mountOptions.Path = make_shared <VolumePath> (SelectedVolumePath); try { @@ -435,8 +436,9 @@ namespace VeraCrypt mountOptions.Path = make_shared <VolumePath> (SelectedVolumePath); mountOptions.NoFilesystem = true; mountOptions.Protection = VolumeProtection::None; mountOptions.Password = Password; + mountOptions.Pim = Pim; mountOptions.Keyfiles = Keyfiles; mountOptions.Kdf = Kdf; mountOptions.TrueCryptMode = false; @@ -705,8 +707,9 @@ 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()) @@ -720,14 +723,30 @@ namespace VeraCrypt Gui->ShowError (e); 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) { // Use FAT to prevent problems with free space @@ -863,8 +882,9 @@ namespace VeraCrypt options->FilesystemClusterSize = SelectedFilesystemClusterSize; options->SectorSize = SectorSize; options->EA = SelectedEncryptionAlgorithm; options->Password = Password; + options->Pim = Pim; options->Keyfiles = Keyfiles; options->Path = SelectedVolumePath; options->Quick = QuickFormatEnabled; options->Size = VolumeSize; @@ -945,9 +965,9 @@ namespace VeraCrypt Core->SetFileOwner (finally_arg, finally_arg2); }); #endif - shared_ptr <Volume> outerVolume = Core->OpenVolume (make_shared <VolumePath> (SelectedVolumePath), true, Password, Kdf, false, Keyfiles, VolumeProtection::ReadOnly); + shared_ptr <Volume> outerVolume = Core->OpenVolume (make_shared <VolumePath> (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 // on it by accident or OS writes some new data behind his or her back, such as |