mirror of
https://github.com/veracrypt/VeraCrypt
synced 2024-11-30 23:13:31 +01:00
Linux/MacOSX: take into account keyfiles when comparing Outer and Hidden volumes passwords
This commit is contained in:
parent
a29c750030
commit
b4465b80e6
@ -774,16 +774,31 @@ namespace VeraCrypt
|
|||||||
Kdf = page->GetPkcs5Kdf();
|
Kdf = page->GetPkcs5Kdf();
|
||||||
Keyfiles = page->GetKeyfiles();
|
Keyfiles = page->GetKeyfiles();
|
||||||
|
|
||||||
if (forward && Password && !Password->IsEmpty())
|
if (forward && !OuterVolume && SelectedVolumeType == VolumeType::Hidden)
|
||||||
{
|
{
|
||||||
if (!OuterVolume && SelectedVolumeType == VolumeType::Hidden)
|
shared_ptr <VolumePassword> hiddenPassword;
|
||||||
|
try
|
||||||
{
|
{
|
||||||
if (*(OuterPassword.get()) == *(Password.get()))
|
hiddenPassword = Keyfile::ApplyListToPassword (Keyfiles, Password);
|
||||||
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
hiddenPassword = Password;
|
||||||
|
}
|
||||||
|
|
||||||
|
// check if Outer and Hidden passwords are the same
|
||||||
|
if ( (hiddenPassword && !hiddenPassword->IsEmpty() && OuterPassword && !OuterPassword->IsEmpty() && (*(OuterPassword.get()) == *(hiddenPassword.get())))
|
||||||
|
||
|
||||||
|
((!hiddenPassword || hiddenPassword->IsEmpty()) && (!OuterPassword || OuterPassword->IsEmpty()))
|
||||||
|
)
|
||||||
{
|
{
|
||||||
Gui->ShowError (_("The Hidden volume password can not be identical to the Outer volume password"));
|
Gui->ShowError (_("The Hidden volume password can not be identical to the Outer volume password"));
|
||||||
return GetCurrentStep();
|
return GetCurrentStep();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (forward && Password && !Password->IsEmpty())
|
||||||
|
{
|
||||||
if (Password->Size() < VolumePassword::WarningSizeThreshold)
|
if (Password->Size() < VolumePassword::WarningSizeThreshold)
|
||||||
{
|
{
|
||||||
if (!Gui->AskYesNo (LangString["PASSWORD_LENGTH_WARNING"], false, true))
|
if (!Gui->AskYesNo (LangString["PASSWORD_LENGTH_WARNING"], false, true))
|
||||||
@ -1088,9 +1103,16 @@ namespace VeraCrypt
|
|||||||
|
|
||||||
MaxHiddenVolumeSize -= MaxHiddenVolumeSize % outerVolume->GetSectorSize(); // Must be a multiple of the sector size
|
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
|
// remember Outer password and keyfiles in order to be able to compare it with those of Hidden volume
|
||||||
|
try
|
||||||
|
{
|
||||||
|
OuterPassword = Keyfile::ApplyListToPassword (Keyfiles, Password);
|
||||||
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
OuterPassword = Password;
|
OuterPassword = Password;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
catch (exception &e)
|
catch (exception &e)
|
||||||
{
|
{
|
||||||
Gui->SetActiveFrame (this);
|
Gui->SetActiveFrame (this);
|
||||||
|
Loading…
Reference in New Issue
Block a user