From a29c750030da0aa258ecefb514beb5e833f8c5fd Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Mon, 22 Jun 2020 00:16:22 +0200 Subject: Linux/MacOSX: Don't allow Hidden volume to have the same password as Outer volume --- src/Main/Forms/VolumeCreationWizard.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/Main/Forms/VolumeCreationWizard.cpp') diff --git a/src/Main/Forms/VolumeCreationWizard.cpp b/src/Main/Forms/VolumeCreationWizard.cpp index b6d60f42..66556e36 100644 --- a/src/Main/Forms/VolumeCreationWizard.cpp +++ b/src/Main/Forms/VolumeCreationWizard.cpp @@ -776,6 +776,14 @@ namespace VeraCrypt if (forward && Password && !Password->IsEmpty()) { + if (!OuterVolume && SelectedVolumeType == VolumeType::Hidden) + { + if (*(OuterPassword.get()) == *(Password.get())) + { + Gui->ShowError (_("The Hidden volume password can not be identical to the Outer volume password")); + return GetCurrentStep(); + } + } if (Password->Size() < VolumePassword::WarningSizeThreshold) { if (!Gui->AskYesNo (LangString["PASSWORD_LENGTH_WARNING"], false, true)) @@ -1079,6 +1087,9 @@ namespace VeraCrypt MaxHiddenVolumeSize -= reservedSize; MaxHiddenVolumeSize -= MaxHiddenVolumeSize % outerVolume->GetSectorSize(); // Must be a multiple of the sector size + + // remember Outer password in order to be able to compare it with Hidden password + OuterPassword = Password; } catch (exception &e) { -- cgit v1.2.3