diff options
author | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2015-09-16 01:17:03 +0200 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2015-09-16 01:33:19 +0200 |
commit | 9e1e128b14dd51de4e036a8002d2cad40efaaf54 (patch) | |
tree | 1d93e7317f8a7afd86989dca4e475918e97295eb /src/Mount/Mount.c | |
parent | 52c7445a795a623bc326699a5c465e8fa5294425 (diff) | |
download | VeraCrypt-9e1e128b14dd51de4e036a8002d2cad40efaaf54.tar.gz VeraCrypt-9e1e128b14dd51de4e036a8002d2cad40efaaf54.zip |
Windows: Add functionality to verify Rescue Disk ISO image file.
Diffstat (limited to 'src/Mount/Mount.c')
-rw-r--r-- | src/Mount/Mount.c | 40 |
1 files changed, 33 insertions, 7 deletions
diff --git a/src/Mount/Mount.c b/src/Mount/Mount.c index 84baea17..2a4f8030 100644 --- a/src/Mount/Mount.c +++ b/src/Mount/Mount.c @@ -1092,6 +1092,7 @@ static void PopulateSysEncContextMenu (HMENU popup, BOOL bToolsOnly) AppendMenu (popup, MF_SEPARATOR, 0, "");
AppendMenuW (popup, MF_STRING, IDM_CREATE_RESCUE_DISK, GetString ("IDM_CREATE_RESCUE_DISK"));
AppendMenuW (popup, MF_STRING, IDM_VERIFY_RESCUE_DISK, GetString ("IDM_VERIFY_RESCUE_DISK"));
+ AppendMenuW (popup, MF_STRING, IDM_VERIFY_RESCUE_DISK_ISO, GetString ("IDM_VERIFY_RESCUE_DISK_ISO"));
}
if (!bToolsOnly)
@@ -5567,7 +5568,7 @@ void CreateRescueDisk (HWND hwndDlg) Warning ("SYSTEM_ENCRYPTION_IN_PROGRESS_ELSEWHERE", hwndDlg);
}
-static void VerifyRescueDisk (HWND hwndDlg)
+static void VerifyRescueDisk (HWND hwndDlg, bool checkIsoFile)
{
try
{
@@ -5598,7 +5599,7 @@ static void VerifyRescueDisk (HWND hwndDlg) {
try
{
- if (AskOkCancel ("RESCUE_DISK_NON_WIZARD_CHECK_INSERT", hwndDlg) != IDOK)
+ if (!checkIsoFile && (AskOkCancel ("RESCUE_DISK_NON_WIZARD_CHECK_INSERT", hwndDlg) != IDOK))
{
CloseSysEncMutex ();
return;
@@ -5607,11 +5608,33 @@ static void VerifyRescueDisk (HWND hwndDlg) // Create a temporary up-to-date rescue disk image in RAM (with it the CD/DVD content will be compared)
BootEncObj->CreateRescueIsoImage (false, "");
- WaitCursor();
- if (!BootEncObj->VerifyRescueDisk ())
- Error ("RESCUE_DISK_NON_WIZARD_CHECK_FAILED", hwndDlg);
+
+ if (checkIsoFile)
+ {
+ char szRescueDiskISO [TC_MAX_PATH+1];
+ char initialDir[MAX_PATH];
+ SHGetFolderPath (NULL, CSIDL_MYDOCUMENTS, NULL, 0, initialDir);
+
+ if (!BrowseFilesInDir (hwndDlg, "OPEN_TITLE", initialDir, szRescueDiskISO, FALSE, FALSE, NULL, L"VeraCrypt Rescue Disk.iso", L"iso"))
+ {
+ CloseSysEncMutex ();
+ return;
+ }
+
+ WaitCursor();
+ if (!BootEncObj->VerifyRescueDiskIsoImage (szRescueDiskISO))
+ Error ("RESCUE_DISK_ISO_IMAGE_CHECK_FAILED", hwndDlg);
+ else
+ Info ("RESCUE_DISK_ISO_IMAGE_CHECK_PASSED", hwndDlg);
+ }
else
- Info ("RESCUE_DISK_NON_WIZARD_CHECK_PASSED", hwndDlg);
+ {
+ WaitCursor();
+ if (!BootEncObj->VerifyRescueDisk ())
+ Error ("RESCUE_DISK_NON_WIZARD_CHECK_FAILED", hwndDlg);
+ else
+ Info ("RESCUE_DISK_NON_WIZARD_CHECK_PASSED", hwndDlg);
+ }
}
catch (Exception &e)
{
@@ -7136,7 +7159,10 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa CreateRescueDisk (hwndDlg);
break;
case IDM_VERIFY_RESCUE_DISK:
- VerifyRescueDisk (hwndDlg);
+ VerifyRescueDisk (hwndDlg, false);
+ break;
+ case IDM_VERIFY_RESCUE_DISK_ISO:
+ VerifyRescueDisk (hwndDlg, true);
break;
case IDM_MOUNT_SYSENC_PART_WITHOUT_PBA:
|