VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Main/TextUserInterface.cpp
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2018-08-08 17:31:25 (GMT)
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2018-08-09 23:31:31 (GMT)
commit1b59879411700450c5d14225ba9c6a509cfe0f8f (patch)
tree7a08c114a352bfce9a6d3212acad61d659f08964 /src/Main/TextUserInterface.cpp
parent1d37997d3bbd019082a0b0531e9d269a518bde72 (diff)
downloadVeraCrypt-1b59879411700450c5d14225ba9c6a509cfe0f8f.zip
VeraCrypt-1b59879411700450c5d14225ba9c6a509cfe0f8f.tar.gz
Linux/MacOSX/FreeBSD: When performing backup of volume header, automatically try to use embedded backup header if using the main header fails.
Diffstat (limited to 'src/Main/TextUserInterface.cpp')
-rw-r--r--src/Main/TextUserInterface.cpp35
1 files changed, 34 insertions, 1 deletions
diff --git a/src/Main/TextUserInterface.cpp b/src/Main/TextUserInterface.cpp
index 8cd010b..61b8b8a 100644
--- a/src/Main/TextUserInterface.cpp
+++ b/src/Main/TextUserInterface.cpp
@@ -317,7 +317,40 @@ namespace VeraCrypt
}
catch (PasswordException &e)
{
- ShowInfo (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);
+ else
+ ShowInfo ("HEADER_DAMAGED_AUTO_USED_HEADER_BAK");
}
}