VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Main/Forms/VolumeCreationWizard.cpp
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2020-06-21 22:16:22 (GMT)
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2020-06-23 14:48:17 (GMT)
commita29c750030da0aa258ecefb514beb5e833f8c5fd (patch)
treec584e3f69f1588efd7b0e08f467f9028cb5609dc /src/Main/Forms/VolumeCreationWizard.cpp
parentbec929ce0308620a88b71e2619e5e5c8ffbfdadb (diff)
downloadVeraCrypt-a29c750030da0aa258ecefb514beb5e833f8c5fd.zip
VeraCrypt-a29c750030da0aa258ecefb514beb5e833f8c5fd.tar.gz
Linux/MacOSX: Don't allow Hidden volume to have the same password as Outer volume
Diffstat (limited to 'src/Main/Forms/VolumeCreationWizard.cpp')
-rw-r--r--src/Main/Forms/VolumeCreationWizard.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/Main/Forms/VolumeCreationWizard.cpp b/src/Main/Forms/VolumeCreationWizard.cpp
index b6d60f4..66556e3 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)
{