diff options
author | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2020-06-22 00:16:22 +0200 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2020-06-23 16:48:17 +0200 |
commit | a29c750030da0aa258ecefb514beb5e833f8c5fd (patch) | |
tree | c584e3f69f1588efd7b0e08f467f9028cb5609dc /src/Main/Forms | |
parent | bec929ce0308620a88b71e2619e5e5c8ffbfdadb (diff) | |
download | VeraCrypt-a29c750030da0aa258ecefb514beb5e833f8c5fd.tar.gz VeraCrypt-a29c750030da0aa258ecefb514beb5e833f8c5fd.zip |
Linux/MacOSX: Don't allow Hidden volume to have the same password as Outer volume
Diffstat (limited to 'src/Main/Forms')
-rw-r--r-- | src/Main/Forms/VolumeCreationWizard.cpp | 11 | ||||
-rw-r--r-- | src/Main/Forms/VolumeCreationWizard.h | 1 |
2 files changed, 12 insertions, 0 deletions
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) { diff --git a/src/Main/Forms/VolumeCreationWizard.h b/src/Main/Forms/VolumeCreationWizard.h index 70abc9ef..5555aaaa 100644 --- a/src/Main/Forms/VolumeCreationWizard.h +++ b/src/Main/Forms/VolumeCreationWizard.h @@ -82,6 +82,7 @@ namespace VeraCrypt VolumeHostType::Enum SelectedVolumeHostType; VolumeType::Enum SelectedVolumeType; shared_ptr <VolumePassword> Password; + shared_ptr <VolumePassword> OuterPassword; int Pim; shared_ptr <Pkcs5Kdf> Kdf; uint32 SectorSize; |