mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2025-11-11 11:08:02 -06:00
Linux/MacOSX/FreeBSD: When performing backup of volume header, automatically try to use embedded backup header if using the main header fails.
This commit is contained in:
@@ -208,7 +208,42 @@ namespace VeraCrypt
|
|||||||
}
|
}
|
||||||
catch (PasswordException &e)
|
catch (PasswordException &e)
|
||||||
{
|
{
|
||||||
|
bool bFailed = true;
|
||||||
|
if (!options->UseBackupHeaders)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
OpenVolumeThreadRoutine routine2(
|
||||||
|
options->Path,
|
||||||
|
options->PreserveTimestamps,
|
||||||
|
options->Password,
|
||||||
|
options->Pim,
|
||||||
|
options->Kdf,
|
||||||
|
false,
|
||||||
|
options->Keyfiles,
|
||||||
|
options->Protection,
|
||||||
|
options->ProtectionPassword,
|
||||||
|
options->ProtectionPim,
|
||||||
|
options->ProtectionKdf,
|
||||||
|
options->ProtectionKeyfiles,
|
||||||
|
true,
|
||||||
|
volumeType,
|
||||||
|
true
|
||||||
|
);
|
||||||
|
|
||||||
|
ExecuteWaitThreadRoutine (parent, &routine2);
|
||||||
|
volume = routine2.m_pVolume;
|
||||||
|
bFailed = false;
|
||||||
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (bFailed)
|
||||||
ShowWarning (e);
|
ShowWarning (e);
|
||||||
|
else
|
||||||
|
ShowWarning ("HEADER_DAMAGED_AUTO_USED_HEADER_BAK");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -317,7 +317,40 @@ namespace VeraCrypt
|
|||||||
}
|
}
|
||||||
catch (PasswordException &e)
|
catch (PasswordException &e)
|
||||||
{
|
{
|
||||||
|
bool bFailed = true;
|
||||||
|
if (!options->UseBackupHeaders)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
volume = Core->OpenVolume (
|
||||||
|
options->Path,
|
||||||
|
options->PreserveTimestamps,
|
||||||
|
options->Password,
|
||||||
|
options->Pim,
|
||||||
|
kdf,
|
||||||
|
false,
|
||||||
|
options->Keyfiles,
|
||||||
|
options->Protection,
|
||||||
|
options->ProtectionPassword,
|
||||||
|
options->ProtectionPim,
|
||||||
|
options->ProtectionKdf,
|
||||||
|
options->ProtectionKeyfiles,
|
||||||
|
true,
|
||||||
|
volumeType,
|
||||||
|
true
|
||||||
|
);
|
||||||
|
|
||||||
|
bFailed = false;
|
||||||
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (bFailed)
|
||||||
ShowInfo (e);
|
ShowInfo (e);
|
||||||
|
else
|
||||||
|
ShowInfo ("HEADER_DAMAGED_AUTO_USED_HEADER_BAK");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user