mirror of
https://github.com/veracrypt/VeraCrypt
synced 2024-11-24 03:53:29 +01:00
Linux/MacOSX: Don't allow Hidden volume to have the same password as Outer volume
This commit is contained in:
parent
bec929ce03
commit
a29c750030
@ -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)
|
||||
{
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user