source code diff of the two versions
https://www.alchemistowl.org/arrigo/truecrypt-7.1a-7.2.diff.gz
diff --recursive -bu truecrypt-7.1a-source/Boot/Windows/BootMain.cpp truecrypt-7.2-source/Boot/Windows/BootMain.cpp
--- truecrypt-7.1a-source/Boot/Windows/BootMain.cpp 2012-02-07 11:36:48.000000000 +0100
+++ truecrypt-7.2-source/Boot/Windows/BootMain.cpp 2014-05-27 18:36:02.000000000 +0200
@@ -75,7 +75,9 @@
#endif // TC_WINDOWS_BOOT_RESCUE_DISK_MODE
- PrintEndl (3);
+ PrintEndl (2);
+ Print ("WARNING: Using TrueCrypt is not secure");
+ PrintEndl (2);
}
@@ -574,125 +576,6 @@
#ifndef TC_WINDOWS_BOOT_RESCUE_DISK_MODE
-static bool CopySystemPartitionToHiddenVolume (byte drive, byte &exitKey)
-{
- bool status = false;
-
- uint64 sectorsRemaining;
- uint64 sectorOffset;
- sectorOffset.LowPart = 0;
- sectorOffset.HighPart = 0;
-
- int fragmentSectorCount = 0x7f; // Maximum safe value supported by BIOS
- int statCount;
-
- if (!CheckMemoryRequirements ())
- goto err;
-
- if (!GetSystemPartitions (drive))
- goto err;
-
- if (PartitionFollowingActive.Drive == TC_INVALID_BIOS_DRIVE)
- TC_THROW_FATAL_EXCEPTION;
-
- // Check if BIOS can read the last sector of the hidden system
- AcquireSectorBuffer();
-
- if (ReadSectors (SectorBuffer, PartitionFollowingActive.Drive, PartitionFollowingActive.EndSector - (TC_VOLUME_HEADER_GROUP_SIZE / TC_LB_SIZE - 2), 1) != BiosResultSuccess
- || GetCrc32 (SectorBuffer, sizeof (SectorBuffer)) != OuterVolumeBackupHeaderCrc)
- {
- PrintErrorNoEndl ("Your BIOS does not support large drives");
- Print (IsLbaSupported (PartitionFollowingActive.Drive) ? " due to a bug" : "\r\n- Enable LBA in BIOS");
- PrintEndl();
- Print (TC_BOOT_STR_UPGRADE_BIOS);
-
- ReleaseSectorBuffer();
- goto err;
- }
-
- ReleaseSectorBuffer();
-
- if (!MountVolume (drive, exitKey, true, false))
- return false;
-
- sectorsRemaining = EncryptedVirtualPartition.SectorCount;
-
- if (!(sectorsRemaining == ActivePartition.SectorCount))
- TC_THROW_FATAL_EXCEPTION;
-
- InitScreen();
- Print ("\r\nCopying system to hidden volume. To abort, press Esc.\r\n\r\n");
-
- while (sectorsRemaining.HighPart != 0 || sectorsRemaining.LowPart != 0)
- {
- if (EscKeyPressed())
- {
- Print ("\rIf aborted, copying will have to start from the beginning (if attempted again).\r\n");
- if (AskYesNo ("Abort"))
- break;
- }
-
- if (sectorsRemaining.HighPart == 0 && sectorsRemaining.LowPart < fragmentSectorCount)
- fragmentSectorCount = (int) sectorsRemaining.LowPart;
-
- if (ReadWriteSectors (false, TC_BOOT_LOADER_BUFFER_SEGMENT, 0, drive, ActivePartition.StartSector + sectorOffset, fragmentSectorCount, false) != BiosResultSuccess)
- {
- Print ("To fix bad sectors: 1) Terminate 2) Encrypt and decrypt sys partition 3) Retry\r\n");
- crypto_close (BootCryptoInfo);
- goto err;
- }
-
- AcquireSectorBuffer();
-
- for (int i = 0; i < fragmentSectorCount; ++i)
- {
- CopyMemory (TC_BOOT_LOADER_BUFFER_SEGMENT, i * TC_LB_SIZE, SectorBuffer, TC_LB_SIZE);
-
- uint64 s = HiddenVolumeStartUnitNo + sectorOffset + i;
- EncryptDataUnits (SectorBuffer, &s, 1, BootCryptoInfo);
-
- CopyMemory (SectorBuffer, TC_BOOT_LOADER_BUFFER_SEGMENT, i * TC_LB_SIZE, TC_LB_SIZE);
- }
-
- ReleaseSectorBuffer();
-
- if (ReadWriteSectors (true, TC_BOOT_LOADER_BUFFER_SEGMENT, 0, drive, HiddenVolumeStartSector + sectorOffset, fragmentSectorCount, false) != BiosResultSuccess)
- {
- crypto_close (BootCryptoInfo);
- goto err;
- }
-
- sectorsRemaining = sectorsRemaining - fragmentSectorCount;
- sectorOffset = sectorOffset + fragmentSectorCount;
-
- if (!(statCount++ & 0xf))
- {
- Print ("\rRemaining: ");
- PrintSectorCountInMB (sectorsRemaining);
- }
- }
-
- crypto_close (BootCryptoInfo);
-
- if (sectorsRemaining.HighPart == 0 && sectorsRemaining.LowPart == 0)
- {
- status = true;
- Print ("\rCopying completed.");
- }
-
- PrintEndl (2);
- goto ret;
-
-err:
- exitKey = TC_BIOS_KEY_ESC;
- GetKeyboardChar();
-
-ret:
- EraseMemory ((void *) TC_BOOT_LOADER_ARGS_OFFSET, sizeof (BootArguments));
- return status;
-}
-
-
#else // TC_WINDOWS_BOOT_RESCUE_DISK_MODE
@@ -1105,28 +988,6 @@
#ifndef TC_WINDOWS_BOOT_RESCUE_DISK_MODE
- // Hidden system setup
- byte hiddenSystemCreationPhase = BootSectorFlags & TC_BOOT_CFG_MASK_HIDDEN_OS_CREATION_PHASE;
-
- if (hiddenSystemCreationPhase != TC_HIDDEN_OS_CREATION_PHASE_NONE)
- {
- PreventNormalSystemBoot = true;
- PrintMainMenu();
-
- if (hiddenSystemCreationPhase == TC_HIDDEN_OS_CREATION_PHASE_CLONING)
- {
- if (CopySystemPartitionToHiddenVolume (BootDrive, exitKey))
- {
- BootSectorFlags = (BootSectorFlags & ~TC_BOOT_CFG_MASK_HIDDEN_OS_CREATION_PHASE) | TC_HIDDEN_OS_CREATION_PHASE_WIPING;
- UpdateBootSectorConfiguration (BootLoaderDrive);
- }
- else if (exitKey == TC_BIOS_KEY_ESC)
- goto bootMenu;
- else
- continue;
- }
- }
- else
PrintMainMenu();
exitKey = BootEncryptedDrive();
Only in truecrypt-7.2-source: Build
diff --recursive -bu truecrypt-7.1a-source/Common/BootEncryption.cpp truecrypt-7.2-source/Common/BootEncryption.cpp
--- truecrypt-7.1a-source/Common/BootEncryption.cpp 2012-02-07 11:36:48.000000000 +0100
+++ truecrypt-7.2-source/Common/BootEncryption.cpp 2014-05-27 18:36:02.000000000 +0200
@@ -1861,6 +1861,8 @@
void BootEncryption::CheckRequirements ()
{
+ AbortProcess ("INSECURE_APP");
+
if (nCurrentOS == WIN_2000)
throw ErrorException ("SYS_ENCRYPTION_UNSUPPORTED_ON_CURRENT_OS");
@@ -2232,72 +2234,13 @@
void BootEncryption::PrepareHiddenOSCreation (int ea, int mode, int pkcs5)
{
- BootEncryptionStatus encStatus = GetStatus();
- if (encStatus.DriveMounted)
- throw ParameterIncorrect (SRC_POS);
-
- CheckRequirements();
- BackupSystemLoader();
-
- SelectedEncryptionAlgorithmId = ea;
+ AbortProcess ("INSECURE_APP");
}
void BootEncryption::PrepareInstallation (bool systemPartitionOnly, Password &password, int ea, int mode, int pkcs5, const string &rescueIsoImagePath)
{
- BootEncryptionStatus encStatus = GetStatus();
- if (encStatus.DriveMounted)
- throw ParameterIncorrect (SRC_POS);
-
- CheckRequirements ();
-
- SystemDriveConfiguration config = GetSystemDriveConfiguration();
-
- // Some chipset drivers may prevent access to the last sector of the drive
- if (!systemPartitionOnly)
- {
- DISK_GEOMETRY geometry = GetDriveGeometry (config.DriveNumber);
- Buffer sector (geometry.BytesPerSector);
-
- Device device (config.DevicePath);
-
- try
- {
- device.SeekAt (config.DrivePartition.Info.PartitionLength.QuadPart - geometry.BytesPerSector);
- device.Read (sector.Ptr(), sector.Size());
- }
- catch (SystemException &e)
- {
- if (e.ErrorCode != ERROR_CRC)
- {
- e.Show (ParentWindow);
- Error ("WHOLE_DRIVE_ENCRYPTION_PREVENTED_BY_DRIVERS");
- throw UserAbort (SRC_POS);
- }
- }
- }
-
- BackupSystemLoader ();
-
- uint64 volumeSize;
- uint64 encryptedAreaStart;
-
- if (systemPartitionOnly)
- {
- volumeSize = config.SystemPartition.Info.PartitionLength.QuadPart;
- encryptedAreaStart = config.SystemPartition.Info.StartingOffset.QuadPart;
- }
- else
- {
- volumeSize = config.DrivePartition.Info.PartitionLength.QuadPart - TC_BOOT_LOADER_AREA_SIZE;
- encryptedAreaStart = config.DrivePartition.Info.StartingOffset.QuadPart + TC_BOOT_LOADER_AREA_SIZE;
- }
-
- SelectedEncryptionAlgorithmId = ea;
- CreateVolumeHeader (volumeSize, encryptedAreaStart, &password, ea, mode, pkcs5);
-
- if (!rescueIsoImagePath.empty())
- CreateRescueIsoImage (true, rescueIsoImagePath);
+ AbortProcess ("INSECURE_APP");
}
bool BootEncryption::IsPagingFileActive (BOOL checkNonWindowsPartitionsOnly)
@@ -2358,19 +2301,7 @@
void BootEncryption::StartEncryption (WipeAlgorithmId wipeAlgorithm, bool zeroUnreadableSectors)
{
- BootEncryptionStatus encStatus = GetStatus();
-
- if (!encStatus.DeviceFilterActive || !encStatus.DriveMounted || encStatus.SetupInProgress)
- throw ParameterIncorrect (SRC_POS);
-
- BootEncryptionSetupRequest request;
- ZeroMemory (&request, sizeof (request));
-
- request.SetupMode = SetupEncryption;
- request.WipeAlgorithm = wipeAlgorithm;
- request.ZeroUnreadableSectors = zeroUnreadableSectors;
-
- CallDriver (TC_IOCTL_BOOT_ENCRYPTION_SETUP, &request, sizeof (request), NULL, 0);
+ AbortProcess ("INSECURE_APP");
}
void BootEncryption::CopyFileAdmin (const string &sourceFile, const string &destinationFile)
diff --recursive -bu truecrypt-7.1a-source/Common/Cmdline.c truecrypt-7.2-source/Common/Cmdline.c
--- truecrypt-7.1a-source/Common/Cmdline.c 2012-02-07 11:36:48.000000000 +0100
+++ truecrypt-7.2-source/Common/Cmdline.c 2014-05-27 18:36:02.000000000 +0200
@@ -54,6 +54,8 @@
}
}
+ strcat (tmp, "\nExamples:\n\nMount a volume as X:\ttruecrypt.exe /q /v volume.tc /l X\nDismount a volume X:\ttruecrypt.exe /q /d X");
+
SetWindowText (GetDlgItem (hwndDlg, IDC_COMMANDHELP_TEXT), (char*) tmp);
return 1;
}
diff --recursive -bu truecrypt-7.1a-source/Common/Common.rc truecrypt-7.2-source/Common/Common.rc
--- truecrypt-7.1a-source/Common/Common.rc 2012-02-07 11:36:48.000000000 +0100
+++ truecrypt-7.2-source/Common/Common.rc 2014-05-27 18:36:02.000000000 +0200
@@ -13,13 +13,11 @@
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
-// English (U.S.) resources
+// English (United States) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
-#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
-#endif //_WIN32
/////////////////////////////////////////////////////////////////////////////
//
@@ -34,25 +32,24 @@
BEGIN
EDITTEXT IDC_ABOUT_CREDITS,7,111,277,45,ES_MULTILINE | WS_VSCROLL | NOT WS_TABSTOP
DEFPUSHBUTTON "OK",IDOK,230,178,52,14
- LTEXT "",IDC_HOMEPAGE,18,87,117,9,SS_NOTIFY
LTEXT "",IDT_ABOUT_RELEASE,18,71,235,8
- CONTROL 517,IDC_ABOUT_BKG,"Static",SS_BITMAP,0,0,12,11,WS_EX_STATICEDGE
+ CONTROL IDB_TEXTUAL_LOGO_BKG,IDC_ABOUT_BKG,"Static",SS_BITMAP,0,0,12,11,WS_EX_STATICEDGE
LTEXT "",IDT_ABOUT_VERSION,18,61,161,8
CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,1,167,291,1,WS_EX_STATICEDGE
CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,1,169,291,1,WS_EX_STATICEDGE
CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,1,107,291,1,WS_EX_STATICEDGE
CONTROL "",IDC_ABOUT_LOGO_AREA,"Static",SS_GRAYRECT | NOT WS_VISIBLE,0,0,293,50,WS_EX_TRANSPARENT | WS_EX_STATICEDGE
- CONTROL 518,IDC_TEXTUAL_LOGO_IMG,"Static",SS_BITMAP,12,26,157,16
+ CONTROL IDB_TEXTUAL_LOGO_96DPI,IDC_TEXTUAL_LOGO_IMG,"Static",SS_BITMAP,12,26,157,16
END
-IDD_COMMANDHELP_DLG DIALOGEX 0, 0, 249, 213
+IDD_COMMANDHELP_DLG DIALOGEX 0, 0, 249, 234
STYLE DS_SETFONT | DS_MODALFRAME | DS_3DLOOK | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Command Line Help"
CLASS "CustomDlg"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
- DEFPUSHBUTTON "OK",IDOK,93,191,59,14
- LTEXT "",IDC_COMMANDHELP_TEXT,20,11,208,174
+ DEFPUSHBUTTON "OK",IDOK,93,212,59,14
+ LTEXT "",IDC_COMMANDHELP_TEXT,20,11,208,195
END
IDD_RAWDEVICES_DLG DIALOGEX 0, 0, 305, 209
@@ -65,7 +62,7 @@
PUSHBUTTON "Cancel",IDCANCEL,248,190,50,14
END
-IDD_MOUNT_OPTIONS DIALOGEX 0, 0, 277, 172
+IDD_MOUNT_OPTIONS DIALOGEX 0, 0, 277, 159
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "TrueCrypt - Mount Options"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
@@ -81,11 +78,10 @@
CONTROL "&Display password",IDC_SHOW_PASSWORD_MO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,112,123,90,10
CONTROL "U&se keyfiles",IDC_KEYFILES_ENABLE_HIDVOL_PROT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,112,136,90,10
PUSHBUTTON "&Keyfiles...",IDC_KEYFILES_HIDVOL_PROT,203,125,60,14
- LTEXT "What is hidden volume protection?",IDC_LINK_HIDVOL_PROTECTION_INFO,16,151,247,10,SS_NOTIFY
DEFPUSHBUTTON "OK",IDOK,211,7,60,14
PUSHBUTTON "Cancel",IDCANCEL,211,24,60,14
RTEXT "P&assword to hidden volume:\n(if empty, cache is used)",IDT_HIDDEN_PROT_PASSWD,15,103,91,17,0,WS_EX_RIGHT
- GROUPBOX "Hidden Volume Protection",IDT_HIDDEN_VOL_PROTECTION,6,72,265,95
+ GROUPBOX "Hidden Volume Protection",IDT_HIDDEN_VOL_PROTECTION,6,72,265,81
CONTROL "Use backup header embedded in &volume if available",IDC_USE_EMBEDDED_HEADER_BAK,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,39,257,11
END
@@ -109,7 +105,6 @@
LTEXT "WARNING: If you lose a keyfile or if any bit of its first 1024 kilobytes changes, it will be impossible to mount volumes that use the keyfile!",IDT_KEYFILE_WARNING,279,44,58,85,0,WS_EX_TRANSPARENT
CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,2,154,343,1,WS_EX_STATICEDGE
CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,2,209,343,1,WS_EX_STATICEDGE
- LTEXT "More information on keyfiles",IDC_LINK_KEYFILES_INFO,96,220,108,10,SS_NOTIFY
END
IDD_LANGUAGE DIALOGEX 0, 0, 209, 183
@@ -119,7 +114,6 @@
BEGIN
LISTBOX IDC_LANGLIST,6,7,197,67,LBS_SORT | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
EDITTEXT IDC_LANGPACK_CREDITS,6,108,197,28,ES_MULTILINE | ES_READONLY | WS_VSCROLL | NOT WS_TABSTOP
- CTEXT "Download language pack",IDC_GET_LANG_PACKS,2,146,205,10,SS_NOTIFY
DEFPUSHBUTTON "OK",IDOK,97,165,50,14
PUSHBUTTON "Cancel",IDCANCEL,153,165,50,14
LTEXT "Translated by:",IDT_LANGPACK_AUTHORS,6,99,101,9,SS_NOTIFY,WS_EX_TRANSPARENT
@@ -211,7 +205,7 @@
END
IDD_MULTI_CHOICE_DLG DIALOGEX 0, 0, 167, 322
-STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
+STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
PUSHBUTTON "",IDC_CHOICE10,7,292,153,24,BS_CENTER | BS_MULTILINE,WS_EX_STATICEDGE
@@ -308,9 +302,13 @@
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO
BEGIN
+ IDD_ABOUT_DLG, DIALOG
+ BEGIN
+ END
+
IDD_COMMANDHELP_DLG, DIALOG
BEGIN
- BOTTOMMARGIN, 205
+ BOTTOMMARGIN, 226
END
IDD_RAWDEVICES_DLG, DIALOG
@@ -325,7 +323,7 @@
BEGIN
LEFTMARGIN, 7
TOPMARGIN, 7
- BOTTOMMARGIN, 166
+ BOTTOMMARGIN, 153
END
IDD_KEYFILES, DIALOG
@@ -524,7 +522,7 @@
IDB_TEXTUAL_LOGO_BKG BITMAP "..\\Common\\Textual_logo_background.bmp"
IDB_TEXTUAL_LOGO_96DPI BITMAP "..\\Common\\Textual_logo_96dpi.bmp"
IDB_TEXTUAL_LOGO_288DPI BITMAP "..\\Common\\Textual_logo_288dpi.bmp"
-#endif // English (U.S.) resources
+#endif // English (United States) resources
/////////////////////////////////////////////////////////////////////////////
diff --recursive -bu truecrypt-7.1a-source/Common/Dlgcode.c truecrypt-7.2-source/Common/Dlgcode.c
--- truecrypt-7.1a-source/Common/Dlgcode.c 2012-02-07 11:36:48.000000000 +0100
+++ truecrypt-7.2-source/Common/Dlgcode.c 2014-05-27 18:36:02.000000000 +0200
@@ -51,6 +51,7 @@
#ifdef TCMOUNT
#include "Mount/Mount.h"
+#include "Mount/resource.h"
#endif
#ifdef VOLFORMAT
@@ -66,8 +67,6 @@
LONG DriverVersion;
char *LastDialogId;
-char szHelpFile[TC_MAX_PATH];
-char szHelpFile2[TC_MAX_PATH];
char SecurityTokenLibraryPath[TC_MAX_PATH];
HFONT hFixedDigitFont = NULL;
@@ -405,14 +404,14 @@
{
// Note that this function also causes localcleanup() to be called (see atexit())
MessageBeep (MB_ICONEXCLAMATION);
- MessageBoxW (NULL, GetString (stringId), lpszTitle, ICON_HAND);
- exit (1);
+ MessageBoxW (NULL, GetString (stringId), lpszTitle, ICON_HAND | MB_SETFOREGROUND | MB_TOPMOST);
+ ExitProcess (1);
}
void AbortProcessSilent (void)
{
// Note that this function also causes localcleanup() to be called (see atexit())
- exit (1);
+ ExitProcess (1);
}
@@ -769,6 +768,19 @@
}
+// Note that the user can still close the window by right-clicking its taskbar icon and selecting 'Close window', or by pressing Alt-F4, or using the Task Manager.
+void DisableCloseButton (HWND hwndDlg)
+{
+ EnableMenuItem (GetSystemMenu (hwndDlg, FALSE), SC_CLOSE, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
+}
+
+
+void EnableCloseButton (HWND hwndDlg)
+{
+ EnableMenuItem (GetSystemMenu (hwndDlg, FALSE), SC_CLOSE, MF_BYCOMMAND | MF_ENABLED);
+}
+
+
// Protects an input field from having its content updated by a Paste action (call ToBootPwdField() to use this).
static LRESULT CALLBACK BootPwdFieldProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
@@ -869,10 +881,6 @@
LocalizeDialog (hwndDlg, "IDD_ABOUT_DLG");
- // Hyperlink
- SetWindowText (GetDlgItem (hwndDlg, IDC_HOMEPAGE), "www.truecrypt.org");
- ToHyperlink (hwndDlg, IDC_HOMEPAGE);
-
// Logo area background (must not keep aspect ratio; must retain Windows-imposed distortion)
GetClientRect (GetDlgItem (hwndDlg, IDC_ABOUT_LOGO_AREA), &rec);
SetWindowPos (GetDlgItem (hwndDlg, IDC_ABOUT_BKG), HWND_TOP, 0, 0, rec.right, rec.bottom, SWP_NOMOVE);
@@ -915,13 +923,13 @@
"Paulo Barreto, Brian Gladman, Wei Dai, Peter Gutmann, and many others.\r\n\r\n"
"Portions of this software:\r\n"
- "Copyright \xA9 2003-2012 TrueCrypt Developers Association. All Rights Reserved.\r\n"
+ "Copyright \xA9 2003-2014 TrueCrypt Developers Association. All Rights Reserved.\r\n"
"Copyright \xA9 1998-2000 Paul Le Roux. All Rights Reserved.\r\n"
"Copyright \xA9 1998-2008 Brian Gladman. All Rights Reserved.\r\n"
"Copyright \xA9 2002-2004 Mark Adler. All Rights Reserved.\r\n\r\n"
"This software as a whole:\r\n"
- "Copyright \xA9 2012 TrueCrypt Developers Association. All rights reserved.\r\n\r\n"
+ "Copyright \xA9 2014 TrueCrypt Developers Association. All rights reserved.\r\n\r\n"
"A TrueCrypt Foundation Release");
@@ -934,12 +942,6 @@
return 1;
}
- if (lw == IDC_HOMEPAGE)
- {
- Applink ("main", TRUE, "");
- return 1;
- }
-
// Disallow modification of credits
if (HIWORD (wParam) == EN_UPDATE)
{
@@ -1625,264 +1627,6 @@
}
-static BOOL IsReturnAddress (DWORD64 address)
-{
- static size_t codeEnd = 0;
- byte *sp = (byte *) address;
-
- if (codeEnd == 0)
- {
- MEMORY_BASIC_INFORMATION mi;
- if (VirtualQuery ((LPCVOID) 0x401000, &mi, sizeof (mi)) >= sizeof (mi))
- codeEnd = (size_t) mi.BaseAddress + mi.RegionSize;
- }
-
- if (address < 0x401000 + 8 || address > codeEnd)
- return FALSE;
-
- return sp[-5] == 0xe8 // call ADDR
- || (sp[-6] == 0xff && sp[-5] == 0x15) // call [ADDR]
- || (sp[-2] == 0xff && (sp[-1] & 0xf0) == 0xd0); // call REG
-}
-
-
-typedef struct
-{
- EXCEPTION_POINTERS *ExceptionPointers;
- HANDLE ExceptionThread;
-
-} ExceptionHandlerThreadArgs;
-
-
-void ExceptionHandlerThread (void *threadArg)
-{
- ExceptionHandlerThreadArgs *args = (ExceptionHandlerThreadArgs *) threadArg;
-
- EXCEPTION_POINTERS *ep = args->ExceptionPointers;
- DWORD addr;
- DWORD exCode = ep->ExceptionRecord->ExceptionCode;
- SYSTEM_INFO si;
- wchar_t msg[8192];
- char modPath[MAX_PATH];
- int crc = 0;
- char url[MAX_URL_LENGTH];
- char lpack[128];
- stringstream callStack;
- addr = (DWORD) ep->ExceptionRecord->ExceptionAddress;
- PDWORD sp = (PDWORD) ep->ContextRecord->Esp;
- int frameNumber = 0;
-
- switch (exCode)
- {
- case STATUS_IN_PAGE_ERROR:
- case 0xeedfade:
- // Exception not caused by TrueCrypt
- MessageBoxW (0, GetString ("EXCEPTION_REPORT_EXT"),
- GetString ("EXCEPTION_REPORT_TITLE"),
- MB_ICONERROR | MB_OK | MB_SETFOREGROUND | MB_TOPMOST);
- return;
- }
-
- // Call stack
- HMODULE dbgDll = LoadLibrary ("dbghelp.dll");
- if (dbgDll)
- {
- typedef DWORD (__stdcall *SymGetOptions_t) ();
- typedef DWORD (__stdcall *SymSetOptions_t) (DWORD SymOptions);
- typedef BOOL (__stdcall *SymInitialize_t) (HANDLE hProcess, PCSTR UserSearchPath, BOOL fInvadeProcess);
- typedef BOOL (__stdcall *StackWalk64_t) (DWORD MachineType, HANDLE hProcess, HANDLE hThread, LPSTACKFRAME64 StackFrame, PVOID ContextRecord, PREAD_PROCESS_MEMORY_ROUTINE64 ReadMemoryRoutine, PFUNCTION_TABLE_ACCESS_ROUTINE64 FunctionTableAccessRoutine, PGET_MODULE_BASE_ROUTINE64 GetModuleBaseRoutine, PTRANSLATE_ADDRESS_ROUTINE64 TranslateAddress);
- typedef BOOL (__stdcall * SymFromAddr_t) (HANDLE hProcess, DWORD64 Address, PDWORD64 Displacement, PSYMBOL_INFO Symbol);
-
- SymGetOptions_t DbgHelpSymGetOptions = (SymGetOptions_t) GetProcAddress (dbgDll, "SymGetOptions");
- SymSetOptions_t DbgHelpSymSetOptions = (SymSetOptions_t) GetProcAddress (dbgDll, "SymSetOptions");
- SymInitialize_t DbgHelpSymInitialize = (SymInitialize_t) GetProcAddress (dbgDll, "SymInitialize");
- PFUNCTION_TABLE_ACCESS_ROUTINE64 DbgHelpSymFunctionTableAccess64 = (PFUNCTION_TABLE_ACCESS_ROUTINE64) GetProcAddress (dbgDll, "SymFunctionTableAccess64");
- PGET_MODULE_BASE_ROUTINE64 DbgHelpSymGetModuleBase64 = (PGET_MODULE_BASE_ROUTINE64) GetProcAddress (dbgDll, "SymGetModuleBase64");
- StackWalk64_t DbgHelpStackWalk64 = (StackWalk64_t) GetProcAddress (dbgDll, "StackWalk64");
- SymFromAddr_t DbgHelpSymFromAddr = (SymFromAddr_t) GetProcAddress (dbgDll, "SymFromAddr");
-
- if (DbgHelpSymGetOptions && DbgHelpSymSetOptions && DbgHelpSymInitialize && DbgHelpSymFunctionTableAccess64 && DbgHelpSymGetModuleBase64 && DbgHelpStackWalk64 && DbgHelpSymFromAddr)
- {
- DbgHelpSymSetOptions (DbgHelpSymGetOptions() | SYMOPT_DEFERRED_LOADS | SYMOPT_ALLOW_ABSOLUTE_SYMBOLS | SYMOPT_NO_CPP);
-
- if (DbgHelpSymInitialize (GetCurrentProcess(), NULL, TRUE))
- {
- STACKFRAME64 frame;
- memset (&frame, 0, sizeof (frame));
-
- frame.AddrPC.Offset = ep->ContextRecord->Eip;
- frame.AddrPC.Mode = AddrModeFlat;
- frame.AddrStack.Offset = ep->ContextRecord->Esp;
- frame.AddrStack.Mode = AddrModeFlat;
- frame.AddrFrame.Offset = ep->ContextRecord->Ebp;
- frame.AddrFrame.Mode = AddrModeFlat;
-
- string lastSymbol;
-
- while (frameNumber < 32 && DbgHelpStackWalk64 (IMAGE_FILE_MACHINE_I386, GetCurrentProcess(), args->ExceptionThread, &frame, ep->ContextRecord, NULL, DbgHelpSymFunctionTableAccess64, DbgHelpSymGetModuleBase64, NULL))
- {
- if (!frame.AddrPC.Offset)
- continue;
-
- ULONG64 symbolBuffer[(sizeof (SYMBOL_INFO) + MAX_SYM_NAME * sizeof (TCHAR) + sizeof (ULONG64) - 1) / sizeof (ULONG64)];
- memset (symbolBuffer, 0, sizeof (symbolBuffer));
-
- PSYMBOL_INFO symbol = (PSYMBOL_INFO) symbolBuffer;
- symbol->SizeOfStruct = sizeof (SYMBOL_INFO);
- symbol->MaxNameLen = MAX_SYM_NAME;
-
- if (DbgHelpSymFromAddr (GetCurrentProcess(), frame.AddrPC.Offset, NULL, symbol) && symbol->NameLen > 0)
- {
- for (size_t i = 0; i < symbol->NameLen; ++i)
- {
- if (!isalnum (symbol->Name[i]))
- symbol->Name[i] = '_';
- }
-
- if (symbol->Name != lastSymbol)
- callStack << "&st" << frameNumber++ << "=" << symbol->Name;
-
- lastSymbol = symbol->Name;
- }
- else if (frameNumber == 0 || IsReturnAddress (frame.AddrPC.Offset))
- {
- callStack << "&st" << frameNumber++ << "=0x" << hex << frame.AddrPC.Offset << dec;
- }
- }
- }
- }
- }
-
- // StackWalk64() may fail due to missing frame pointers
- list
- if (frameNumber == 0)
- retAddrs.push_back (ep->ContextRecord->Eip);
-
- retAddrs.push_back (0);
-
- MEMORY_BASIC_INFORMATION mi;
- VirtualQuery (sp, &mi, sizeof (mi));
- PDWORD stackTop = (PDWORD)((byte *) mi.BaseAddress + mi.RegionSize);
- int i = 0;
-
- while (retAddrs.size() < 16 && &sp[i] < stackTop)
- {
- if (IsReturnAddress (sp[i]))
- {
- bool duplicate = false;
- foreach (DWORD prevAddr, retAddrs)
- {
- if (sp[i] == prevAddr)
- {
- duplicate = true;
- break;
- }
- }
-
- if (!duplicate)
- retAddrs.push_back (sp[i]);
- }
- i++;
- }
-
- if (retAddrs.size() > 1)
- {
- foreach (DWORD addr, retAddrs)
- {
- callStack << "&st" << frameNumber++ << "=0x" << hex << addr << dec;
- }
- }
-
- // Checksum of the module
- if (GetModuleFileName (NULL, modPath, sizeof (modPath)))
- {
- HANDLE h = CreateFile (modPath, FILE_READ_DATA | FILE_READ_ATTRIBUTES, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL);
- if (h != INVALID_HANDLE_VALUE)
- {
- BY_HANDLE_FILE_INFORMATION fi;
- if (GetFileInformationByHandle (h, &fi))
- {
- char *buf = (char *) malloc (fi.nFileSizeLow);
- if (buf)
- {
- DWORD bytesRead;
- if (ReadFile (h, buf, fi.nFileSizeLow, &bytesRead, NULL) && bytesRead == fi.nFileSizeLow)
- crc = GetCrc32 ((unsigned char *) buf, fi.nFileSizeLow);
- free (buf);
- }
- }
- CloseHandle (h);
- }
- }
-
- GetSystemInfo (&si);
-
- if (LocalizationActive)
- sprintf_s (lpack, sizeof (lpack), "&langpack=%s_%s", GetPreferredLangId (), GetActiveLangPackVersion ());
- else
- lpack[0] = 0;
-
- sprintf (url, TC_APPLINK_SECURE "&dest=err-report%s&os=%s&osver=%d.%d.%d&arch=%s&cpus=%d&app=%s&cksum=%x&dlg=%s&err=%x&addr=%x"
- , lpack
- , GetWindowsEdition().c_str()
- , CurrentOSMajor
- , CurrentOSMinor
- , CurrentOSServicePack
- , Is64BitOs () ? "x64" : "x86"
- , si.dwNumberOfProcessors
-#ifdef TCMOUNT
- ,"main"
-#endif
-#ifdef VOLFORMAT
- ,"format"
-#endif
-#ifdef SETUP
- ,"setup"
-#endif
- , crc
- , LastDialogId ? LastDialogId : "-"
- , exCode
- , addr);
-
- string urlStr = url + callStack.str();
-
- _snwprintf (msg, array_capacity (msg), GetString ("EXCEPTION_REPORT"), urlStr.c_str());
-
- if (IDYES == MessageBoxW (0, msg, GetString ("EXCEPTION_REPORT_TITLE"), MB_ICONERROR | MB_YESNO | MB_DEFBUTTON1))
- ShellExecute (NULL, "open", urlStr.c_str(), NULL, NULL, SW_SHOWNORMAL);
- else
- UnhandledExceptionFilter (ep);
-}
-
-
-LONG __stdcall ExceptionHandler (EXCEPTION_POINTERS *ep)
-{
- SetUnhandledExceptionFilter (NULL);
-
- if (SystemFileSelectorCallPending && SystemFileSelectorCallerThreadId == GetCurrentThreadId())
- {
- MessageBoxW (NULL, GetString ("EXCEPTION_REPORT_EXT_FILESEL"), GetString ("EXCEPTION_REPORT_TITLE"), MB_ICONERROR | MB_OK | MB_SETFOREGROUND | MB_TOPMOST);
-
- UnhandledExceptionFilter (ep);
- return EXCEPTION_EXECUTE_HANDLER;
- }
-
- ExceptionHandlerThreadArgs args;
- args.ExceptionPointers = ep;
- args.ExceptionThread = GetCurrentThread();
-
- WaitForSingleObject ((HANDLE) _beginthread (ExceptionHandlerThread, 0, &args), INFINITE);
-
- return EXCEPTION_EXECUTE_HANDLER;
-}
-
-
-void InvalidParameterHandler (const wchar_t *expression, const wchar_t *function, const wchar_t *file, unsigned int line, uintptr_t reserved)
-{
- TC_THROW_FATAL_EXCEPTION;
-}
-
-
static LRESULT CALLBACK NonInstallUacWndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
return DefWindowProc (hWnd, message, wParam, lParam);
@@ -2105,7 +1849,7 @@
}
-// Returns the number of partitions where non-system in-place encryption is progress or had been in progress
+// Returns the number of partitions where non-system in-place encryption is or had been in progress
// but was interrupted. In addition, via the passed pointer, returns the last selected wipe algorithm ID.
int LoadNonSysInPlaceEncSettings (WipeAlgorithmId *wipeAlgorithm)
{
@@ -2153,73 +1897,6 @@
}
-void SavePostInstallTasksSettings (int command)
-{
- FILE *f = NULL;
-
- if (IsNonInstallMode() && command != TC_POST_INSTALL_CFG_REMOVE_ALL)
- return;
-
- switch (command)
- {
- case TC_POST_INSTALL_CFG_REMOVE_ALL:
- remove (GetConfigPath (TC_APPD_FILENAME_POST_INSTALL_TASK_TUTORIAL));
- remove (GetConfigPath (TC_APPD_FILENAME_POST_INSTALL_TASK_RELEASE_NOTES));
- break;
-
- case TC_POST_INSTALL_CFG_TUTORIAL:
- f = fopen (GetConfigPath (TC_APPD_FILENAME_POST_INSTALL_TASK_TUTORIAL), "w");
- break;
-
- case TC_POST_INSTALL_CFG_RELEASE_NOTES:
- f = fopen (GetConfigPath (TC_APPD_FILENAME_POST_INSTALL_TASK_RELEASE_NOTES), "w");
- break;
-
- default:
- return;
- }
-
- if (f == NULL)
- return;
-
- if (fputs ("1", f) < 0)
- {
- // Error
- fclose (f);
- return;
- }
-
- TCFlushFile (f);
-
- fclose (f);
-}
-
-
-void DoPostInstallTasks (void)
-{
- BOOL bDone = FALSE;
-
- if (FileExists (GetConfigPath (TC_APPD_FILENAME_POST_INSTALL_TASK_TUTORIAL)))
- {
- if (AskYesNo ("AFTER_INSTALL_TUTORIAL") == IDYES)
- Applink ("beginnerstutorial", TRUE, "");
-
- bDone = TRUE;
- }
-
- if (FileExists (GetConfigPath (TC_APPD_FILENAME_POST_INSTALL_TASK_RELEASE_NOTES)))
- {
- if (AskYesNo ("AFTER_UPGRADE_RELEASE_NOTES") == IDYES)
- Applink ("releasenotes", TRUE, "");
-
- bDone = TRUE;
- }
-
- if (bDone)
- SavePostInstallTasksSettings (TC_POST_INSTALL_CFG_REMOVE_ALL);
-}
-
-
void InitOSVersionInfo ()
{
OSVERSIONINFO os;
@@ -2355,9 +2032,6 @@
}
#endif
- SetUnhandledExceptionFilter (ExceptionHandler);
- _set_invalid_parameter_handler (InvalidParameterHandler);
-
RemoteSession = GetSystemMetrics (SM_REMOTESESSION) != 0;
// OS version check
@@ -2460,8 +2134,6 @@
DialogBoxParamW (hInst, MAKEINTRESOURCEW (IDD_AUXILIARY_DLG), NULL,
(DLGPROC) AuxiliaryDlgProc, (LPARAM) 1);
- InitHelpFileName ();
-
#ifndef SETUP
if (!EncryptionThreadPoolStart (ReadEncryptionThreadPoolFreeCpuCountLimit()))
{
@@ -2471,37 +2143,6 @@
#endif
}
-void InitHelpFileName (void)
-{
- char *lpszTmp;
-
- GetModuleFileName (NULL, szHelpFile, sizeof (szHelpFile));
- lpszTmp = strrchr (szHelpFile, '\\');
- if (lpszTmp)
- {
- char szTemp[TC_MAX_PATH];
-
- // Primary file name
- if (strcmp (GetPreferredLangId(), "en") == 0
- || GetPreferredLangId() == NULL)
- {
- strcpy (++lpszTmp, "TrueCrypt User Guide.pdf");
- }
- else
- {
- sprintf (szTemp, "TrueCrypt User Guide.%s.pdf", GetPreferredLangId());
- strcpy (++lpszTmp, szTemp);
- }
-
- // Secondary file name (used when localized documentation is not found).
- GetModuleFileName (NULL, szHelpFile2, sizeof (szHelpFile2));
- lpszTmp = strrchr (szHelpFile2, '\\');
- if (lpszTmp)
- {
- strcpy (++lpszTmp, "TrueCrypt User Guide.pdf");
- }
- }
-}
BOOL OpenDevice (const char *lpszPath, OPEN_TEST_STRUCT *driver, BOOL detectFilesystem)
{
@@ -2651,6 +2292,63 @@
}
+
+/* Determines whether the path points to a non-system partition on the system drive.
+IMPORTANT: As this may take a very long time if called for the first time, it should be called
+ only before performing a dangerous operation, never at WM_INITDIALOG or any other GUI events.
+Return codes:
+0 - it isn't a non-system partition on the system drive
+1 - it's a non-system partition on the system drive
+-1 - the result can't be determined, isn't reliable, or there was an error. */
+int IsNonSysPartitionOnSysDrive (const char *path)
+{
+ char tmpPath [TC_MAX_PATH + 1];
+ int pos;
+
+ if (!GetSysDevicePaths (MainDlg))
+ return -1;
+
+ if (strlen (SysPartitionDevicePath) <= 1 || strlen (SysDriveDevicePath) <= 1)
+ return -1;
+
+ if (strncmp (path, SysPartitionDevicePath, max (strlen(path), strlen(SysPartitionDevicePath))) == 0
+ || strncmp (path, SysDriveDevicePath, max (strlen(path), strlen(SysDriveDevicePath))) == 0)
+ {
+ // It is the system partition/drive path (it isn't a non-system partition)
+ return 0;
+ }
+
+ memset (tmpPath, 0, sizeof (tmpPath));
+ strncpy (tmpPath, path, sizeof (tmpPath) - 1);
+
+
+ pos = (int) FindString (tmpPath, "Partition", strlen (tmpPath), strlen ("Partition"), 0);
+
+ if (pos < 0)
+ return -1;
+
+ pos += strlen ("Partition");
+
+ if (pos + 1 > sizeof (tmpPath) - 1)
+ return -1;
+
+ tmpPath [pos] = '0';
+ tmpPath [pos + 1] = 0;
+
+ if (strncmp (tmpPath, SysDriveDevicePath, max (strlen(tmpPath), strlen(SysDriveDevicePath))) == 0)
+ {
+ // It is a non-system partition on the system drive
+ return 1;
+ }
+ else
+ {
+ // The partition is not on the system drive
+ return 0;
+ }
+}
+
+
+
wstring GetSysEncryptionPretestInfo2String (void)
{
// This huge string is divided into smaller portions to make it easier for translators to
@@ -3814,7 +3512,11 @@
wcscat (szTmp, GetString ("PASSWORD_WRONG_CAPSLOCK_ON"));
#ifdef TCMOUNT
- if (TCBootLoaderOnInactiveSysEncDrive ())
+
+ char szDevicePath [TC_MAX_PATH+1] = {0};
+ GetWindowText (GetDlgItem (MainDlg, IDC_VOLUME), szDevicePath, sizeof (szDevicePath));
+
+ if (TCBootLoaderOnInactiveSysEncDrive (szDevicePath))
{
swprintf (szTmp, GetString (KeyFilesEnable ? "PASSWORD_OR_KEYFILE_OR_MODE_WRONG" : "PASSWORD_OR_MODE_WRONG"));
@@ -4615,8 +4317,6 @@
SetDlgItemTextW (hwndDlg, IDC_HW_AES, (wstring (L" ") + (GetString (is_aes_hw_cpu_supported() ? ((driverConfig & TC_DRIVER_CONFIG_DISABLE_HARDWARE_ENCRYPTION) ? "UISTR_DISABLED" : "UISTR_YES") : "NOT_APPLICABLE_OR_NOT_AVAILABLE"))).c_str());
- ToHyperlink (hwndDlg, IDC_HW_AES_LABEL_LINK);
-
if (is_aes_hw_cpu_supported() && (driverConfig & TC_DRIVER_CONFIG_DISABLE_HARDWARE_ENCRYPTION))
{
Warning ("DISABLED_HW_AES_AFFECTS_PERFORMANCE");
@@ -4643,8 +4343,6 @@
SetDlgItemTextW (hwndDlg, IDC_PARALLELIZATION, (wstring (L" ") + nbrThreadsStr).c_str());
- ToHyperlink (hwndDlg, IDC_PARALLELIZATION_LABEL_LINK);
-
if (nbrThreads < min (sysInfo.dwNumberOfProcessors, GetMaxEncryptionThreadCount())
&& sysInfo.dwNumberOfProcessors > 1)
{
@@ -4681,16 +4379,6 @@
}
return 1;
- case IDC_HW_AES_LABEL_LINK:
-
- Applink ("hwacceleration", TRUE, "");
- return 1;
-
- case IDC_PARALLELIZATION_LABEL_LINK:
-
- Applink ("parallelization", TRUE, "");
- return 1;
-
case IDCLOSE:
case IDCANCEL:
@@ -5686,6 +5374,8 @@
wrec.bottom - wrec.top - vertSubOffset + 1 + vertMsgHeightOffset,
TRUE);
+ DisableCloseButton (hwndDlg);
+
return 1;
}
@@ -5708,7 +5398,8 @@
break;
case WM_CLOSE:
- EndDialog (hwndDlg, 0);
+ // This prevents the window from being closed by pressing Alt-F4 (the Close button is hidden).
+ // Note that the OS handles modal MessageBox() dialog windows the same way.
return 1;
}
@@ -6352,6 +6043,7 @@
}
+// Returns -1 if no drive letter is resolved
int GetMountedVolumeDriveNo (char *volname)
{
MOUNT_LIST_STRUCT mlist;
@@ -7748,6 +7440,13 @@
}
+int AskNoYesString (const wchar_t *string)
+{
+ if (Silent) return IDNO;
+ return MessageBoxW (MainDlg, string, lpszTitle, MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON2);
+}
+
+
int AskOkCancel (char *stringId)
{
if (Silent) return IDCANCEL;
@@ -7837,8 +7536,7 @@
// Input format 2: {L"", L"Message text", L"Button caption 1", ... L"Last button caption", 0};
// The second format is to be used if any of the strings contains format specification (e.g. %s, %d) or
// in any other cases where a string needs to be resolved before calling this function.
-// If the returned value is 0, the user closed the dialog window without making a choice.
-// If the user made a choice, the returned value is the ordinal number of the choice (1..MAX_MULTI_CHOICES)
+// The returned value is the ordinal number of the choice the user selected (1..MAX_MULTI_CHOICES)
int AskMultiChoice (void *strings[], BOOL bBold)
{
MULTI_CHOICE_DLGPROC_PARAMS params;
@@ -7984,36 +7682,6 @@
}
-void OpenPageHelp (HWND hwndDlg, int nPage)
-{
- int r = (int)ShellExecute (NULL, "open", szHelpFile, NULL, NULL, SW_SHOWNORMAL);
-
- if (r == ERROR_FILE_NOT_FOUND)
- {
- // Try the secondary help file
- r = (int)ShellExecute (NULL, "open", szHelpFile2, NULL, NULL, SW_SHOWNORMAL);
-
- if (r == ERROR_FILE_NOT_FOUND)
- {
- OpenOnlineHelp ();
- return;
- }
- }
-
- if (r == SE_ERR_NOASSOC)
- {
- if (AskYesNo ("HELP_READER_ERROR") == IDYES)
- OpenOnlineHelp ();
- }
-}
-
-
-void OpenOnlineHelp ()
-{
- Applink ("help", TRUE, "");
-}
-
-
#ifndef SETUP
void RestoreDefaultKeyFilesParam (void)
@@ -8321,20 +7989,6 @@
}
-void Applink (char *dest, BOOL bSendOS, char *extraOutput)
-{
- char url [MAX_URL_LENGTH];
-
- ArrowWaitCursor ();
-
- sprintf_s (url, sizeof (url), TC_APPLINK "%s%s&dest=%s", bSendOS ? ("&os=" + GetWindowsEdition()).c_str() : "", extraOutput, dest);
- ShellExecute (NULL, "open", url, NULL, NULL, SW_SHOWNORMAL);
-
- Sleep (200);
- NormalCursor ();
-}
-
-
char *RelativePath2Absolute (char *szFileName)
{
if (szFileName[0] != '\\'
@@ -9540,10 +9194,13 @@
#ifndef SETUP
-int AskNonSysInPlaceEncryptionResume ()
+int AskNonSysInPlaceEncryptionResume (BOOL *decrypt)
{
if (AskWarnYesNo ("NONSYS_INPLACE_ENC_RESUME_PROMPT") == IDYES)
+ {
+ *decrypt = TRUE;
return IDYES;
+ }
char *multiChoiceStr[] = { 0, "ASK_NONSYS_INPLACE_ENC_NOTIFICATION_REMOVAL", "DO_NOT_PROMPT_ME", "KEEP_PROMPTING_ME", 0 };
diff --recursive -bu truecrypt-7.1a-source/Common/Dlgcode.h truecrypt-7.2-source/Common/Dlgcode.h
--- truecrypt-7.1a-source/Common/Dlgcode.h 2012-02-07 11:36:48.000000000 +0100
+++ truecrypt-7.2-source/Common/Dlgcode.h 2014-05-27 18:36:02.000000000 +0200
@@ -31,8 +31,7 @@
IDPM_SELECT_DEVICE_AND_MOUNT,
IDPM_ADD_TO_FAVORITES,
IDPM_ADD_TO_SYSTEM_FAVORITES,
- IDM_SHOW_HIDE,
- IDM_HOMEPAGE_SYSTRAY
+ IDM_SHOW_HIDE
};
enum
@@ -74,8 +73,6 @@
#define TC_APPD_FILENAME_SYSTEM_FAVORITE_VOLUMES TC_APP_NAME " System Favorite Volumes.xml"
#define TC_APPD_FILENAME_NONSYS_INPLACE_ENC "In-Place Encryption"
#define TC_APPD_FILENAME_NONSYS_INPLACE_ENC_WIPE "In-Place Encryption Wipe Algo"
-#define TC_APPD_FILENAME_POST_INSTALL_TASK_TUTORIAL "Post-Install Task - Tutorial"
-#define TC_APPD_FILENAME_POST_INSTALL_TASK_RELEASE_NOTES "Post-Install Task - Release Notes"
#ifndef USER_DEFAULT_SCREEN_DPI
#define USER_DEFAULT_SCREEN_DPI 96
@@ -85,17 +82,8 @@
# error Revision of GUI and graphics necessary, since everything assumes default screen DPI as 96 (note that 96 is the default on Windows 2000, XP, and Vista).
#endif
-enum
-{
- TC_POST_INSTALL_CFG_REMOVE_ALL = 0,
- TC_POST_INSTALL_CFG_TUTORIAL,
- TC_POST_INSTALL_CFG_RELEASE_NOTES
-};
-
extern char *LastDialogId;
extern char *ConfigBuffer;
-extern char szHelpFile[TC_MAX_PATH];
-extern char szHelpFile2[TC_MAX_PATH];
extern char SecurityTokenLibraryPath[TC_MAX_PATH];
extern HFONT hFixedDigitFont;
extern HFONT hBoldFont;
@@ -128,6 +116,10 @@
extern BOOL bSysPartitionSelected;
extern BOOL bSysDriveSelected;
+extern char SysPartitionDevicePath [TC_MAX_PATH];
+extern char SysDriveDevicePath [TC_MAX_PATH];
+extern char bCachedSysDevicePathsValid;
+
extern BOOL bHyperLinkBeingTracked;
extern BOOL bInPlaceEncNonSysPending;
@@ -284,16 +276,14 @@
BOOL LoadSysEncSettings (HWND hwndDlg);
int LoadNonSysInPlaceEncSettings (WipeAlgorithmId *wipeAlgorithm);
void RemoveNonSysInPlaceEncNotifications (void);
-void SavePostInstallTasksSettings (int command);
-void DoPostInstallTasks (void);
void InitOSVersionInfo ();
void InitApp ( HINSTANCE hInstance, char *lpszCommandLine );
-void InitHelpFileName (void);
BOOL OpenDevice (const char *lpszPath, OPEN_TEST_STRUCT *driver, BOOL detectFilesystem);
void NotifyDriverOfPortableMode (void);
int GetAvailableFixedDisks ( HWND hComboBox , char *lpszRootPath );
int GetAvailableRemovables ( HWND hComboBox , char *lpszRootPath );
int IsSystemDevicePath (char *path, HWND hwndDlg, BOOL bReliableRequired);
+int IsNonSysPartitionOnSysDrive (const char *path);
BOOL CALLBACK RawDevicesDlgProc ( HWND hwndDlg , UINT msg , WPARAM wParam , LPARAM lParam );
BOOL TextInfoDialogBox (int nID);
BOOL CALLBACK TextInfoDialogBoxDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
@@ -372,7 +362,6 @@
char *GetConfigPath (char *fileName);
char *GetProgramConfigPath (char *fileName);
char GetSystemDriveLetter (void);
-void OpenPageHelp (HWND hwndDlg, int nPage);
void TaskBarIconDisplayBalloonTooltip (HWND hwnd, wchar_t *headline, wchar_t *text, BOOL warning);
void InfoBalloon (char *headingStringId, char *textStringId);
void InfoBalloonDirect (wchar_t *headingString, wchar_t *textString);
@@ -391,6 +380,7 @@
int AskYesNoString (const wchar_t *str);
int AskYesNoTopmost (char *stringId);
int AskNoYes (char *stringId);
+int AskNoYesString (const wchar_t *string);
int AskOkCancel (char *stringId);
int AskWarnYesNo (char *stringId);
int AskWarnYesNoString (const wchar_t *string);
@@ -421,7 +411,6 @@
BOOL IsHiddenOSRunning (void);
BOOL EnableWow64FsRedirection (BOOL enable);
BOOL RestartComputer (void);
-void Applink (char *dest, BOOL bSendOS, char *extraOutput);
char *RelativePath2Absolute (char *szFileName);
void HandleDriveNotReadyError ();
BOOL CALLBACK CloseTCWindowsEnum( HWND hwnd, LPARAM lParam);
@@ -431,7 +420,6 @@
void ReportUnexpectedState (char *techInfo);
BOOL SelectMultipleFiles (HWND hwndDlg, char *stringId, char *lpszFileName, BOOL keepHistory);
BOOL SelectMultipleFilesNext (char *lpszFileName);
-void OpenOnlineHelp ();
BOOL GetPartitionInfo (const char *deviceName, PPARTITION_INFORMATION rpartInfo);
BOOL GetDeviceInfo (const char *deviceName, DISK_PARTITION_INFO_STRUCT *info);
BOOL GetDriveGeometry (const char *deviceName, PDISK_GEOMETRY diskGeometry);
@@ -443,9 +431,12 @@
int GetTextGfxHeight (HWND hwndDlgItem, const wchar_t *text, HFONT hFont);
BOOL ToHyperlink (HWND hwndDlg, UINT ctrlId);
BOOL ToCustHyperlink (HWND hwndDlg, UINT ctrlId, HFONT hFont);
+void DisableCloseButton (HWND hwndDlg);
+void EnableCloseButton (HWND hwndDlg);
void ToBootPwdField (HWND hwndDlg, UINT ctrlId);
void AccommodateTextField (HWND hwndDlg, UINT ctrlId, BOOL bFirstUpdate, HFONT hFont);
BOOL GetDriveLabel (int driveNo, wchar_t *label, int labelSize);
+BOOL GetSysDevicePaths (HWND hwndDlg);
BOOL DoDriverInstall (HWND hwndDlg);
int OpenVolume (OpenVolumeContext *context, const char *volumePath, Password *password, BOOL write, BOOL preserveTimestamps, BOOL useBackupHeader);
void CloseVolume (OpenVolumeContext *context);
@@ -460,7 +451,7 @@
BOOL IsFileOnReadOnlyFilesystem (const char *path);
void CheckFilesystem (int driveNo, BOOL fixErrors);
BOOL BufferContainsString (const byte *buffer, size_t bufferSize, const char *str);
-int AskNonSysInPlaceEncryptionResume ();
+int AskNonSysInPlaceEncryptionResume (BOOL *decrypt);
BOOL RemoveDeviceWriteProtection (HWND hwndDlg, char *devicePath);
void EnableElevatedCursorChange (HWND parent);
BOOL DisableFileCompression (HANDLE file);
diff --recursive -bu truecrypt-7.1a-source/Common/Fat.c truecrypt-7.2-source/Common/Fat.c
--- truecrypt-7.1a-source/Common/Fat.c 2012-02-07 11:36:48.000000000 +0100
+++ truecrypt-7.2-source/Common/Fat.c 2014-05-27 18:36:02.000000000 +0200
@@ -17,6 +17,7 @@
#include "Crypto.h"
#include "Common/Endian.h"
+#include "Dlgcode.h"
#include "Format.h"
#include "Fat.h"
#include "Progress.h"
@@ -255,191 +256,6 @@
int
FormatFat (unsigned __int64 startSector, fatparams * ft, void * dev, PCRYPTO_INFO cryptoInfo, BOOL quickFormat)
{
- int write_buf_cnt = 0;
- char sector[TC_MAX_VOLUME_SECTOR_SIZE], *write_buf;
- unsigned __int64 nSecNo = startSector;
- int x, n;
- int retVal;
- char temporaryKey[MASTER_KEYDATA_SIZE];
-
- LARGE_INTEGER startOffset;
- LARGE_INTEGER newOffset;
-
- // Seek to start sector
- startOffset.QuadPart = startSector * ft->sector_size;
- if (!SetFilePointerEx ((HANDLE) dev, startOffset, &newOffset, FILE_BEGIN)
- || newOffset.QuadPart != startOffset.QuadPart)
- {
- return ERR_VOL_SEEKING;
- }
-
- /* Write the data area */
-
- write_buf = (char *)TCalloc (FormatWriteBufferSize);
- if (!write_buf)
- return ERR_OUTOFMEMORY;
-
- memset (sector, 0, ft->sector_size);
-
- RandgetBytes (ft->volume_id, sizeof (ft->volume_id), FALSE);
-
- PutBoot (ft, (unsigned char *) sector);
- if (WriteSector (dev, sector, write_buf, &write_buf_cnt, &nSecNo,
- cryptoInfo) == FALSE)
- goto fail;
-
- /* fat32 boot area */
- if (ft->size_fat == 32)
- {
- /* fsinfo */
- PutFSInfo((unsigned char *) sector, ft);
- if (WriteSector (dev, sector, write_buf, &write_buf_cnt, &nSecNo,
- cryptoInfo) == FALSE)
- goto fail;
-
- /* reserved */
- while (nSecNo - startSector < 6)
- {
- memset (sector, 0, ft->sector_size);
- sector[508+3]=0xaa; /* TrailSig */
- sector[508+2]=0x55;
- if (WriteSector (dev, sector, write_buf, &write_buf_cnt, &nSecNo,
- cryptoInfo) == FALSE)
- goto fail;
- }
-
- /* bootsector backup */
- memset (sector, 0, ft->sector_size);
- PutBoot (ft, (unsigned char *) sector);
- if (WriteSector (dev, sector, write_buf, &write_buf_cnt, &nSecNo,
- cryptoInfo) == FALSE)
- goto fail;
-
- PutFSInfo((unsigned char *) sector, ft);
- if (WriteSector (dev, sector, write_buf, &write_buf_cnt, &nSecNo,
- cryptoInfo) == FALSE)
- goto fail;
- }
-
- /* reserved */
- while (nSecNo - startSector < (unsigned int)ft->reserved)
- {
- memset (sector, 0, ft->sector_size);
- if (WriteSector (dev, sector, write_buf, &write_buf_cnt, &nSecNo,
- cryptoInfo) == FALSE)
- goto fail;
- }
-
- /* write fat */
- for (x = 1; x <= ft->fats; x++)
- {
- for (n = 0; n < ft->fat_length; n++)
- {
- memset (sector, 0, ft->sector_size);
-
- if (n == 0)
- {
- unsigned char fat_sig[12];
- if (ft->size_fat == 32)
- {
- fat_sig[0] = (unsigned char) ft->media;
- fat_sig[1] = fat_sig[2] = 0xff;
- fat_sig[3] = 0x0f;
- fat_sig[4] = fat_sig[5] = fat_sig[6] = 0xff;
- fat_sig[7] = 0x0f;
- fat_sig[8] = fat_sig[9] = fat_sig[10] = 0xff;
- fat_sig[11] = 0x0f;
- memcpy (sector, fat_sig, 12);
- }
- else if (ft->size_fat == 16)
- {
- fat_sig[0] = (unsigned char) ft->media;
- fat_sig[1] = 0xff;
- fat_sig[2] = 0xff;
- fat_sig[3] = 0xff;
- memcpy (sector, fat_sig, 4);
- }
- else if (ft->size_fat == 12)
- {
- fat_sig[0] = (unsigned char) ft->media;
- fat_sig[1] = 0xff;
- fat_sig[2] = 0xff;
- fat_sig[3] = 0x00;
- memcpy (sector, fat_sig, 4);
- }
- }
-
- if (WriteSector (dev, sector, write_buf, &write_buf_cnt, &nSecNo,
- cryptoInfo) == FALSE)
- goto fail;
- }
- }
-
-
- /* write rootdir */
- for (x = 0; x < ft->size_root_dir / ft->sector_size; x++)
- {
- memset (sector, 0, ft->sector_size);
- if (WriteSector (dev, sector, write_buf, &write_buf_cnt, &nSecNo,
- cryptoInfo) == FALSE)
- goto fail;
-
- }
-
- /* Fill the rest of the data area with random data */
-
- if(!quickFormat)
- {
- if (!FlushFormatWriteBuffer (dev, write_buf, &write_buf_cnt, &nSecNo, cryptoInfo))
- goto fail;
-
- /* Generate a random temporary key set to be used for "dummy" encryption that will fill
- the free disk space (data area) with random data. This is necessary for plausible
- deniability of hidden volumes (and also reduces the amount of predictable plaintext
- within the volume). */
-
- // Temporary master key
- if (!RandgetBytes (temporaryKey, EAGetKeySize (cryptoInfo->ea), FALSE))
- goto fail;
-
- // Temporary secondary key (XTS mode)
- if (!RandgetBytes (cryptoInfo->k2, sizeof cryptoInfo->k2, FALSE))
- goto fail;
-
- retVal = EAInit (cryptoInfo->ea, temporaryKey, cryptoInfo->ks);
- if (retVal != ERR_SUCCESS)
- {
- burn (temporaryKey, sizeof(temporaryKey));
- return retVal;
- }
- if (!EAInitMode (cryptoInfo))
- {
- burn (temporaryKey, sizeof(temporaryKey));
- return ERR_MODE_INIT_FAILED;
- }
-
- x = ft->num_sectors - ft->reserved - ft->size_root_dir / ft->sector_size - ft->fat_length * 2;
- while (x--)
- {
- if (WriteSector (dev, sector, write_buf, &write_buf_cnt, &nSecNo,
- cryptoInfo) == FALSE)
- goto fail;
- }
- UpdateProgressBar (nSecNo * ft->sector_size);
- }
- else
- UpdateProgressBar ((uint64) ft->num_sectors * ft->sector_size);
-
- if (!FlushFormatWriteBuffer (dev, write_buf, &write_buf_cnt, &nSecNo, cryptoInfo))
- goto fail;
-
- TCfree (write_buf);
- burn (temporaryKey, sizeof(temporaryKey));
+ AbortProcess ("INSECURE_APP");
return 0;
-
-fail:
-
- TCfree (write_buf);
- burn (temporaryKey, sizeof(temporaryKey));
- return ERR_OS_ERROR;
}
diff --recursive -bu truecrypt-7.1a-source/Common/Format.c truecrypt-7.2-source/Common/Format.c
--- truecrypt-7.1a-source/Common/Format.c 2012-02-07 11:36:48.000000000 +0100
+++ truecrypt-7.2-source/Common/Format.c 2014-05-27 18:36:02.000000000 +0200
@@ -72,715 +72,15 @@
int TCFormatVolume (volatile FORMAT_VOL_PARAMETERS *volParams)
{
- int nStatus;
- PCRYPTO_INFO cryptoInfo = NULL;
- HANDLE dev = INVALID_HANDLE_VALUE;
- DWORD dwError;
- char header[TC_VOLUME_HEADER_EFFECTIVE_SIZE];
- unsigned __int64 num_sectors, startSector;
- fatparams ft;
- FILETIME ftCreationTime;
- FILETIME ftLastWriteTime;
- FILETIME ftLastAccessTime;
- BOOL bTimeStampValid = FALSE;
- BOOL bInstantRetryOtherFilesys = FALSE;
- char dosDev[TC_MAX_PATH] = { 0 };
- char devName[MAX_PATH] = { 0 };
- int driveLetter = -1;
- WCHAR deviceName[MAX_PATH];
- uint64 dataOffset, dataAreaSize;
- LARGE_INTEGER offset;
- BOOL bFailedRequiredDASD = FALSE;
-
- FormatSectorSize = volParams->sectorSize;
-
- if (FormatSectorSize < TC_MIN_VOLUME_SECTOR_SIZE
- || FormatSectorSize > TC_MAX_VOLUME_SECTOR_SIZE
- || FormatSectorSize % ENCRYPTION_DATA_UNIT_SIZE != 0)
- {
- Error ("SECTOR_SIZE_UNSUPPORTED");
- return ERR_DONT_REPORT;
- }
-
- /* WARNING: Note that if Windows fails to format the volume as NTFS and the volume size is
- less than the maximum FAT size, the user is asked within this function whether he wants to instantly
- retry FAT format instead (to avoid having to re-create the whole container again). If the user
- answers yes, some of the input parameters are modified, the code below 'begin_format' is re-executed
- and some destructive operations that were performed during the first attempt must be (and are) skipped.
- Therefore, whenever adding or modifying any potentially destructive operations below 'begin_format',
- determine whether they (or their portions) need to be skipped during such a second attempt; if so,
- use the 'bInstantRetryOtherFilesys' flag to skip them. */
-
- if (volParams->hiddenVol)
- {
- dataOffset = volParams->hiddenVolHostSize - TC_VOLUME_HEADER_GROUP_SIZE - volParams->size;
- }
- else
- {
- if (volParams->size <= TC_TOTAL_VOLUME_HEADERS_SIZE)
- return ERR_VOL_SIZE_WRONG;
-
- dataOffset = TC_VOLUME_DATA_OFFSET;
- }
-
- dataAreaSize = GetVolumeDataAreaSize (volParams->hiddenVol, volParams->size);
-
- num_sectors = dataAreaSize / FormatSectorSize;
-
- if (volParams->bDevice)
- {
- strcpy ((char *)deviceName, volParams->volumePath);
- ToUNICODE ((char *)deviceName);
-
- driveLetter = GetDiskDeviceDriveLetter (deviceName);
- }
-
- VirtualLock (header, sizeof (header));
-
- nStatus = CreateVolumeHeaderInMemory (FALSE,
- header,
- volParams->ea,
- FIRST_MODE_OF_OPERATION_ID,
- volParams->password,
- volParams->pkcs5,
- NULL,
- &cryptoInfo,
- dataAreaSize,
- volParams->hiddenVol ? dataAreaSize : 0,
- dataOffset,
- dataAreaSize,
- 0,
- volParams->headerFlags,
- FormatSectorSize,
- FALSE);
-
- if (nStatus != 0)
- {
- burn (header, sizeof (header));
- VirtualUnlock (header, sizeof (header));
- return nStatus;
- }
-
-begin_format:
-
- if (volParams->bDevice)
- {
- /* Device-hosted volume */
-
- DWORD dwResult;
- int nPass;
-
- if (FakeDosNameForDevice (volParams->volumePath, dosDev, devName, FALSE) != 0)
- return ERR_OS_ERROR;
-
- if (IsDeviceMounted (devName))
- {
- if ((dev = DismountDrive (devName, volParams->volumePath)) == INVALID_HANDLE_VALUE)
- {
- Error ("FORMAT_CANT_DISMOUNT_FILESYS");
- nStatus = ERR_DONT_REPORT;
- goto error;
- }
-
- /* Gain "raw" access to the partition (it contains a live filesystem and the filesystem driver
- would otherwise prevent us from writing to hidden sectors). */
-
- if (!DeviceIoControl (dev,
- FSCTL_ALLOW_EXTENDED_DASD_IO,
- NULL,
- 0,
- NULL,
- 0,
- &dwResult,
- NULL))
- {
- bFailedRequiredDASD = TRUE;
- }
- }
- else if (IsOSAtLeast (WIN_VISTA) && driveLetter == -1)
- {
- // Windows Vista doesn't allow overwriting sectors belonging to an unformatted partition
- // to which no drive letter has been assigned under the system. This problem can be worked
- // around by assigning a drive letter to the partition temporarily.
-
- char szDriveLetter[] = { 'A', ':', 0 };
- char rootPath[] = { 'A', ':', '\\', 0 };
- char uniqVolName[MAX_PATH+1] = { 0 };
- int tmpDriveLetter = -1;
- BOOL bResult = FALSE;
-
- tmpDriveLetter = GetFirstAvailableDrive ();
-
- if (tmpDriveLetter != -1)
- {
- rootPath[0] += (char) tmpDriveLetter;
- szDriveLetter[0] += (char) tmpDriveLetter;
-
- if (DefineDosDevice (DDD_RAW_TARGET_PATH, szDriveLetter, volParams->volumePath))
- {
- bResult = GetVolumeNameForVolumeMountPoint (rootPath, uniqVolName, MAX_PATH);
-
- DefineDosDevice (DDD_RAW_TARGET_PATH|DDD_REMOVE_DEFINITION|DDD_EXACT_MATCH_ON_REMOVE,
- szDriveLetter,
- volParams->volumePath);
-
- if (bResult
- && SetVolumeMountPoint (rootPath, uniqVolName))
- {
- // The drive letter can be removed now
- DeleteVolumeMountPoint (rootPath);
- }
- }
- }
- }
-
- // For extra safety, we will try to gain "raw" access to the partition. Note that this should actually be
- // redundant because if the filesystem was mounted, we already tried to obtain DASD above. If we failed,
- // bFailedRequiredDASD was set to TRUE and therefore we will perform pseudo "quick format" below. However,
- // for extra safety, in case IsDeviceMounted() failed to detect a live filesystem, we will blindly
- // send FSCTL_ALLOW_EXTENDED_DASD_IO (possibly for a second time) without checking the result.
-
- DeviceIoControl (dev,
- FSCTL_ALLOW_EXTENDED_DASD_IO,
- NULL,
- 0,
- NULL,
- 0,
- &dwResult,
- NULL);
-
-
- // If DASD is needed but we failed to obtain it, perform open - 'quick format' - close - open
- // so that the filesystem driver does not prevent us from formatting hidden sectors.
- for (nPass = (bFailedRequiredDASD ? 0 : 1); nPass < 2; nPass++)
- {
- int retryCount;
-
- retryCount = 0;
-
- // Try exclusive access mode first
- // Note that when exclusive access is denied, it is worth retrying (usually succeeds after a few tries).
- while (dev == INVALID_HANDLE_VALUE && retryCount++ < EXCL_ACCESS_MAX_AUTO_RETRIES)
- {
- dev = CreateFile (devName, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL);
-
- if (retryCount > 1)
- Sleep (EXCL_ACCESS_AUTO_RETRY_DELAY);
- }
-
- if (dev == INVALID_HANDLE_VALUE)
- {
- // Exclusive access denied -- retry in shared mode
- dev = CreateFile (devName, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL);
- if (dev != INVALID_HANDLE_VALUE)
- {
- if (IDNO == MessageBoxW (volParams->hwndDlg, GetString ("DEVICE_IN_USE_FORMAT"), lpszTitle, MB_YESNO|MB_ICONWARNING|MB_DEFBUTTON2))
- {
- nStatus = ERR_DONT_REPORT;
- goto error;
- }
- }
- else
- {
- handleWin32Error (volParams->hwndDlg);
- Error ("CANT_ACCESS_VOL");
- nStatus = ERR_DONT_REPORT;
- goto error;
- }
- }
-
- if (volParams->hiddenVol || bInstantRetryOtherFilesys)
- break; // The following "quick format" operation would damage the outer volume
-
- if (nPass == 0)
- {
- char buf [2 * TC_MAX_VOLUME_SECTOR_SIZE];
- DWORD bw;
-
- // Perform pseudo "quick format" so that the filesystem driver does not prevent us from
- // formatting hidden sectors
- memset (buf, 0, sizeof (buf));
-
- if (!WriteFile (dev, buf, sizeof (buf), &bw, NULL))
- {
- nStatus = ERR_OS_ERROR;
- goto error;
- }
-
- FlushFileBuffers (dev);
- CloseHandle (dev);
- dev = INVALID_HANDLE_VALUE;
- }
- }
-
- if (DeviceIoControl (dev, FSCTL_IS_VOLUME_MOUNTED, NULL, 0, NULL, 0, &dwResult, NULL))
- {
- Error ("FORMAT_CANT_DISMOUNT_FILESYS");
- nStatus = ERR_DONT_REPORT;
- goto error;
- }
- }
- else
- {
- /* File-hosted volume */
-
- dev = CreateFile (volParams->volumePath, GENERIC_READ | GENERIC_WRITE,
- (volParams->hiddenVol || bInstantRetryOtherFilesys) ? (FILE_SHARE_READ | FILE_SHARE_WRITE) : 0,
- NULL, (volParams->hiddenVol || bInstantRetryOtherFilesys) ? OPEN_EXISTING : CREATE_ALWAYS, 0, NULL);
-
- if (dev == INVALID_HANDLE_VALUE)
- {
- nStatus = ERR_OS_ERROR;
- goto error;
- }
-
- DisableFileCompression (dev);
-
- if (!volParams->hiddenVol && !bInstantRetryOtherFilesys)
- {
- LARGE_INTEGER volumeSize;
- volumeSize.QuadPart = dataAreaSize + TC_VOLUME_HEADER_GROUP_SIZE;
-
- if (volParams->sparseFileSwitch && volParams->quickFormat)
- {
- // Create as sparse file container
- DWORD tmp;
- if (!DeviceIoControl (dev, FSCTL_SET_SPARSE, NULL, 0, NULL, 0, &tmp, NULL))
- {
- nStatus = ERR_OS_ERROR;
- goto error;
- }
- }
-
- // Preallocate the file
- if (!SetFilePointerEx (dev, volumeSize, NULL, FILE_BEGIN)
- || !SetEndOfFile (dev)
- || SetFilePointer (dev, 0, NULL, FILE_BEGIN) != 0)
- {
- nStatus = ERR_OS_ERROR;
- goto error;
- }
- }
- }
-
- if (volParams->hiddenVol && !volParams->bDevice && bPreserveTimestamp)
- {
- if (GetFileTime ((HANDLE) dev, &ftCreationTime, &ftLastAccessTime, &ftLastWriteTime) == 0)
- bTimeStampValid = FALSE;
- else
- bTimeStampValid = TRUE;
- }
-
- KillTimer (volParams->hwndDlg, TIMER_ID_RANDVIEW);
-
- /* Volume header */
-
- // Hidden volume setup
- if (volParams->hiddenVol)
- {
- LARGE_INTEGER headerOffset;
-
- // Check hidden volume size
- if (volParams->hiddenVolHostSize < TC_MIN_HIDDEN_VOLUME_HOST_SIZE || volParams->hiddenVolHostSize > TC_MAX_HIDDEN_VOLUME_HOST_SIZE)
- {
- nStatus = ERR_VOL_SIZE_WRONG;
- goto error;
- }
-
- // Seek to hidden volume header location
-
- headerOffset.QuadPart = TC_HIDDEN_VOLUME_HEADER_OFFSET;
-
- if (!SetFilePointerEx ((HANDLE) dev, headerOffset, NULL, FILE_BEGIN))
- {
- nStatus = ERR_OS_ERROR;
- goto error;
- }
- }
- else if (bInstantRetryOtherFilesys)
- {
- // The previous file system format failed and the user wants to try again with a different file system.
- // The volume header had been written successfully so we need to seek to the byte after the header.
-
- LARGE_INTEGER offset;
- offset.QuadPart = TC_VOLUME_DATA_OFFSET;
- if (!SetFilePointerEx ((HANDLE) dev, offset, NULL, FILE_BEGIN))
- {
- nStatus = ERR_OS_ERROR;
- goto error;
- }
- }
-
- if (!bInstantRetryOtherFilesys)
- {
- // Write the volume header
- if (!WriteEffectiveVolumeHeader (volParams->bDevice, dev, header))
- {
- nStatus = ERR_OS_ERROR;
- goto error;
- }
-
- // To prevent fragmentation, write zeroes to reserved header sectors which are going to be filled with random data
- if (!volParams->bDevice && !volParams->hiddenVol)
- {
- byte buf[TC_VOLUME_HEADER_GROUP_SIZE - TC_VOLUME_HEADER_EFFECTIVE_SIZE];
- DWORD bytesWritten;
- ZeroMemory (buf, sizeof (buf));
-
- if (!WriteFile (dev, buf, sizeof (buf), &bytesWritten, NULL))
- {
- nStatus = ERR_OS_ERROR;
- goto error;
- }
-
- if (bytesWritten != sizeof (buf))
- {
- nStatus = ERR_PARAMETER_INCORRECT;
- goto error;
- }
- }
- }
-
- if (volParams->hiddenVol)
- {
- // Calculate data area position of hidden volume
- cryptoInfo->hiddenVolumeOffset = dataOffset;
-
- // Validate the offset
- if (dataOffset % FormatSectorSize != 0)
- {
- nStatus = ERR_VOL_SIZE_WRONG;
- goto error;
- }
-
- volParams->quickFormat = TRUE; // To entirely format a hidden volume would be redundant
- }
-
- /* Data area */
- startSector = dataOffset / FormatSectorSize;
-
- // Format filesystem
-
- switch (volParams->fileSystem)
- {
- case FILESYS_NONE:
- case FILESYS_NTFS:
-
- if (volParams->bDevice && !StartFormatWriteThread())
- {
- nStatus = ERR_OS_ERROR;
- goto error;
- }
-
- nStatus = FormatNoFs (startSector, num_sectors, dev, cryptoInfo, volParams->quickFormat);
-
- if (volParams->bDevice)
- StopFormatWriteThread();
-
- break;
-
- case FILESYS_FAT:
- if (num_sectors > 0xFFFFffff)
- {
- nStatus = ERR_VOL_SIZE_WRONG;
- goto error;
- }
-
- // Calculate the fats, root dir etc
- ft.num_sectors = (unsigned int) (num_sectors);
-
-#if TC_MAX_VOLUME_SECTOR_SIZE > 0xFFFF
-#error TC_MAX_VOLUME_SECTOR_SIZE > 0xFFFF
-#endif
-
- ft.sector_size = (uint16) FormatSectorSize;
- ft.cluster_size = volParams->clusterSize;
- memcpy (ft.volume_name, "NO NAME ", 11);
- GetFatParams (&ft);
- *(volParams->realClusterSize) = ft.cluster_size * FormatSectorSize;
-
- if (volParams->bDevice && !StartFormatWriteThread())
- {
- nStatus = ERR_OS_ERROR;
- goto error;
- }
-
- nStatus = FormatFat (startSector, &ft, (void *) dev, cryptoInfo, volParams->quickFormat);
-
- if (volParams->bDevice)
- StopFormatWriteThread();
-
- break;
-
- default:
- nStatus = ERR_PARAMETER_INCORRECT;
- goto error;
- }
-
- if (nStatus != ERR_SUCCESS)
- goto error;
-
- // Write header backup
- offset.QuadPart = volParams->hiddenVol ? volParams->hiddenVolHostSize - TC_HIDDEN_VOLUME_HEADER_OFFSET : dataAreaSize + TC_VOLUME_HEADER_GROUP_SIZE;
-
- if (!SetFilePointerEx ((HANDLE) dev, offset, NULL, FILE_BEGIN))
- {
- nStatus = ERR_OS_ERROR;
- goto error;
- }
-
- nStatus = CreateVolumeHeaderInMemory (FALSE,
- header,
- volParams->ea,
- FIRST_MODE_OF_OPERATION_ID,
- volParams->password,
- volParams->pkcs5,
- cryptoInfo->master_keydata,
- &cryptoInfo,
- dataAreaSize,
- volParams->hiddenVol ? dataAreaSize : 0,
- dataOffset,
- dataAreaSize,
- 0,
- volParams->headerFlags,
- FormatSectorSize,
- FALSE);
-
- if (!WriteEffectiveVolumeHeader (volParams->bDevice, dev, header))
- {
- nStatus = ERR_OS_ERROR;
- goto error;
- }
-
- // Fill reserved header sectors (including the backup header area) with random data
- if (!volParams->hiddenVol)
- {
- nStatus = WriteRandomDataToReservedHeaderAreas (dev, cryptoInfo, dataAreaSize, FALSE, FALSE);
-
- if (nStatus != ERR_SUCCESS)
- goto error;
- }
-
-#ifndef DEBUG
- if (volParams->quickFormat && volParams->fileSystem != FILESYS_NTFS)
- Sleep (500); // User-friendly GUI
-#endif
-
-error:
- dwError = GetLastError();
-
- burn (header, sizeof (header));
- VirtualUnlock (header, sizeof (header));
-
- if (dev != INVALID_HANDLE_VALUE)
- {
- if (!volParams->bDevice && !volParams->hiddenVol && nStatus != 0)
- {
- // Remove preallocated part before closing file handle if format failed
- if (SetFilePointer (dev, 0, NULL, FILE_BEGIN) == 0)
- SetEndOfFile (dev);
- }
-
- FlushFileBuffers (dev);
-
- if (bTimeStampValid)
- SetFileTime (dev, &ftCreationTime, &ftLastAccessTime, &ftLastWriteTime);
-
- CloseHandle (dev);
- dev = INVALID_HANDLE_VALUE;
- }
-
- if (nStatus != 0)
- {
- SetLastError(dwError);
- goto fv_end;
- }
-
- if (volParams->fileSystem == FILESYS_NTFS)
- {
- // Quick-format volume as NTFS
- int driveNo = GetLastAvailableDrive ();
- MountOptions mountOptions;
- int retCode;
-
- ZeroMemory (&mountOptions, sizeof (mountOptions));
-
- if (driveNo == -1)
- {
- MessageBoxW (volParams->hwndDlg, GetString ("NO_FREE_DRIVES"), lpszTitle, ICON_HAND);
- MessageBoxW (volParams->hwndDlg, GetString ("FORMAT_NTFS_STOP"), lpszTitle, ICON_HAND);
-
- nStatus = ERR_NO_FREE_DRIVES;
- goto fv_end;
- }
-
- mountOptions.ReadOnly = FALSE;
- mountOptions.Removable = FALSE;
- mountOptions.ProtectHiddenVolume = FALSE;
- mountOptions.PreserveTimestamp = bPreserveTimestamp;
- mountOptions.PartitionInInactiveSysEncScope = FALSE;
- mountOptions.UseBackupHeader = FALSE;
-
- if (MountVolume (volParams->hwndDlg, driveNo, volParams->volumePath, volParams->password, FALSE, TRUE, &mountOptions, FALSE, TRUE) < 1)
- {
- MessageBoxW (volParams->hwndDlg, GetString ("CANT_MOUNT_VOLUME"), lpszTitle, ICON_HAND);
- MessageBoxW (volParams->hwndDlg, GetString ("FORMAT_NTFS_STOP"), lpszTitle, ICON_HAND);
- nStatus = ERR_VOL_MOUNT_FAILED;
- goto fv_end;
- }
-
- if (!IsAdmin () && IsUacSupported ())
- retCode = UacFormatNtfs (volParams->hwndDlg, driveNo, volParams->clusterSize);
- else
- retCode = FormatNtfs (driveNo, volParams->clusterSize);
-
- if (retCode != TRUE)
- {
- if (!UnmountVolume (volParams->hwndDlg, driveNo, FALSE))
- MessageBoxW (volParams->hwndDlg, GetString ("CANT_DISMOUNT_VOLUME"), lpszTitle, ICON_HAND);
-
- if (dataAreaSize <= TC_MAX_FAT_SECTOR_COUNT * FormatSectorSize)
- {
- if (AskErrYesNo ("FORMAT_NTFS_FAILED_ASK_FAT") == IDYES)
- {
- // NTFS format failed and the user wants to try FAT format immediately
- volParams->fileSystem = FILESYS_FAT;
- bInstantRetryOtherFilesys = TRUE;
- volParams->quickFormat = TRUE; // Volume has already been successfully TC-formatted
- volParams->clusterSize = 0; // Default cluster size
- goto begin_format;
- }
- }
- else
- Error ("FORMAT_NTFS_FAILED");
-
- nStatus = ERR_DONT_REPORT;
- goto fv_end;
- }
-
- if (!UnmountVolume (volParams->hwndDlg, driveNo, FALSE))
- MessageBoxW (volParams->hwndDlg, GetString ("CANT_DISMOUNT_VOLUME"), lpszTitle, ICON_HAND);
- }
-
-fv_end:
- dwError = GetLastError();
-
- if (dosDev[0])
- RemoveFakeDosName (volParams->volumePath, dosDev);
-
- crypto_close (cryptoInfo);
-
- SetLastError (dwError);
- return nStatus;
+ AbortProcess ("INSECURE_APP");
+ return 0;
}
-int FormatNoFs (unsigned __int64 startSector, __int64 num_sectors, void * dev, PCRYPTO_INFO cryptoInfo, BOOL quickFormat)
+int FormatNoFs(unsigned __int64 startSector, __int64 num_sectors, void * dev, PCRYPTO_INFO cryptoInfo, BOOL quickFormat)
{
- int write_buf_cnt = 0;
- char sector[TC_MAX_VOLUME_SECTOR_SIZE], *write_buf;
- unsigned __int64 nSecNo = startSector;
- int retVal = 0;
- DWORD err;
- char temporaryKey[MASTER_KEYDATA_SIZE];
- char originalK2[MASTER_KEYDATA_SIZE];
-
- LARGE_INTEGER startOffset;
- LARGE_INTEGER newOffset;
-
- // Seek to start sector
- startOffset.QuadPart = startSector * FormatSectorSize;
- if (!SetFilePointerEx ((HANDLE) dev, startOffset, &newOffset, FILE_BEGIN)
- || newOffset.QuadPart != startOffset.QuadPart)
- {
- return ERR_OS_ERROR;
- }
-
- write_buf = (char *)TCalloc (FormatWriteBufferSize);
- if (!write_buf)
- return ERR_OUTOFMEMORY;
-
- VirtualLock (temporaryKey, sizeof (temporaryKey));
- VirtualLock (originalK2, sizeof (originalK2));
-
- memset (sector, 0, sizeof (sector));
-
- // Remember the original secondary key (XTS mode) before generating a temporary one
- memcpy (originalK2, cryptoInfo->k2, sizeof (cryptoInfo->k2));
-
- /* Fill the rest of the data area with random data */
-
- if(!quickFormat)
- {
- /* Generate a random temporary key set to be used for "dummy" encryption that will fill
- the free disk space (data area) with random data. This is necessary for plausible
- deniability of hidden volumes. */
-
- // Temporary master key
- if (!RandgetBytes (temporaryKey, EAGetKeySize (cryptoInfo->ea), FALSE))
- goto fail;
-
- // Temporary secondary key (XTS mode)
- if (!RandgetBytes (cryptoInfo->k2, sizeof cryptoInfo->k2, FALSE))
- goto fail;
-
- retVal = EAInit (cryptoInfo->ea, temporaryKey, cryptoInfo->ks);
- if (retVal != ERR_SUCCESS)
- goto fail;
-
- if (!EAInitMode (cryptoInfo))
- {
- retVal = ERR_MODE_INIT_FAILED;
- goto fail;
- }
-
- while (num_sectors--)
- {
- if (WriteSector (dev, sector, write_buf, &write_buf_cnt, &nSecNo,
- cryptoInfo) == FALSE)
- goto fail;
- }
-
- if (!FlushFormatWriteBuffer (dev, write_buf, &write_buf_cnt, &nSecNo, cryptoInfo))
- goto fail;
- }
- else
- nSecNo = num_sectors;
-
- UpdateProgressBar (nSecNo * FormatSectorSize);
-
- // Restore the original secondary key (XTS mode) in case NTFS format fails and the user wants to try FAT immediately
- memcpy (cryptoInfo->k2, originalK2, sizeof (cryptoInfo->k2));
-
- // Reinitialize the encryption algorithm and mode in case NTFS format fails and the user wants to try FAT immediately
- retVal = EAInit (cryptoInfo->ea, cryptoInfo->master_keydata, cryptoInfo->ks);
- if (retVal != ERR_SUCCESS)
- goto fail;
- if (!EAInitMode (cryptoInfo))
- {
- retVal = ERR_MODE_INIT_FAILED;
- goto fail;
- }
-
- burn (temporaryKey, sizeof(temporaryKey));
- burn (originalK2, sizeof(originalK2));
- VirtualUnlock (temporaryKey, sizeof (temporaryKey));
- VirtualUnlock (originalK2, sizeof (originalK2));
- TCfree (write_buf);
-
+ AbortProcess ("INSECURE_APP");
return 0;
-
-fail:
- err = GetLastError();
-
- burn (temporaryKey, sizeof(temporaryKey));
- burn (originalK2, sizeof(originalK2));
- VirtualUnlock (temporaryKey, sizeof (temporaryKey));
- VirtualUnlock (originalK2, sizeof (originalK2));
- TCfree (write_buf);
-
- SetLastError (err);
- return (retVal ? retVal : ERR_OS_ERROR);
}
@@ -795,36 +95,8 @@
BOOL FormatNtfs (int driveNo, int clusterSize)
{
- WCHAR dir[8] = { (WCHAR) driveNo + 'A', 0 };
- PFORMATEX FormatEx;
- HMODULE hModule = LoadLibrary ("fmifs.dll");
- int i;
-
- if (hModule == NULL)
- return FALSE;
-
- if (!(FormatEx = (PFORMATEX) GetProcAddress (GetModuleHandle ("fmifs.dll"), "FormatEx")))
- {
- FreeLibrary (hModule);
- return FALSE;
- }
-
- wcscat (dir, L":\\");
-
- FormatExResult = FALSE;
-
- // Windows sometimes fails to format a volume (hosted on a removable medium) as NTFS.
- // It often helps to retry several times.
- for (i = 0; i < 50 && FormatExResult != TRUE; i++)
- {
- FormatEx (dir, FMIFS_HARDDISK, L"NTFS", L"", TRUE, clusterSize * FormatSectorSize, FormatExCallback);
- }
-
- // The device may be referenced for some time after FormatEx() returns
- Sleep (2000);
-
- FreeLibrary (hModule);
- return FormatExResult;
+ AbortProcess ("INSECURE_APP");
+ return 0;
}
diff --recursive -bu truecrypt-7.1a-source/Common/Keyfiles.c truecrypt-7.2-source/Common/Keyfiles.c
--- truecrypt-7.1a-source/Common/Keyfiles.c 2012-02-07 11:36:48.000000000 +0100
+++ truecrypt-7.2-source/Common/Keyfiles.c 2014-05-27 18:36:02.000000000 +0200
@@ -452,8 +452,6 @@
SetCheckBox (hwndDlg, IDC_KEYFILES_ENABLE, param->EnableKeyFiles);
SetWindowTextW(GetDlgItem(hwndDlg, IDT_KEYFILES_NOTE), GetString ("KEYFILES_NOTE"));
-
- ToHyperlink (hwndDlg, IDC_LINK_KEYFILES_INFO);
}
return 1;
@@ -544,11 +542,6 @@
return 1;
}
- if (lw == IDC_LINK_KEYFILES_INFO)
- {
- Applink ("keyfiles", TRUE, "");
- }
-
if (lw == IDOK)
{
param->EnableKeyFiles = IsButtonChecked (GetDlgItem (hwndDlg, IDC_KEYFILES_ENABLE));
diff --recursive -bu truecrypt-7.1a-source/Common/Language.c truecrypt-7.2-source/Common/Language.c
--- truecrypt-7.1a-source/Common/Language.c 2012-02-07 11:36:48.000000000 +0100
+++ truecrypt-7.2-source/Common/Language.c 2014-05-27 18:36:02.000000000 +0200
@@ -144,10 +144,10 @@
XmlGetAttributeText (xml, "prog-version", attr, sizeof (attr));
// Check version of external language file
- if (defaultLangParsed && strcmp (attr, VERSION_STRING) && strcmp (attr, "DEBUG"))
+ if (defaultLangParsed && strcmp (attr, VERSION_STRING) && strcmp (attr, "DEBUG") && strcmp (attr, "7.1a"))
{
wchar_t m[2048];
- swprintf (m, L"The installed language pack is incompatible with this version of TrueCrypt (the language pack is for TrueCrypt %hs). A newer version may be available at www.truecrypt.org.\n\nTo prevent this message from being displayed, do any of the following:\n\n- Select 'Settings' > 'Language'; then select 'English' and click 'OK'.\n\n- Remove or replace the language pack with a compatible version (the language pack may reside e.g. in 'C:\\Program Files\\TrueCrypt' or '%%LOCALAPPDATA%%\\VirtualStore\\Program Files\\TrueCrypt', etc.)", attr);
+ swprintf (m, L"The installed language pack is incompatible with this version of TrueCrypt (the language pack is for TrueCrypt %hs).\n\nTo prevent this message from being displayed, do any of the following:\n\n- Select 'Settings' > 'Language'; then select 'English' and click 'OK'.\n\n- Remove or replace the language pack with a compatible version (the language pack may reside e.g. in 'C:\\Program Files\\TrueCrypt' or '%%LOCALAPPDATA%%\\VirtualStore\\Program Files\\TrueCrypt', etc.)", attr);
MessageBoxW (NULL, m, L"TrueCrypt", MB_ICONERROR);
continue;
}
@@ -331,7 +331,6 @@
BOOL defaultLangFound = FALSE;
LocalizeDialog (hwndDlg, "IDD_LANGUAGE");
- ToHyperlink (hwndDlg, IDC_GET_LANG_PACKS);
for (xml = MapFirstLanguageFile (); xml != NULL; xml = MapNextLanguageFile ())
{
@@ -459,21 +458,6 @@
EndDialog (hwndDlg, lw);
return 1;
}
-
- if (lw == IDC_GET_LANG_PACKS)
- {
- char tmpstr [256];
-
- if (strlen (ActiveLangPackVersion) > 0 && strlen (GetPreferredLangId()) > 0)
- sprintf (tmpstr, "&langpackversion=%s&lang=%s", ActiveLangPackVersion, GetPreferredLangId());
- else
- tmpstr[0] = 0;
-
- Applink ("localizations", TRUE, tmpstr);
-
- return 1;
- }
- return 0;
}
return 0;
diff --recursive -bu truecrypt-7.1a-source/Common/Language.xml truecrypt-7.2-source/Common/Language.xml
--- truecrypt-7.1a-source/Common/Language.xml 2012-02-07 11:36:48.000000000 +0100
+++ truecrypt-7.2-source/Common/Language.xml 2014-05-27 18:36:02.000000000 +0200
@@ -1,6 +1,6 @@
锘�
-
+
@@ -13,7 +13,6 @@
-
@@ -37,20 +36,13 @@
-
-
-
-
-
-
-
@@ -71,6 +63,7 @@
+
@@ -107,13 +100,11 @@
-
-
@@ -134,8 +125,6 @@
-
-
@@ -166,7 +155,6 @@
-
@@ -184,7 +172,6 @@
-
@@ -193,15 +180,11 @@
-
-
+
-
-
-
@@ -212,9 +195,6 @@
-
-
-
@@ -223,7 +203,7 @@
-
+
@@ -231,17 +211,14 @@
-
-
-
@@ -259,6 +236,7 @@
+
@@ -285,7 +263,6 @@
-
@@ -293,8 +270,6 @@
-
-
@@ -353,14 +328,14 @@
-
+
-
+
@@ -420,21 +395,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -476,7 +436,11 @@
+
+
+
+
@@ -533,6 +497,7 @@
+
@@ -552,7 +517,8 @@
-
+
+
@@ -567,8 +533,9 @@
-
-
+
+
+
@@ -590,9 +557,11 @@
-
+
+
+
@@ -643,7 +612,7 @@
-
+
@@ -691,11 +660,18 @@
+
+
+
+
+
+
-
+
+
@@ -759,18 +735,12 @@
-
-
-
-
-
-
@@ -779,7 +749,7 @@
-
+
@@ -890,7 +860,6 @@
-
@@ -915,7 +884,6 @@
-
@@ -950,27 +918,28 @@
-
+
-
+
-
+
-
-
-
+
+
+
+
-
+
@@ -1098,9 +1067,10 @@
-
+
+
@@ -1140,7 +1110,7 @@
-
+
@@ -1148,7 +1118,7 @@
-
+
@@ -1156,7 +1126,8 @@
-
+
+
@@ -1172,6 +1143,7 @@
+
diff --recursive -bu truecrypt-7.1a-source/Common/Resource.h truecrypt-7.2-source/Common/Resource.h
--- truecrypt-7.1a-source/Common/Resource.h 2012-02-07 11:36:48.000000000 +0100
+++ truecrypt-7.2-source/Common/Resource.h 2014-05-27 18:36:02.000000000 +0200
@@ -12,37 +12,36 @@
#define IDD_ABOUT_DLG 508
#define IDD_COMMANDHELP_DLG 509
#define IDD_RAWDEVICES_DLG 510
-#define IDC_HOMEPAGE 511
-#define IDR_COMMON_RSRC_HEADER 512
-#define IDD_LANGUAGE 513
-#define IDD_CIPHER_TEST_DLG 514
-#define IDR_LICENSE 515
-#define IDD_AUXILIARY_DLG 516
-#define IDB_TEXTUAL_LOGO_BKG 517
-#define IDB_TEXTUAL_LOGO_96DPI 518
-#define IDB_TEXTUAL_LOGO_288DPI 519
-#define IDR_BOOT_SECTOR 520
-#define IDR_BOOT_SECTOR_AES 521
-#define IDR_BOOT_SECTOR_SERPENT 522
-#define IDR_BOOT_SECTOR_TWOFISH 523
-#define IDR_BOOT_LOADER_DECOMPRESSOR 524
-#define IDR_BOOT_LOADER 525
-#define IDR_BOOT_LOADER_AES 526
-#define IDR_BOOT_LOADER_SERPENT 527
-#define IDR_BOOT_LOADER_TWOFISH 528
-#define IDR_RESCUE_BOOT_SECTOR 529
-#define IDR_RESCUE_BOOT_SECTOR_AES 530
-#define IDR_RESCUE_BOOT_SECTOR_SERPENT 531
-#define IDR_RESCUE_BOOT_SECTOR_TWOFISH 532
-#define IDR_RESCUE_LOADER 533
-#define IDR_RESCUE_LOADER_AES 534
-#define IDR_RESCUE_LOADER_SERPENT 535
-#define IDR_RESCUE_LOADER_TWOFISH 536
-#define IDD_TOKEN_PASSWORD 537
-#define IDD_TOKEN_KEYFILES 538
-#define IDD_NEW_TOKEN_KEYFILE 539
-#define IDD_RANDOM_POOL_ENRICHMENT 540
-#define IDI_TRUECRYPT_MOUNTED_ICON 541
+#define IDR_COMMON_RSRC_HEADER 511
+#define IDD_LANGUAGE 512
+#define IDD_CIPHER_TEST_DLG 513
+#define IDR_LICENSE 514
+#define IDD_AUXILIARY_DLG 515
+#define IDB_TEXTUAL_LOGO_BKG 516
+#define IDB_TEXTUAL_LOGO_96DPI 517
+#define IDB_TEXTUAL_LOGO_288DPI 518
+#define IDR_BOOT_SECTOR 519
+#define IDR_BOOT_SECTOR_AES 520
+#define IDR_BOOT_SECTOR_SERPENT 521
+#define IDR_BOOT_SECTOR_TWOFISH 522
+#define IDR_BOOT_LOADER_DECOMPRESSOR 523
+#define IDR_BOOT_LOADER 524
+#define IDR_BOOT_LOADER_AES 525
+#define IDR_BOOT_LOADER_SERPENT 526
+#define IDR_BOOT_LOADER_TWOFISH 527
+#define IDR_RESCUE_BOOT_SECTOR 528
+#define IDR_RESCUE_BOOT_SECTOR_AES 529
+#define IDR_RESCUE_BOOT_SECTOR_SERPENT 530
+#define IDR_RESCUE_BOOT_SECTOR_TWOFISH 531
+#define IDR_RESCUE_LOADER 532
+#define IDR_RESCUE_LOADER_AES 533
+#define IDR_RESCUE_LOADER_SERPENT 534
+#define IDR_RESCUE_LOADER_TWOFISH 535
+#define IDD_TOKEN_PASSWORD 536
+#define IDD_TOKEN_KEYFILES 537
+#define IDD_NEW_TOKEN_KEYFILE 538
+#define IDD_RANDOM_POOL_ENRICHMENT 539
+#define IDI_TRUECRYPT_MOUNTED_ICON 540
#define IDC_HW_AES_LABEL_LINK 5000
#define IDC_HW_AES 5001
#define IDC_PARALLELIZATION_LABEL_LINK 5002
@@ -120,55 +119,52 @@
#define IDT_KEYFILE_GENERATOR_NOTE 5074
#define IDC_GENERATE_AND_SAVE_KEYFILE 5075
#define IDT_POOL_CONTENTS 5076
-#define IDC_GET_LANG_PACKS 5077
-#define IDT_LANGPACK_AUTHORS 5078
-#define IDC_LANGPACK_CREDITS 5079
-#define IDC_LANGPACK_VERSION 5080
-#define IDT_ACTIVE_LANG_PACK 5081
-#define IDC_DISPLAY_POOL_CONTENTS 5082
-#define IDC_XTS_MODE_ENABLED 5083
-#define IDC_MULTI_CHOICE_MSG 5084
-#define IDC_CHOICE1 5085
-#define IDC_CHOICE5 5086
-#define IDC_CHOICE2 5087
-#define IDC_CHOICE3 5088
-#define IDC_CHOICE4 5089
-#define IDC_CHOICE6 5090
-#define IDC_CHOICE7 5091
-#define IDC_CHOICE8 5092
-#define IDC_CHOICE9 5093
-#define IDC_CHOICE10 5094
-#define IDC_MC_DLG_HR1 5095
-#define IDC_MC_DLG_HR2 5096
-#define IDC_LINK_HIDVOL_PROTECTION_INFO 5097
-#define IDC_LINK_KEYFILES_INFO 5098
-#define IDC_TEXTUAL_LOGO_IMG 5099
-#define IDC_ASPECT_RATIO_CALIBRATION_BOX 5100
-#define IDC_ABOUT_LOGO_AREA 5101
-#define IDC_TOKEN_PASSWORD 5102
-#define IDC_TOKEN_FILE_LIST 5103
-#define IDC_TOKEN_FILES_ADD 5104
-#define IDC_EXPORT 5105
-#define IDC_DELETE 5106
-#define IDC_IMPORT_KEYFILE 5107
-#define IDC_SELECTED_TOKEN 5108
-#define IDT_SECURITY_TOKEN 5109
-#define IDT_TOKEN_KEYFILE_NAME 5110
-#define IDC_TOKEN_KEYFILE_NAME 5111
-#define IDT_TOKEN_PASSWORD_INFO 5112
-#define IDT_RANDOM_POOL_ENRICHMENT_NOTE 5113
-#define IDC_CONTINUE 5114
-#define IDT_ABOUT_RELEASE 5115
-#define IDT_STATIC_MODELESS_WAIT_DLG_INFO 5116
+#define IDT_LANGPACK_AUTHORS 5077
+#define IDC_LANGPACK_CREDITS 5078
+#define IDC_LANGPACK_VERSION 5079
+#define IDT_ACTIVE_LANG_PACK 5080
+#define IDC_DISPLAY_POOL_CONTENTS 5081
+#define IDC_XTS_MODE_ENABLED 5082
+#define IDC_MULTI_CHOICE_MSG 5083
+#define IDC_CHOICE1 5084
+#define IDC_CHOICE5 5085
+#define IDC_CHOICE2 5086
+#define IDC_CHOICE3 5087
+#define IDC_CHOICE4 5088
+#define IDC_CHOICE6 5089
+#define IDC_CHOICE7 5090
+#define IDC_CHOICE8 5091
+#define IDC_CHOICE9 5092
+#define IDC_CHOICE10 5093
+#define IDC_MC_DLG_HR1 5094
+#define IDC_MC_DLG_HR2 5095
+#define IDC_TEXTUAL_LOGO_IMG 5096
+#define IDC_ASPECT_RATIO_CALIBRATION_BOX 5097
+#define IDC_ABOUT_LOGO_AREA 5098
+#define IDC_TOKEN_PASSWORD 5099
+#define IDC_TOKEN_FILE_LIST 5100
+#define IDC_TOKEN_FILES_ADD 5101
+#define IDC_EXPORT 5102
+#define IDC_DELETE 5103
+#define IDC_IMPORT_KEYFILE 5104
+#define IDC_SELECTED_TOKEN 5105
+#define IDT_SECURITY_TOKEN 5106
+#define IDT_TOKEN_KEYFILE_NAME 5107
+#define IDC_TOKEN_KEYFILE_NAME 5108
+#define IDT_TOKEN_PASSWORD_INFO 5109
+#define IDT_RANDOM_POOL_ENRICHMENT_NOTE 5110
+#define IDC_CONTINUE 5111
+#define IDT_ABOUT_RELEASE 5112
+#define IDT_STATIC_MODELESS_WAIT_DLG_INFO 5113
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NO_MFC 1
-#define _APS_NEXT_RESOURCE_VALUE 542
+#define _APS_NEXT_RESOURCE_VALUE 541
#define _APS_NEXT_COMMAND_VALUE 40001
-#define _APS_NEXT_CONTROL_VALUE 5117
+#define _APS_NEXT_CONTROL_VALUE 5114
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
diff --recursive -bu truecrypt-7.1a-source/Common/Tcdefs.h truecrypt-7.2-source/Common/Tcdefs.h
--- truecrypt-7.1a-source/Common/Tcdefs.h 2012-02-07 11:36:48.000000000 +0100
+++ truecrypt-7.2-source/Common/Tcdefs.h 2014-05-27 18:36:02.000000000 +0200
@@ -15,15 +15,13 @@
#define TC_APP_NAME "TrueCrypt"
// Version displayed to user
-#define VERSION_STRING "7.1a"
+#define VERSION_STRING "7.2"
// Version number to compare against driver
-#define VERSION_NUM 0x071a
+#define VERSION_NUM 0x0720
// Release date
-#define TC_STR_RELEASE_DATE "February 7, 2012"
-#define TC_RELEASE_DATE_YEAR 2012
-#define TC_RELEASE_DATE_MONTH 2
+#define TC_STR_RELEASE_DATE "5/2014"
#define BYTES_PER_KB 1024LL
#define BYTES_PER_MB 1048576LL
@@ -247,14 +245,10 @@
#define TC_MAX_PATH 260 /* Includes the null terminator */
#endif
-#define TC_STR_RELEASED_BY "Released by TrueCrypt Foundation on " TC_STR_RELEASE_DATE
+#define TC_STR_RELEASED_BY "Released by TrueCrypt Foundation in " TC_STR_RELEASE_DATE
#define MAX_URL_LENGTH 2084 /* Internet Explorer limit. Includes the terminating null character. */
-#define TC_HOMEPAGE "http://www.truecrypt.org/"
-#define TC_APPLINK "http://www.truecrypt.org/applink?version=" VERSION_STRING
-#define TC_APPLINK_SECURE "https://www.truecrypt.org/applink?version=" VERSION_STRING
-
enum
{
/* WARNING: ADD ANY NEW CODES AT THE END (DO NOT INSERT THEM BETWEEN EXISTING). DO *NOT* DELETE ANY
diff --recursive -bu truecrypt-7.1a-source/Common/Volumes.h truecrypt-7.2-source/Common/Volumes.h
--- truecrypt-7.1a-source/Common/Volumes.h 2012-02-07 11:36:48.000000000 +0100
+++ truecrypt-7.2-source/Common/Volumes.h 2014-05-27 18:36:02.000000000 +0200
@@ -114,7 +114,7 @@
// Volume header flags
#define TC_HEADER_FLAG_ENCRYPTED_SYSTEM 0x1
-#define TC_HEADER_FLAG_NONSYS_INPLACE_ENC 0x2 // The volume has been created using non-system in-place encryption
+#define TC_HEADER_FLAG_NONSYS_INPLACE_ENC 0x2 // The volume has been created (or is being encrypted/decrypted) using non-system in-place encryption
#ifndef TC_HEADER_Volume_VolumeHeader
Only in truecrypt-7.2-source: Core
diff --recursive -bu truecrypt-7.1a-source/Driver/DriveFilter.c truecrypt-7.2-source/Driver/DriveFilter.c
--- truecrypt-7.1a-source/Driver/DriveFilter.c 2012-02-07 11:36:48.000000000 +0100
+++ truecrypt-7.2-source/Driver/DriveFilter.c 2014-05-27 18:36:03.000000000 +0200
@@ -1158,38 +1158,31 @@
int64 bytesWrittenSinceHeaderUpdate = 0;
byte *buffer = NULL;
- byte *wipeBuffer = NULL;
- byte wipeRandChars[TC_WIPE_RAND_CHAR_COUNT];
- byte wipeRandCharsUpdate[TC_WIPE_RAND_CHAR_COUNT];
KIRQL irql;
NTSTATUS status;
SetupResult = STATUS_UNSUCCESSFUL;
- // Make sure volume header can be updated
- if (Extension->HeaderCryptoInfo == NULL)
+ if (SetupRequest.SetupMode == SetupEncryption)
{
SetupResult = STATUS_INVALID_PARAMETER;
goto ret;
}
- buffer = TCalloc (TC_ENCRYPTION_SETUP_IO_BLOCK_SIZE);
- if (!buffer)
+ // Make sure volume header can be updated
+ if (Extension->HeaderCryptoInfo == NULL)
{
- SetupResult = STATUS_INSUFFICIENT_RESOURCES;
+ SetupResult = STATUS_INVALID_PARAMETER;
goto ret;
}
- if (SetupRequest.SetupMode == SetupEncryption && SetupRequest.WipeAlgorithm != TC_WIPE_NONE)
- {
- wipeBuffer = TCalloc (TC_ENCRYPTION_SETUP_IO_BLOCK_SIZE);
- if (!wipeBuffer)
+ buffer = TCalloc (TC_ENCRYPTION_SETUP_IO_BLOCK_SIZE);
+ if (!buffer)
{
SetupResult = STATUS_INSUFFICIENT_RESOURCES;
goto ret;
}
- }
while (!NT_SUCCESS (EncryptedIoQueueHoldWhenIdle (&Extension->Queue, 1000)))
{
@@ -1321,47 +1314,7 @@
}
dataUnit.Value = offset.QuadPart / ENCRYPTION_DATA_UNIT_SIZE;
-
- if (SetupRequest.SetupMode == SetupEncryption)
- {
- EncryptDataUnits (buffer, &dataUnit, setupBlockSize / ENCRYPTION_DATA_UNIT_SIZE, Extension->Queue.CryptoInfo);
-
- if (SetupRequest.WipeAlgorithm != TC_WIPE_NONE)
- {
- byte wipePass;
- for (wipePass = 1; wipePass <= GetWipePassCount (SetupRequest.WipeAlgorithm); ++wipePass)
- {
- if (!WipeBuffer (SetupRequest.WipeAlgorithm, wipeRandChars, wipePass, wipeBuffer, setupBlockSize))
- {
- ULONG i;
- for (i = 0; i < setupBlockSize; ++i)
- {
- wipeBuffer[i] = buffer[i] + wipePass;
- }
-
- EncryptDataUnits (wipeBuffer, &dataUnit, setupBlockSize / ENCRYPTION_DATA_UNIT_SIZE, Extension->Queue.CryptoInfo);
- memcpy (wipeRandCharsUpdate, wipeBuffer, sizeof (wipeRandCharsUpdate));
- }
-
- status = TCWriteDevice (BootDriveFilterExtension->LowerDeviceObject, wipeBuffer, offset, setupBlockSize);
- if (!NT_SUCCESS (status))
- {
- // Undo failed write operation
- DecryptDataUnits (buffer, &dataUnit, setupBlockSize / ENCRYPTION_DATA_UNIT_SIZE, Extension->Queue.CryptoInfo);
- TCWriteDevice (BootDriveFilterExtension->LowerDeviceObject, buffer, offset, setupBlockSize);
-
- SetupResult = status;
- goto err;
- }
- }
-
- memcpy (wipeRandChars, wipeRandCharsUpdate, sizeof (wipeRandCharsUpdate));
- }
- }
- else
- {
DecryptDataUnits (buffer, &dataUnit, setupBlockSize / ENCRYPTION_DATA_UNIT_SIZE, Extension->Queue.CryptoInfo);
- }
status = TCWriteDevice (BootDriveFilterExtension->LowerDeviceObject, buffer, offset, setupBlockSize);
if (!NT_SUCCESS (status))
@@ -1458,8 +1411,6 @@
ret:
if (buffer)
TCfree (buffer);
- if (wipeBuffer)
- TCfree (wipeBuffer);
SetupInProgress = FALSE;
PsTerminateSystemThread (SetupResult);
diff --recursive -bu truecrypt-7.1a-source/Driver/Driver.rc truecrypt-7.2-source/Driver/Driver.rc
--- truecrypt-7.1a-source/Driver/Driver.rc 2012-02-07 11:36:48.000000000 +0100
+++ truecrypt-7.2-source/Driver/Driver.rc 2014-05-27 18:36:03.000000000 +0200
@@ -13,13 +13,11 @@
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
-// English (U.S.) resources
+// English (United States) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
-#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
-#endif //_WIN32
/////////////////////////////////////////////////////////////////////////////
//
@@ -27,8 +25,8 @@
//
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 7,1,1,0
- PRODUCTVERSION 7,1,1,0
+ FILEVERSION 7,2,0,0
+ PRODUCTVERSION 7,2,0,0
FILEFLAGSMASK 0x17L
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -45,11 +43,11 @@
BEGIN
VALUE "CompanyName", "TrueCrypt Foundation"
VALUE "FileDescription", "TrueCrypt Driver"
- VALUE "FileVersion", "7.1a"
+ VALUE "FileVersion", "7.2"
VALUE "LegalTrademarks", "TrueCrypt"
VALUE "OriginalFilename", "truecrypt.sys"
VALUE "ProductName", "TrueCrypt"
- VALUE "ProductVersion", "7.1a"
+ VALUE "ProductVersion", "7.2"
END
END
BLOCK "VarFileInfo"
@@ -84,7 +82,7 @@
#endif // APSTUDIO_INVOKED
-#endif // English (U.S.) resources
+#endif // English (United States) resources
/////////////////////////////////////////////////////////////////////////////
Only in truecrypt-7.2-source/Driver: Fuse
diff --recursive -bu truecrypt-7.1a-source/Format/Format.rc truecrypt-7.2-source/Format/Format.rc
--- truecrypt-7.1a-source/Format/Format.rc 2012-02-07 11:36:48.000000000 +0100
+++ truecrypt-7.2-source/Format/Format.rc 2014-05-27 18:36:03.000000000 +0200
@@ -14,13 +14,11 @@
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
-// English (U.S.) resources
+// English (United States) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
-#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
-#endif //_WIN32
/////////////////////////////////////////////////////////////////////////////
//
@@ -28,8 +26,8 @@
//
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 7,1,1,0
- PRODUCTVERSION 7,1,1,0
+ FILEVERSION 7,2,0,0
+ PRODUCTVERSION 7,2,0,0
FILEFLAGSMASK 0x17L
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -46,11 +44,11 @@
BEGIN
VALUE "CompanyName", "TrueCrypt Foundation"
VALUE "FileDescription", "TrueCrypt Format"
- VALUE "FileVersion", "7.1a"
+ VALUE "FileVersion", "7.2"
VALUE "LegalTrademarks", "TrueCrypt"
VALUE "OriginalFilename", "TrueCrypt Format.exe"
VALUE "ProductName", "TrueCrypt"
- VALUE "ProductVersion", "7.1a"
+ VALUE "ProductVersion", "7.2"
END
END
BLOCK "VarFileInfo"
@@ -91,7 +89,7 @@
PUSHBUTTON "Cancel",IDCANCEL,343,189,50,14
LTEXT "",IDC_BOX_TITLE,160,8,233,17
GROUPBOX "",IDC_STATIC,4,0,392,183
- CONTROL 116,IDC_BITMAP_WIZARD,"Static",SS_BITMAP | SS_SUNKEN,10,9,137,169
+ CONTROL IDB_WIZARD,IDC_BITMAP_WIZARD,"Static",SS_BITMAP | SS_SUNKEN,10,9,137,169
LTEXT "",IDC_POS_BOX,160,24,231,152
END
@@ -106,8 +104,6 @@
LTEXT "",IDC_BOX_HELP,7,40,205,40
GROUPBOX "Encryption Algorithm",IDT_ENCRYPTION_ALGO,0,10,217,95
GROUPBOX "Hash Algorithm",IDT_HASH_ALGO,0,109,217,35
- LTEXT "More information",IDC_LINK_MORE_INFO_ABOUT_CIPHER,7,82,135,10,SS_NOTIFY
- LTEXT "Information on hash algorithms",IDC_LINK_HASH_INFO,97,124,115,8,SS_NOTIFY
END
IDD_PASSWORD_PAGE_DLG DIALOGEX 0, 0, 226, 152
@@ -182,12 +178,10 @@
BEGIN
CONTROL "Create an encrypted file container",IDC_FILE_CONTAINER,
"Button",BS_AUTORADIOBUTTON,0,7,217,10
- LTEXT "More information",IDC_MORE_INFO_ON_CONTAINERS,16,39,165,10,SS_NOTIFY
CONTROL "Encrypt a non-system partition/drive",IDC_NONSYS_DEVICE,
"Button",BS_AUTORADIOBUTTON,0,53,217,10
CONTROL "Encrypt the system partition or entire system drive",IDC_SYS_DEVICE,
"Button",BS_AUTORADIOBUTTON,0,87,217,10
- LTEXT "More information about system encryption",IDC_MORE_INFO_ON_SYS_ENCRYPTION,16,136,190,10,SS_NOTIFY
LTEXT "Creates a virtual encrypted disk within a file. Recommended for inexperienced users.",IDT_FILE_CONTAINER,16,20,205,16
LTEXT "Encrypts a non-system partition on any internal or external drive (e.g. a flash drive). Optionally, creates a hidden volume.",IDT_NON_SYS_DEVICE,16,66,205,16
LTEXT "Encrypts the partition/drive where Windows is installed. Anyone who wants to gain access and use the system, read and write files, etc., will need to enter the correct password each time before Windows boots. Optionally, creates a hidden system.",IDT_SYS_DEVICE,16,100,205,33
@@ -236,7 +230,6 @@
BEGIN
CONTROL "Standard TrueCrypt volume",IDC_STD_VOL,"Button",BS_AUTORADIOBUTTON,0,7,212,10
CONTROL "Hi&dden TrueCrypt volume ",IDC_HIDDEN_VOL,"Button",BS_AUTORADIOBUTTON,0,53,212,10
- LTEXT "More information about hidden volumes",IDC_HIDDEN_VOL_HELP,16,125,205,10,SS_NOTIFY
LTEXT "",IDC_BOX_HELP_NORMAL_VOL,16,20,205,25
LTEXT "",IDC_BOX_HELP,16,66,205,57
END
@@ -304,7 +297,6 @@
BEGIN
COMBOBOX IDC_WIPE_MODE,67,13,125,90,CBS_DROPDOWNLIST | WS_TABSTOP
PUSHBUTTON "&Pause",IDC_PAUSE,169,40,50,14
- LTEXT "More information",IDC_MORE_INFO_SYS_ENCRYPTION,1,141,202,10,SS_NOTIFY
LTEXT "",IDC_BYTESWRITTEN,29,58,39,11,SS_CENTERIMAGE,WS_EX_TRANSPARENT | WS_EX_RIGHT | WS_EX_STATICEDGE
RTEXT "",IDC_WRITESPEED,103,58,46,11,SS_CENTERIMAGE,WS_EX_TRANSPARENT | WS_EX_RIGHT | WS_EX_STATICEDGE
RTEXT "",IDC_TIMEREMAIN,177,58,42,11,SS_CENTERIMAGE,WS_EX_TRANSPARENT | WS_EX_RIGHT | WS_EX_STATICEDGE
@@ -356,7 +348,6 @@
BEGIN
CONTROL "Normal",IDC_SYSENC_NORMAL,"Button",BS_AUTORADIOBUTTON,0,7,212,10
CONTROL "Hi&dden",IDC_SYSENC_HIDDEN,"Button",BS_AUTORADIOBUTTON,0,53,212,10
- LTEXT "More information",IDC_HIDDEN_SYSENC_INFO_LINK,16,138,205,10,SS_NOTIFY
LTEXT "",IDC_BOX_HELP_SYSENC_NORMAL,16,20,205,25
LTEXT "",IDC_BOX_HELP,16,66,205,72
END
@@ -365,7 +356,6 @@
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
- LTEXT "More information",IDC_HIDDEN_SYSENC_INFO_LINK,0,141,217,10,SS_NOTIFY
LTEXT "",IDC_BOX_HELP,0,2,225,136
END
@@ -417,6 +407,15 @@
LISTBOX IDC_LIST_BOX,0,3,222,100,LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_VSCROLL
END
+IDD_DRIVE_LETTER_SELECTION_PAGE DIALOGEX 0, 0, 226, 152
+STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
+FONT 8, "MS Shell Dlg", 400, 0, 0x1
+BEGIN
+ LTEXT "",IDC_BOX_HELP,0,40,225,95
+ COMBOBOX IDC_DRIVE_LETTER_LIST,94,15,38,69,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+ RTEXT "Drive letter:",IDT_DRIVE_LETTER,5,17,86,8
+END
+
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
@@ -660,6 +659,14 @@
TOPMARGIN, 7
BOTTOMMARGIN, 145
END
+
+ IDD_DRIVE_LETTER_SELECTION_PAGE, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 219
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 145
+ END
END
#endif // APSTUDIO_INVOKED
@@ -681,7 +688,7 @@
IDS_UACSTRING_FMT "TrueCrypt"
END
-#endif // English (U.S.) resources
+#endif // English (United States) resources
/////////////////////////////////////////////////////////////////////////////
diff --recursive -bu truecrypt-7.1a-source/Format/InPlace.c truecrypt-7.2-source/Format/InPlace.c
--- truecrypt-7.1a-source/Format/InPlace.c 2012-02-07 11:36:48.000000000 +0100
+++ truecrypt-7.2-source/Format/InPlace.c 2014-05-27 18:36:03.000000000 +0200
@@ -9,7 +9,7 @@
/* In this file, _WIN32_WINNT is defined as 0x0600 to make filesystem shrink available (Vista
or later). _WIN32_WINNT cannot be defined as 0x0600 for the entire user-space projects
-because it breaks the main font app when the app is running on XP (likely an MS bug).
+because it breaks the main font app when the app is running on XP.
IMPORTANT: Due to this issue, functions in this file must not directly interact with GUI. */
#define TC_LOCAL_WIN32_WINNT_OVERRIDE 1
#if (_WIN32_WINNT < 0x0600)
@@ -37,9 +37,21 @@
using namespace std;
using namespace TrueCrypt;
+#if TC_VOLUME_DATA_OFFSET != 131072
+# error TC_VOLUME_DATA_OFFSET != 131072
+#endif
+
+#if TC_VOLUME_HEADER_EFFECTIVE_SIZE != 512
+# error TC_VOLUME_HEADER_EFFECTIVE_SIZE != 512
+#endif
+
+#if TC_TOTAL_VOLUME_HEADERS_SIZE != 262144
+# error TC_TOTAL_VOLUME_HEADERS_SIZE != 262144
+#endif
+
#define TC_MAX_NONSYS_INPLACE_ENC_WORK_CHUNK_SIZE (2048 * BYTES_PER_KB)
-#define TC_INITIAL_NTFS_CONCEAL_PORTION_SIZE (2 * TC_MAX_VOLUME_SECTOR_SIZE)
-#define TC_NTFS_CONCEAL_CONSTANT 0xFF
+#define TC_TRANSFORM_FS_CONCEAL_PORTION_SIZE (2 * TC_MAX_VOLUME_SECTOR_SIZE)
+#define TC_TRANSFORM_FS_CONCEAL_CONSTANT 0xFF
#define TC_NONSYS_INPLACE_ENC_HEADER_UPDATE_INTERVAL (64 * BYTES_PER_MB)
#define TC_NONSYS_INPLACE_ENC_MIN_VOL_SIZE (TC_TOTAL_VOLUME_HEADERS_SIZE + TC_MIN_NTFS_FS_SIZE * 2)
@@ -299,339 +311,52 @@
}
-int EncryptPartitionInPlaceBegin (volatile FORMAT_VOL_PARAMETERS *volParams, volatile HANDLE *outHandle, WipeAlgorithmId wipeAlgorithm)
+BOOL CheckRequirementsForNonSysInPlaceDec (const char *devicePath, BOOL silent)
{
- SHRINK_VOLUME_INFORMATION shrinkVolInfo;
- signed __int64 sizeToShrinkTo;
- int nStatus = ERR_SUCCESS;
- PCRYPTO_INFO cryptoInfo = NULL;
- PCRYPTO_INFO cryptoInfo2 = NULL;
- HANDLE dev = INVALID_HANDLE_VALUE;
- DWORD dwError;
- char *header;
- char dosDev[TC_MAX_PATH] = {0};
- char devName[MAX_PATH] = {0};
- int driveLetter = -1;
- WCHAR deviceName[MAX_PATH];
- uint64 dataAreaSize;
- __int64 deviceSize;
- LARGE_INTEGER offset;
- DWORD dwResult;
-
- SetNonSysInplaceEncUIStatus (NONSYS_INPLACE_ENC_STATUS_PREPARING);
-
-
- if (!CheckRequirementsForNonSysInPlaceEnc (volParams->volumePath, FALSE))
- return ERR_DONT_REPORT;
-
-
- header = (char *) TCalloc (TC_VOLUME_HEADER_EFFECTIVE_SIZE);
- if (!header)
- return ERR_OUTOFMEMORY;
-
- VirtualLock (header, TC_VOLUME_HEADER_EFFECTIVE_SIZE);
-
- deviceSize = GetDeviceSize (volParams->volumePath);
- if (deviceSize < 0)
- {
- // Cannot determine the size of the partition
- nStatus = ERR_PARAMETER_INCORRECT;
- goto closing_seq;
- }
-
- if (deviceSize < TC_NONSYS_INPLACE_ENC_MIN_VOL_SIZE)
- {
- ShowInPlaceEncErrMsgWAltSteps ("PARTITION_TOO_SMALL_FOR_NONSYS_INPLACE_ENC", TRUE);
- nStatus = ERR_DONT_REPORT;
- goto closing_seq;
- }
-
- dataAreaSize = GetVolumeDataAreaSize (volParams->hiddenVol, deviceSize);
-
- strcpy ((char *)deviceName, volParams->volumePath);
- ToUNICODE ((char *)deviceName);
-
- driveLetter = GetDiskDeviceDriveLetter (deviceName);
-
-
- if (FakeDosNameForDevice (volParams->volumePath, dosDev, devName, FALSE) != 0)
- {
- nStatus = ERR_OS_ERROR;
- goto closing_seq;
- }
-
- if (IsDeviceMounted (devName))
- {
- dev = OpenPartitionVolume (devName,
- FALSE, // Do not require exclusive access (must be FALSE; otherwise, it will not be possible to dismount the volume or obtain its properties and FSCTL_ALLOW_EXTENDED_DASD_IO will fail too)
- TRUE, // Require shared access (must be TRUE; otherwise, it will not be possible to dismount the volume or obtain its properties and FSCTL_ALLOW_EXTENDED_DASD_IO will fail too)
- FALSE, // Do not ask the user to confirm shared access (if exclusive fails)
- FALSE, // Do not append alternative instructions how to encrypt the data (to applicable error messages)
- FALSE); // Non-silent mode
-
- if (dev == INVALID_HANDLE_VALUE)
- {
- nStatus = ERR_DONT_REPORT;
- goto closing_seq;
- }
- }
- else
- {
- // The volume is not mounted so we can't work with the filesystem.
- Error ("ONLY_MOUNTED_VOL_SUPPORTED_FOR_NONSYS_INPLACE_ENC");
- nStatus = ERR_DONT_REPORT;
- goto closing_seq;
- }
-
-
- /* Gain "raw" access to the partition (the NTFS driver guards hidden sectors). */
-
- if (!DeviceIoControl (dev,
- FSCTL_ALLOW_EXTENDED_DASD_IO,
- NULL,
- 0,
- NULL,
- 0,
- &dwResult,
- NULL))
- {
- handleWin32Error (MainDlg);
- ShowInPlaceEncErrMsgWAltSteps ("INPLACE_ENC_CANT_ACCESS_OR_GET_INFO_ON_VOL_ALT", TRUE);
- nStatus = ERR_DONT_REPORT;
- goto closing_seq;
- }
-
-
-
- /* Shrink the filesystem */
-
- int64 totalClusterCount;
- DWORD bytesPerCluster;
-
- sizeToShrinkTo = NewFileSysSizeAfterShrink (dev, volParams->volumePath, &totalClusterCount, &bytesPerCluster, FALSE);
-
- if (sizeToShrinkTo == -1)
- {
- ShowInPlaceEncErrMsgWAltSteps ("INPLACE_ENC_CANT_ACCESS_OR_GET_INFO_ON_VOL_ALT", TRUE);
- nStatus = ERR_DONT_REPORT;
- goto closing_seq;
- }
-
- SetNonSysInplaceEncUIStatus (NONSYS_INPLACE_ENC_STATUS_RESIZING);
-
- memset (&shrinkVolInfo, 0, sizeof (shrinkVolInfo));
-
- shrinkVolInfo.ShrinkRequestType = ShrinkPrepare;
- shrinkVolInfo.NewNumberOfSectors = sizeToShrinkTo;
-
- if (!DeviceIoControl (dev,
- FSCTL_SHRINK_VOLUME,
- (LPVOID) &shrinkVolInfo,
- sizeof (shrinkVolInfo),
- NULL,
- 0,
- &dwResult,
- NULL))
- {
- handleWin32Error (MainDlg);
- ShowInPlaceEncErrMsgWAltSteps ("CANNOT_RESIZE_FILESYS", TRUE);
- nStatus = ERR_DONT_REPORT;
- goto closing_seq;
- }
-
- BOOL clustersMovedBeforeVolumeEnd = FALSE;
-
- while (true)
- {
- shrinkVolInfo.ShrinkRequestType = ShrinkCommit;
- shrinkVolInfo.NewNumberOfSectors = 0;
-
- if (!DeviceIoControl (dev, FSCTL_SHRINK_VOLUME, &shrinkVolInfo, sizeof (shrinkVolInfo), NULL, 0, &dwResult, NULL))
- {
- // If there are any occupied clusters beyond the new desired end of the volume, the call fails with
- // ERROR_ACCESS_DENIED (STATUS_ALREADY_COMMITTED).
- if (GetLastError () == ERROR_ACCESS_DENIED)
- {
- if (!clustersMovedBeforeVolumeEnd)
- {
- if (MoveClustersBeforeThreshold (dev, deviceName, totalClusterCount - (bytesPerCluster > TC_TOTAL_VOLUME_HEADERS_SIZE ? 1 : TC_TOTAL_VOLUME_HEADERS_SIZE / bytesPerCluster)))
- {
- clustersMovedBeforeVolumeEnd = TRUE;
- continue;
- }
-
- handleWin32Error (MainDlg);
- }
- }
- else
- handleWin32Error (MainDlg);
-
- ShowInPlaceEncErrMsgWAltSteps ("CANNOT_RESIZE_FILESYS", TRUE);
- nStatus = ERR_DONT_REPORT;
- goto closing_seq;
- }
-
- break;
- }
-
- SetNonSysInplaceEncUIStatus (NONSYS_INPLACE_ENC_STATUS_PREPARING);
-
-
- /* Gain exclusive access to the volume */
-
- nStatus = DismountFileSystem (dev,
- driveLetter,
- TRUE,
- TRUE,
- FALSE);
-
- if (nStatus != ERR_SUCCESS)
- {
- nStatus = ERR_DONT_REPORT;
- goto closing_seq;
- }
-
-
+ int partitionNumber = -1, driveNumber = -1;
- /* Create header backup on the partition. Until the volume is fully encrypted, the backup header will provide
- us with the master key, encrypted range, and other data for pause/resume operations. We cannot create the
- primary header until the entire partition is encrypted (because we encrypt backwards and the primary header
- area is occuppied by data until the very end of the process). */
-
- // Prepare the backup header
- for (int wipePass = 0; wipePass < (wipeAlgorithm == TC_WIPE_NONE ? 1 : PRAND_DISK_WIPE_PASSES); wipePass++)
- {
- nStatus = CreateVolumeHeaderInMemory (FALSE,
- header,
- volParams->ea,
- FIRST_MODE_OF_OPERATION_ID,
- volParams->password,
- volParams->pkcs5,
- wipePass == 0 ? NULL : (char *) cryptoInfo->master_keydata,
- &cryptoInfo,
- dataAreaSize,
- 0,
- TC_VOLUME_DATA_OFFSET + dataAreaSize, // Start of the encrypted area = the first byte of the backup heeader (encrypting from the end)
- 0, // No data is encrypted yet
- 0,
- volParams->headerFlags | TC_HEADER_FLAG_NONSYS_INPLACE_ENC,
- volParams->sectorSize,
- wipeAlgorithm == TC_WIPE_NONE ? FALSE : (wipePass < PRAND_DISK_WIPE_PASSES - 1));
- if (nStatus != 0)
- goto closing_seq;
+ /* ---------- Checks that do not require admin rights ----------- */
- offset.QuadPart = TC_VOLUME_DATA_OFFSET + dataAreaSize;
- if (!SetFilePointerEx (dev, offset, NULL, FILE_BEGIN))
- {
- nStatus = ERR_OS_ERROR;
- goto closing_seq;
- }
+ /* Volume type (must be a partition or a dynamic volume) */
- // Write the backup header to the partition
- if (!WriteEffectiveVolumeHeader (TRUE, dev, (byte *) header))
+ if ((sscanf (devicePath, "\\Device\\HarddiskVolume%d", &partitionNumber) != 1
+ && sscanf (devicePath, "\\Device\\Harddisk%d\\Partition%d", &driveNumber, &partitionNumber) != 2)
+ || partitionNumber == 0)
{
- nStatus = ERR_OS_ERROR;
- goto closing_seq;
- }
-
- // Fill the reserved sectors of the backup header area with random data
- nStatus = WriteRandomDataToReservedHeaderAreas (dev, cryptoInfo, dataAreaSize, FALSE, TRUE);
+ if (!silent)
+ Error ("INPLACE_ENC_INVALID_PATH");
- if (nStatus != ERR_SUCCESS)
- goto closing_seq;
+ return FALSE;
}
- /* Now we will try to decrypt the backup header to verify it has been correctly written. */
-
- nStatus = OpenBackupHeader (dev, volParams->volumePath, volParams->password, &cryptoInfo2, NULL, deviceSize);
+ /* Admin rights */
- if (nStatus != ERR_SUCCESS
- || cryptoInfo->EncryptedAreaStart.Value != cryptoInfo2->EncryptedAreaStart.Value
- || cryptoInfo2->EncryptedAreaStart.Value == 0)
+ if (!IsAdmin())
{
- if (nStatus == ERR_SUCCESS)
- nStatus = ERR_PARAMETER_INCORRECT;
+ // We rely on the wizard process to call us only when the whole wizard process has been elevated (so UAC
+ // status can be ignored). In case the IsAdmin() detection somehow fails, we allow the user to continue.
- goto closing_seq;
+ if (!silent)
+ Warning ("ADMIN_PRIVILEGES_WARN_DEVICES");
}
- // The backup header is valid so we know we should be able to safely resume in-place encryption
- // of this partition even if the system/app crashes.
-
-
-
- /* Conceal the NTFS filesystem (by performing an easy-to-undo modification). This will prevent Windows
- and apps from interfering with the volume until it has been fully encrypted. */
-
- nStatus = ConcealNTFS (dev);
-
- if (nStatus != ERR_SUCCESS)
- goto closing_seq;
-
-
-
- // /* If a drive letter is assigned to the device, remove it (so that users do not try to open it, which
- //would cause Windows to ask them if they want to format the volume and other dangerous things). */
-
- //if (driveLetter >= 0)
- //{
- // char rootPath[] = { driveLetter + 'A', ':', '\\', 0 };
-
- // // Try to remove the assigned drive letter
- // if (DeleteVolumeMountPoint (rootPath))
- // driveLetter = -1;
- //}
-
-
- /* Update config files and app data */
-
- // In the config file, increase the number of partitions where in-place encryption is in progress
-
- SaveNonSysInPlaceEncSettings (1, wipeAlgorithm);
-
-
- // Add the wizard to the system startup sequence if appropriate
-
- if (!IsNonInstallMode ())
- ManageStartupSeqWiz (FALSE, "/prinplace");
-
-
- nStatus = ERR_SUCCESS;
-
-
-closing_seq:
-
- dwError = GetLastError();
-
- if (cryptoInfo != NULL)
- {
- crypto_close (cryptoInfo);
- cryptoInfo = NULL;
- }
-
- if (cryptoInfo2 != NULL)
- {
- crypto_close (cryptoInfo2);
- cryptoInfo2 = NULL;
- }
+ /* ---------- Checks that may require admin rights ----------- */
- burn (header, TC_VOLUME_HEADER_EFFECTIVE_SIZE);
- VirtualUnlock (header, TC_VOLUME_HEADER_EFFECTIVE_SIZE);
- TCfree (header);
+ // [Currently none]
- if (dosDev[0])
- RemoveFakeDosName (volParams->volumePath, dosDev);
- *outHandle = dev;
+ return TRUE;
+}
- if (nStatus != ERR_SUCCESS)
- SetLastError (dwError);
- return nStatus;
+int EncryptPartitionInPlaceBegin (volatile FORMAT_VOL_PARAMETERS *volParams, volatile HANDLE *outHandle, WipeAlgorithmId wipeAlgorithm)
+{
+ AbortProcess ("INSECURE_APP");
+ return 0;
}
@@ -640,18 +365,24 @@
WipeAlgorithmId wipeAlgorithm,
volatile BOOL *bTryToCorrectReadErrors)
{
- PCRYPTO_INFO masterCryptoInfo = NULL, headerCryptoInfo = NULL, tmpCryptoInfo = NULL;
+ AbortProcess ("INSECURE_APP");
+ return 0;
+}
+
+
+int DecryptPartitionInPlace (volatile FORMAT_VOL_PARAMETERS *volParams, volatile BOOL *DiscardUnreadableEncryptedSectors)
+{
+ HANDLE dev = INVALID_HANDLE_VALUE;
+ PCRYPTO_INFO masterCryptoInfo = NULL, headerCryptoInfo = NULL;
UINT64_STRUCT unitNo;
- char *buf = NULL, *header = NULL;
- byte *wipeBuffer = NULL;
- byte wipeRandChars [TC_WIPE_RAND_CHAR_COUNT];
- byte wipeRandCharsUpdate [TC_WIPE_RAND_CHAR_COUNT];
+ char *buf = NULL;
+ byte *tmpSectorBuf = NULL;
char dosDev[TC_MAX_PATH] = {0};
char devName[MAX_PATH] = {0};
WCHAR deviceName[MAX_PATH];
int nStatus = ERR_SUCCESS;
__int64 deviceSize;
- uint64 remainingBytes, lastHeaderUpdateDistance = 0, zeroedSectorCount = 0;
+ uint64 remainingBytes, workChunkStartByteOffset, lastHeaderUpdateDistance = 0, skippedBadSectorCount = 0;
uint32 workChunkSize;
DWORD dwError, dwResult;
BOOL bPause = FALSE, bEncryptedAreaSizeChanged = FALSE;
@@ -664,8 +395,6 @@
DISK_GEOMETRY driveGeometry;
- bInPlaceEncNonSysResumed = TRUE;
-
buf = (char *) TCalloc (TC_MAX_NONSYS_INPLACE_ENC_WORK_CHUNK_SIZE);
if (!buf)
{
@@ -673,25 +402,6 @@
goto closing_seq;
}
- header = (char *) TCalloc (TC_VOLUME_HEADER_EFFECTIVE_SIZE);
- if (!header)
- {
- nStatus = ERR_OUTOFMEMORY;
- goto closing_seq;
- }
-
- VirtualLock (header, TC_VOLUME_HEADER_EFFECTIVE_SIZE);
-
- if (wipeAlgorithm != TC_WIPE_NONE)
- {
- wipeBuffer = (byte *) TCalloc (TC_MAX_NONSYS_INPLACE_ENC_WORK_CHUNK_SIZE);
- if (!wipeBuffer)
- {
- nStatus = ERR_OUTOFMEMORY;
- goto closing_seq;
- }
- }
-
headerCryptoInfo = crypto_open();
if (headerCryptoInfo == NULL)
@@ -708,8 +418,21 @@
goto closing_seq;
}
- if (dev == INVALID_HANDLE_VALUE)
+
+ // The wizard should have dismounted the TC volume if it was mounted, but for extra safety we will check this again.
+ if (IsMountedVolume (devicePath))
{
+ int driveLetter = GetMountedVolumeDriveNo (devicePath);
+
+ if (driveLetter == -1
+ || !UnmountVolume (MainDlg, driveLetter, TRUE))
+ {
+ handleWin32Error (MainDlg);
+ AbortProcess ("CANT_DISMOUNT_VOLUME");
+ }
+ }
+
+
strcpy ((char *)deviceName, devicePath);
ToUNICODE ((char *)deviceName);
@@ -720,7 +443,7 @@
}
dev = OpenPartitionVolume (devName,
- FALSE, // Do not require exclusive access
+ TRUE, // Require exclusive access
FALSE, // Do not require shared access
TRUE, // Ask the user to confirm shared access (if exclusive fails)
FALSE, // Do not append alternative instructions how to encrypt the data (to applicable error messages)
@@ -731,7 +454,8 @@
nStatus = ERR_DONT_REPORT;
goto closing_seq;
}
- }
+
+
// This should never be needed, but is still performed for extra safety (without checking the result)
DeviceIoControl (dev,
@@ -753,26 +477,91 @@
sectorSize = driveGeometry.BytesPerSector;
+ tmpSectorBuf = (byte *) TCalloc (sectorSize);
+ if (!tmpSectorBuf)
+ {
+ nStatus = ERR_OUTOFMEMORY;
+ goto closing_seq;
+ }
+
+
nStatus = OpenBackupHeader (dev, devicePath, password, &masterCryptoInfo, headerCryptoInfo, deviceSize);
if (nStatus != ERR_SUCCESS)
goto closing_seq;
+ if (masterCryptoInfo->LegacyVolume)
+ {
+ Error ("NONSYS_INPLACE_DECRYPTION_BAD_VOL_FORMAT");
+ nStatus = ERR_DONT_REPORT;
+ goto closing_seq;
+ }
+
+ if (masterCryptoInfo->hiddenVolume)
+ {
+ Error ("NONSYS_INPLACE_DECRYPTION_CANT_DECRYPT_HID_VOL");
+ nStatus = ERR_DONT_REPORT;
+ goto closing_seq;
+ }
- remainingBytes = masterCryptoInfo->VolumeSize.Value - masterCryptoInfo->EncryptedAreaLength.Value;
+ if (!bInPlaceEncNonSysResumed
+ && masterCryptoInfo->VolumeSize.Value == masterCryptoInfo->EncryptedAreaLength.Value)
+ {
+ /* Decryption started (not resumed) */
+
+ if ((masterCryptoInfo->HeaderFlags & TC_HEADER_FLAG_NONSYS_INPLACE_ENC) == 0)
+ {
+ // The volume has not been encrypted in-place so it may contain a hidden volume.
+ // Ask the user to confirm it does not.
+
+ char *tmpStr[] = {0,
+ "CONFIRM_VOL_CONTAINS_NO_HIDDEN_VOL",
+ "VOL_CONTAINS_NO_HIDDEN_VOL",
+ "VOL_CONTAINS_A_HIDDEN_VOL",
+ 0};
+
+ switch (AskMultiChoice ((void **) tmpStr, FALSE))
+ {
+ case 1:
+ // NOP
+ break;
+ case 2:
+ default:
+ // Cancel
+ nStatus = ERR_DONT_REPORT;
+ goto closing_seq;
+ }
+ }
+
+ // Update config files and app data
+
+ // In the config file, increase the number of partitions where in-place decryption is in progress
+ SaveNonSysInPlaceEncSettings (1, TC_WIPE_NONE, TRUE);
+
+ // Add the wizard to the system startup sequence if appropriate
+ if (!IsNonInstallMode ())
+ ManageStartupSeqWiz (FALSE, "/prinplace");
+ }
+
+
+
+ bInPlaceEncNonSysResumed = TRUE;
+ bFirstNonSysInPlaceEncResumeDone = TRUE;
+
+
+ remainingBytes = masterCryptoInfo->EncryptedAreaLength.Value;
lastHeaderUpdateDistance = 0;
ExportProgressStats (masterCryptoInfo->EncryptedAreaLength.Value, masterCryptoInfo->VolumeSize.Value);
- SetNonSysInplaceEncUIStatus (NONSYS_INPLACE_ENC_STATUS_ENCRYPTING);
+ SetNonSysInplaceEncUIStatus (NONSYS_INPLACE_ENC_STATUS_DECRYPTING);
- bFirstNonSysInPlaceEncResumeDone = TRUE;
- /* The in-place encryption core */
+ /* The in-place decryption core */
while (remainingBytes > 0)
{
@@ -784,14 +573,14 @@
goto closing_seq;
}
- unitNo.Value = (remainingBytes - workChunkSize + TC_VOLUME_DATA_OFFSET) / ENCRYPTION_DATA_UNIT_SIZE;
+ workChunkStartByteOffset = masterCryptoInfo->EncryptedAreaStart.Value;
+ unitNo.Value = workChunkStartByteOffset / ENCRYPTION_DATA_UNIT_SIZE;
- // Read the plaintext into RAM
-inplace_enc_read:
+ // Read the ciphertext into RAM
- offset.QuadPart = masterCryptoInfo->EncryptedAreaStart.Value - workChunkSize - TC_VOLUME_DATA_OFFSET;
+ offset.QuadPart = workChunkStartByteOffset;
if (SetFilePointerEx (dev, offset, NULL, FILE_BEGIN) == 0)
{
@@ -809,99 +598,85 @@
{
// Physical defect or data corruption
- if (!*bTryToCorrectReadErrors)
+ if (!*DiscardUnreadableEncryptedSectors)
{
- *bTryToCorrectReadErrors = (AskWarnYesNo ("ENABLE_BAD_SECTOR_ZEROING") == IDYES);
+ *DiscardUnreadableEncryptedSectors = (AskWarnYesNo ("DISCARD_UNREADABLE_ENCRYPTED_SECTORS") == IDYES);
}
- if (*bTryToCorrectReadErrors)
+ if (*DiscardUnreadableEncryptedSectors)
{
- // Try to correct the read errors physically
+ // Read the work chunk again, but this time each sector individually and skiping each bad sector
- offset.QuadPart = masterCryptoInfo->EncryptedAreaStart.Value - workChunkSize - TC_VOLUME_DATA_OFFSET;
+ LARGE_INTEGER tmpSectorOffset;
+ uint64 tmpSectorCount;
+ uint64 tmpBufOffset = 0;
+ DWORD tmpNbrReadBytes = 0;
- nStatus = ZeroUnreadableSectors (dev, offset, workChunkSize, sectorSize, &zeroedSectorCount);
+ tmpSectorOffset.QuadPart = offset.QuadPart;
- if (nStatus != ERR_SUCCESS)
+ for (tmpSectorCount = workChunkSize / sectorSize; tmpSectorCount > 0; --tmpSectorCount)
+ {
+ if (SetFilePointerEx (dev, tmpSectorOffset, NULL, FILE_BEGIN) == 0)
{
- // Due to write errors, we can't correct the read errors
nStatus = ERR_OS_ERROR;
goto closing_seq;
}
- goto inplace_enc_read;
- }
+ if (ReadFile (dev, tmpSectorBuf, sectorSize, &tmpNbrReadBytes, NULL) == 0
+ || tmpNbrReadBytes != (DWORD) sectorSize)
+ {
+ // Read error
+
+ // Clear the buffer so the content of each unreadable sector is replaced with decrypted all-zero blocks (producing pseudorandom data)
+ memset (tmpSectorBuf, 0, sectorSize);
+
+ skippedBadSectorCount++;
}
+ memcpy (buf + tmpBufOffset, tmpSectorBuf, sectorSize);
+
+ tmpSectorOffset.QuadPart += sectorSize;
+ tmpBufOffset += sectorSize;
+ }
+ }
+ else
+ {
SetLastError (dwTmpErr); // Preserve the original error code
nStatus = ERR_OS_ERROR;
goto closing_seq;
}
-
- if (remainingBytes - workChunkSize < TC_INITIAL_NTFS_CONCEAL_PORTION_SIZE)
+ }
+ else
{
- // We reached the inital portion of the filesystem, which we had concealed (in order to prevent
- // Windows from interfering with the volume). Now we need to undo that modification.
+ SetLastError (dwTmpErr); // Preserve the original error code
- for (i = 0; i < TC_INITIAL_NTFS_CONCEAL_PORTION_SIZE - (remainingBytes - workChunkSize); i++)
- buf[i] ^= TC_NTFS_CONCEAL_CONSTANT;
+ nStatus = ERR_OS_ERROR;
+ goto closing_seq;
+ }
}
+ // Decrypt the ciphertext in RAM
- // Encrypt the plaintext in RAM
-
- EncryptDataUnits ((byte *) buf, &unitNo, workChunkSize / ENCRYPTION_DATA_UNIT_SIZE, masterCryptoInfo);
-
-
- // If enabled, wipe the area to which we will write the ciphertext
+ DecryptDataUnits ((byte *) buf, &unitNo, workChunkSize / ENCRYPTION_DATA_UNIT_SIZE, masterCryptoInfo);
- if (wipeAlgorithm != TC_WIPE_NONE)
- {
- byte wipePass;
- offset.QuadPart = masterCryptoInfo->EncryptedAreaStart.Value - workChunkSize;
- for (wipePass = 1; wipePass <= GetWipePassCount (wipeAlgorithm); ++wipePass)
- {
- if (!WipeBuffer (wipeAlgorithm, wipeRandChars, wipePass, wipeBuffer, workChunkSize))
- {
- ULONG i;
- for (i = 0; i < workChunkSize; ++i)
- {
- wipeBuffer[i] = buf[i] + wipePass;
- }
-
- EncryptDataUnits (wipeBuffer, &unitNo, workChunkSize / ENCRYPTION_DATA_UNIT_SIZE, masterCryptoInfo);
- memcpy (wipeRandCharsUpdate, wipeBuffer, sizeof (wipeRandCharsUpdate));
- }
-
- if (SetFilePointerEx (dev, offset, NULL, FILE_BEGIN) == 0
- || WriteFile (dev, wipeBuffer, workChunkSize, &n, NULL) == 0)
- {
- // Write error
- dwError = GetLastError();
+ // Conceal initial portion of the filesystem
- // Undo failed write operation
- if (workChunkSize > TC_VOLUME_DATA_OFFSET && SetFilePointerEx (dev, offset, NULL, FILE_BEGIN))
+ if (workChunkStartByteOffset - TC_VOLUME_DATA_OFFSET < TC_TRANSFORM_FS_CONCEAL_PORTION_SIZE)
{
- DecryptDataUnits ((byte *) buf, &unitNo, workChunkSize / ENCRYPTION_DATA_UNIT_SIZE, masterCryptoInfo);
- WriteFile (dev, buf + TC_VOLUME_DATA_OFFSET, workChunkSize - TC_VOLUME_DATA_OFFSET, &n, NULL);
- }
-
- SetLastError (dwError);
- nStatus = ERR_OS_ERROR;
- goto closing_seq;
- }
- }
+ // We are decrypting the initial TC_TRANSFORM_FS_CONCEAL_PORTION_SIZE bytes of the filesystem. We will
+ // conceal this portion to prevent Windows and applications from interfering with the volume.
- memcpy (wipeRandChars, wipeRandCharsUpdate, sizeof (wipeRandCharsUpdate));
+ for (i = 0; i < min (TC_TRANSFORM_FS_CONCEAL_PORTION_SIZE, workChunkStartByteOffset - TC_VOLUME_DATA_OFFSET + workChunkSize); i++)
+ buf[i] ^= TC_TRANSFORM_FS_CONCEAL_CONSTANT;
}
- // Write the ciphertext
+ // Write the plaintext
- offset.QuadPart = masterCryptoInfo->EncryptedAreaStart.Value - workChunkSize;
+ offset.QuadPart = workChunkStartByteOffset - TC_VOLUME_DATA_OFFSET;
if (SetFilePointerEx (dev, offset, NULL, FILE_BEGIN) == 0)
{
@@ -912,23 +687,13 @@
if (WriteFile (dev, buf, workChunkSize, &n, NULL) == 0)
{
// Write error
- dwError = GetLastError();
-
- // Undo failed write operation
- if (workChunkSize > TC_VOLUME_DATA_OFFSET && SetFilePointerEx (dev, offset, NULL, FILE_BEGIN))
- {
- DecryptDataUnits ((byte *) buf, &unitNo, workChunkSize / ENCRYPTION_DATA_UNIT_SIZE, masterCryptoInfo);
- WriteFile (dev, buf + TC_VOLUME_DATA_OFFSET, workChunkSize - TC_VOLUME_DATA_OFFSET, &n, NULL);
- }
-
- SetLastError (dwError);
nStatus = ERR_OS_ERROR;
goto closing_seq;
}
- masterCryptoInfo->EncryptedAreaStart.Value -= workChunkSize;
- masterCryptoInfo->EncryptedAreaLength.Value += workChunkSize;
+ masterCryptoInfo->EncryptedAreaStart.Value += workChunkSize;
+ masterCryptoInfo->EncryptedAreaLength.Value -= workChunkSize;
remainingBytes -= workChunkSize;
lastHeaderUpdateDistance += workChunkSize;
@@ -940,7 +705,10 @@
nStatus = FastVolumeHeaderUpdate (dev, headerCryptoInfo, masterCryptoInfo, deviceSize);
if (nStatus != ERR_SUCCESS)
+ {
+ // Possible write error
goto closing_seq;
+ }
lastHeaderUpdateDistance = 0;
}
@@ -958,63 +726,71 @@
if (nStatus != ERR_SUCCESS)
+ {
+ // Possible write error
goto closing_seq;
+ }
if (!bPause)
{
- /* The data area has been fully encrypted; create and write the primary volume header */
+ /* Volume has been fully decrypted. */
+
+
+ // Prevent attempts to update volume header during the closing sequence
+ bEncryptedAreaSizeChanged = FALSE;
+
SetNonSysInplaceEncUIStatus (NONSYS_INPLACE_ENC_STATUS_FINALIZING);
- for (int wipePass = 0; wipePass < (wipeAlgorithm == TC_WIPE_NONE ? 1 : PRAND_DISK_WIPE_PASSES); wipePass++)
- {
- nStatus = CreateVolumeHeaderInMemory (FALSE,
- header,
- headerCryptoInfo->ea,
- headerCryptoInfo->mode,
- password,
- masterCryptoInfo->pkcs5,
- (char *) masterCryptoInfo->master_keydata,
- &tmpCryptoInfo,
- masterCryptoInfo->VolumeSize.Value,
- 0,
- masterCryptoInfo->EncryptedAreaStart.Value,
- masterCryptoInfo->EncryptedAreaLength.Value,
- masterCryptoInfo->RequiredProgramVersion,
- masterCryptoInfo->HeaderFlags | TC_HEADER_FLAG_NONSYS_INPLACE_ENC,
- masterCryptoInfo->SectorSize,
- wipeAlgorithm == TC_WIPE_NONE ? FALSE : (wipePass < PRAND_DISK_WIPE_PASSES - 1));
+
+
+ /* Undo concealing of the filesystem */
+
+ nStatus = ConcealNTFS (dev);
if (nStatus != ERR_SUCCESS)
goto closing_seq;
- offset.QuadPart = TC_VOLUME_HEADER_OFFSET;
- if (SetFilePointerEx (dev, offset, NULL, FILE_BEGIN) == 0
- || !WriteEffectiveVolumeHeader (TRUE, dev, (byte *) header))
+ /* Ovewrite the backup header and the remaining ciphertext with all-zero blocks (the primary header was overwritten with the decrypted data). */
+
+ memset (tmpSectorBuf, 0, sectorSize);
+
+ for (offset.QuadPart = masterCryptoInfo->VolumeSize.Value;
+ offset.QuadPart <= deviceSize - sectorSize;
+ offset.QuadPart += sectorSize)
+ {
+ if (SetFilePointerEx (dev, offset, NULL, FILE_BEGIN) == 0)
{
nStatus = ERR_OS_ERROR;
goto closing_seq;
}
- // Fill the reserved sectors of the header area with random data
- nStatus = WriteRandomDataToReservedHeaderAreas (dev, headerCryptoInfo, masterCryptoInfo->VolumeSize.Value, TRUE, FALSE);
+ if (WriteFile (dev, tmpSectorBuf, sectorSize, &n, NULL) == 0)
+ {
+ // Write error
+ dwError = GetLastError();
- if (nStatus != ERR_SUCCESS)
+ SetLastError (dwError);
+ nStatus = ERR_OS_ERROR;
goto closing_seq;
}
+ }
+
- // Update the configuration files
- SaveNonSysInPlaceEncSettings (-1, wipeAlgorithm);
+ /* Update the configuration files */
+
+ SaveNonSysInPlaceEncSettings (-1, TC_WIPE_NONE, TRUE);
SetNonSysInplaceEncUIStatus (NONSYS_INPLACE_ENC_STATUS_FINISHED);
nStatus = ERR_SUCCESS;
+
}
else
{
@@ -1025,6 +801,12 @@
SetNonSysInplaceEncUIStatus (NONSYS_INPLACE_ENC_STATUS_PAUSED);
}
+ if (dev != INVALID_HANDLE_VALUE)
+ {
+ CloseHandle (dev);
+ dev = INVALID_HANDLE_VALUE;
+ }
+
closing_seq:
@@ -1040,6 +822,12 @@
FastVolumeHeaderUpdate (dev, headerCryptoInfo, masterCryptoInfo, deviceSize);
}
+ if (dev != INVALID_HANDLE_VALUE)
+ {
+ CloseHandle (dev);
+ dev = INVALID_HANDLE_VALUE;
+ }
+
if (masterCryptoInfo != NULL)
{
crypto_close (masterCryptoInfo);
@@ -1052,44 +840,31 @@
headerCryptoInfo = NULL;
}
- if (tmpCryptoInfo != NULL)
- {
- crypto_close (tmpCryptoInfo);
- tmpCryptoInfo = NULL;
- }
-
if (dosDev[0])
RemoveFakeDosName (devicePath, dosDev);
- if (dev != INVALID_HANDLE_VALUE)
- {
- CloseHandle (dev);
- dev = INVALID_HANDLE_VALUE;
- }
-
if (buf != NULL)
+ {
TCfree (buf);
+ buf = NULL;
+ }
- if (header != NULL)
+ if (tmpSectorBuf != NULL)
{
- burn (header, TC_VOLUME_HEADER_EFFECTIVE_SIZE);
- VirtualUnlock (header, TC_VOLUME_HEADER_EFFECTIVE_SIZE);
- TCfree (header);
+ TCfree (tmpSectorBuf);
+ tmpSectorBuf = NULL;
}
- if (wipeBuffer != NULL)
- TCfree (wipeBuffer);
-
- if (zeroedSectorCount > 0)
+ if (skippedBadSectorCount > 0)
{
wchar_t msg[30000] = {0};
wchar_t sizeStr[500] = {0};
- GetSizeString (zeroedSectorCount * sectorSize, sizeStr);
+ GetSizeString (skippedBadSectorCount * sectorSize, sizeStr);
wsprintfW (msg,
- GetString ("ZEROED_BAD_SECTOR_COUNT"),
- zeroedSectorCount,
+ GetString ("SKIPPED_BAD_SECTOR_COUNT"),
+ skippedBadSectorCount,
sizeStr);
WarningDirect (msg);
@@ -1144,10 +919,19 @@
mputInt64 (fieldPos, (masterCryptoInfo->EncryptedAreaLength.Value));
+ // We need to ensure the TC_HEADER_FLAG_NONSYS_INPLACE_ENC flag bit is set, because if volumes created by TC-format
+ // were decrypted in place, it would be possible to mount them partially encrypted and it wouldn't be possible
+ // to resume interrupted decryption after the wizard exits.
+ masterCryptoInfo->HeaderFlags |= TC_HEADER_FLAG_NONSYS_INPLACE_ENC;
+ fieldPos = (byte *) header + TC_HEADER_OFFSET_FLAGS;
+ mputLong (fieldPos, (masterCryptoInfo->HeaderFlags));
+
+
headerCrc32 = GetCrc32 (header + TC_HEADER_OFFSET_MAGIC, TC_HEADER_OFFSET_HEADER_CRC - TC_HEADER_OFFSET_MAGIC);
fieldPos = (byte *) header + TC_HEADER_OFFSET_HEADER_CRC;
mputLong (fieldPos, headerCrc32);
+
EncryptBuffer (header + HEADER_ENCRYPTED_DATA_OFFSET, HEADER_ENCRYPTED_DATA_SIZE, headerCryptoInfo);
@@ -1247,75 +1031,13 @@
}
-static int DismountFileSystem (HANDLE dev,
- int driveLetter,
- BOOL bForcedAllowed,
- BOOL bForcedRequiresConfirmation,
- BOOL bSilent)
-{
- int attempt;
- BOOL bResult;
- DWORD dwResult;
-
- CloseVolumeExplorerWindows (MainDlg, driveLetter);
-
- attempt = UNMOUNT_MAX_AUTO_RETRIES * 10;
-
- while (!(bResult = DeviceIoControl (dev, FSCTL_LOCK_VOLUME, NULL, 0, NULL, 0, &dwResult, NULL))
- && attempt > 0)
- {
- Sleep (UNMOUNT_AUTO_RETRY_DELAY);
- attempt--;
- }
-
- if (!bResult)
- {
- if (!bForcedAllowed)
- {
- if (!bSilent)
- ShowInPlaceEncErrMsgWAltSteps ("INPLACE_ENC_CANT_LOCK_OR_DISMOUNT_FILESYS", TRUE);
-
- return ERR_DONT_REPORT;
- }
-
- if (bForcedRequiresConfirmation
- && !bSilent
- && AskWarnYesNo ("VOL_LOCK_FAILED_OFFER_FORCED_DISMOUNT") == IDNO)
- {
- return ERR_DONT_REPORT;
- }
- }
-
- // Dismount the volume
-
- attempt = UNMOUNT_MAX_AUTO_RETRIES * 10;
-
- while (!(bResult = DeviceIoControl (dev, FSCTL_DISMOUNT_VOLUME, NULL, 0, NULL, 0, &dwResult, NULL))
- && attempt > 0)
- {
- Sleep (UNMOUNT_AUTO_RETRY_DELAY);
- attempt--;
- }
-
- if (!bResult)
- {
- if (!bSilent)
- ShowInPlaceEncErrMsgWAltSteps ("INPLACE_ENC_CANT_LOCK_OR_DISMOUNT_FILESYS", TRUE);
-
- return ERR_DONT_REPORT;
- }
-
- return ERR_SUCCESS;
-}
-
-
// Easy-to-undo modification applied to conceal the NTFS filesystem (to prevent Windows and apps from
// interfering with it until the volume has been fully encrypted). Note that this function will precisely
// undo any modifications it made to the filesystem automatically if an error occurs when writing (including
// physical drive defects).
static int ConcealNTFS (HANDLE dev)
{
- char buf [TC_INITIAL_NTFS_CONCEAL_PORTION_SIZE];
+ char buf [TC_TRANSFORM_FS_CONCEAL_PORTION_SIZE];
DWORD nbrBytesProcessed, nbrBytesProcessed2;
int i;
LARGE_INTEGER offset;
@@ -1326,26 +1048,26 @@
if (SetFilePointerEx (dev, offset, NULL, FILE_BEGIN) == 0)
return ERR_OS_ERROR;
- if (ReadFile (dev, buf, TC_INITIAL_NTFS_CONCEAL_PORTION_SIZE, &nbrBytesProcessed, NULL) == 0)
+ if (ReadFile (dev, buf, TC_TRANSFORM_FS_CONCEAL_PORTION_SIZE, &nbrBytesProcessed, NULL) == 0)
return ERR_OS_ERROR;
- for (i = 0; i < TC_INITIAL_NTFS_CONCEAL_PORTION_SIZE; i++)
- buf[i] ^= TC_NTFS_CONCEAL_CONSTANT;
+ for (i = 0; i < TC_TRANSFORM_FS_CONCEAL_PORTION_SIZE; i++)
+ buf[i] ^= TC_TRANSFORM_FS_CONCEAL_CONSTANT;
offset.QuadPart = 0;
if (SetFilePointerEx (dev, offset, NULL, FILE_BEGIN) == 0)
return ERR_OS_ERROR;
- if (WriteFile (dev, buf, TC_INITIAL_NTFS_CONCEAL_PORTION_SIZE, &nbrBytesProcessed, NULL) == 0)
+ if (WriteFile (dev, buf, TC_TRANSFORM_FS_CONCEAL_PORTION_SIZE, &nbrBytesProcessed, NULL) == 0)
{
// One or more of the sectors is/are probably damaged and cause write errors.
// We must undo the modifications we made.
dwError = GetLastError();
- for (i = 0; i < TC_INITIAL_NTFS_CONCEAL_PORTION_SIZE; i++)
- buf[i] ^= TC_NTFS_CONCEAL_CONSTANT;
+ for (i = 0; i < TC_TRANSFORM_FS_CONCEAL_PORTION_SIZE; i++)
+ buf[i] ^= TC_TRANSFORM_FS_CONCEAL_CONSTANT;
offset.QuadPart = 0;
@@ -1354,7 +1076,7 @@
Sleep (1);
}
while (SetFilePointerEx (dev, offset, NULL, FILE_BEGIN) == 0
- || WriteFile (dev, buf, TC_INITIAL_NTFS_CONCEAL_PORTION_SIZE, &nbrBytesProcessed2, NULL) == 0);
+ || WriteFile (dev, buf, TC_TRANSFORM_FS_CONCEAL_PORTION_SIZE, &nbrBytesProcessed2, NULL) == 0);
SetLastError (dwError);
@@ -1394,7 +1116,7 @@
}
-BOOL SaveNonSysInPlaceEncSettings (int delta, WipeAlgorithmId newWipeAlgorithm)
+BOOL SaveNonSysInPlaceEncSettings (int delta, WipeAlgorithmId newWipeAlgorithm, BOOL decrypting)
{
int count;
char str[32];
@@ -1410,7 +1132,8 @@
RemoveNonSysInPlaceEncNotifications();
return TRUE;
}
- else
+
+ if (!decrypting)
{
if (newWipeAlgorithm != TC_WIPE_NONE)
{
@@ -1422,11 +1145,11 @@
{
remove (GetConfigPath (TC_APPD_FILENAME_NONSYS_INPLACE_ENC_WIPE));
}
+ }
sprintf (str, "%d", count);
return SaveBufferToFile (str, GetConfigPath (TC_APPD_FILENAME_NONSYS_INPLACE_ENC), strlen(str), FALSE);
- }
}
diff --recursive -bu truecrypt-7.1a-source/Format/InPlace.h truecrypt-7.2-source/Format/InPlace.h
--- truecrypt-7.1a-source/Format/InPlace.h 2012-02-07 11:36:48.000000000 +0100
+++ truecrypt-7.2-source/Format/InPlace.h 2014-05-27 18:36:03.000000000 +0200
@@ -18,6 +18,7 @@
NONSYS_INPLACE_ENC_STATUS_PREPARING,
NONSYS_INPLACE_ENC_STATUS_RESIZING,
NONSYS_INPLACE_ENC_STATUS_ENCRYPTING,
+ NONSYS_INPLACE_ENC_STATUS_DECRYPTING,
NONSYS_INPLACE_ENC_STATUS_FINALIZING,
NONSYS_INPLACE_ENC_STATUS_PAUSED,
NONSYS_INPLACE_ENC_STATUS_FINISHED,
@@ -25,16 +26,17 @@
};
BOOL CheckRequirementsForNonSysInPlaceEnc (const char *devicePath, BOOL silent);
+BOOL CheckRequirementsForNonSysInPlaceDec (const char *devicePath, BOOL silent);
int EncryptPartitionInPlaceBegin (volatile FORMAT_VOL_PARAMETERS *volParams, volatile HANDLE *outHandle, WipeAlgorithmId wipeAlgorithm);
int EncryptPartitionInPlaceResume (HANDLE dev, volatile FORMAT_VOL_PARAMETERS *volParams, WipeAlgorithmId wipeAlgorithm, volatile BOOL *bTryToCorrectReadErrors);
+int DecryptPartitionInPlace (volatile FORMAT_VOL_PARAMETERS *volParams, volatile BOOL *DiscardUnreadableEncryptedSectors);
void ShowInPlaceEncErrMsgWAltSteps (char *iniStrId, BOOL bErr);
void SetNonSysInplaceEncUIStatus (int nonSysInplaceEncStatus);
int FastVolumeHeaderUpdate (HANDLE dev, CRYPTO_INFO *headerCryptoInfo, CRYPTO_INFO *masterCryptoInfo, __int64 deviceSize);
static HANDLE OpenPartitionVolume (const char *devName, BOOL bExclusiveRequired, BOOL bSharedRequired, BOOL bSharedRequiresConfirmation, BOOL bShowAlternativeSteps, BOOL bSilent);
-static int DismountFileSystem (HANDLE dev, int driveLetter, BOOL bForcedAllowed, BOOL bForcedRequiresConfirmation, BOOL bSilent);
static int ConcealNTFS (HANDLE dev);
-BOOL SaveNonSysInPlaceEncSettings (int delta, WipeAlgorithmId wipeAlgorithm);
+BOOL SaveNonSysInPlaceEncSettings (int delta, WipeAlgorithmId wipeAlgorithm, BOOL decrypting);
static void ExportProgressStats (__int64 bytesDone, __int64 totalSize);
int ZeroUnreadableSectors (HANDLE dev, LARGE_INTEGER startOffset, int64 size, int sectorSize, uint64 *zeroedSectorCount);
static int OpenBackupHeader (HANDLE dev, const char *devicePath, Password *password, PCRYPTO_INFO *retCryptoInfo, CRYPTO_INFO *headerCryptoInfo, __int64 deviceSize);
diff --recursive -bu truecrypt-7.1a-source/Format/Resource.h truecrypt-7.2-source/Format/Resource.h
--- truecrypt-7.1a-source/Format/Resource.h 2012-02-07 11:36:48.000000000 +0100
+++ truecrypt-7.2-source/Format/Resource.h 2014-05-27 18:36:03.000000000 +0200
@@ -34,6 +34,7 @@
#define IDD_DEVICE_WIPE_MODE_PAGE_DLG 129
#define IDD_DEVICE_TRANSFORM_MODE_DLG 130
#define IDD_EXPANDED_LIST_SELECT_PAGE_DLG 131
+#define IDD_DRIVE_LETTER_SELECTION_PAGE 132
#define IDC_BOX_TITLE 1000
#define IDC_RESCUE_DISK_ISO_PATH 1001
#define IDC_COMBO_BOX 1002
@@ -42,110 +43,104 @@
#define IDC_BROWSE 1005
#define IDC_BOX_HELP2 1006
#define IDC_COMBO_BOX_HASH 1007
-#define IDC_COMBO_BOX_HASH_ALGO 1008
-#define IDC_SPACE_LEFT 1009
-#define IDC_VERIFY 1010
-#define IDC_KB 1011
-#define IDC_NO_HISTORY 1012
-#define IDC_MB 1013
-#define IDC_PROGRESS_BAR 1014
-#define IDC_GB 1015
-#define IDC_ABORT_BUTTON 1016
-#define IDC_HEADER_KEY 1017
-#define IDC_LIST_BOX 1018
-#define IDC_DISK_KEY 1019
-#define IDC_RANDOM_BYTES 1020
-#define IDC_CIPHER_TEST 1021
-#define IDC_BENCHMARK 1022
-#define IDC_QUICKFORMAT 1023
-#define IDC_BYTESWRITTEN 1024
-#define IDC_WRITESPEED 1025
-#define IDC_KEY_FILES 1026
-#define IDC_TIMEREMAIN 1027
-#define IDC_CLUSTERSIZE 1028
-#define IDC_FILESYS 1029
-#define IDC_SHOW_KEYS 1030
-#define IDC_STD_VOL 1031
-#define IDC_HIDDEN_VOL 1032
-#define IDC_HIDDEN_VOL_HELP 1033
-#define IDC_OPEN_OUTER_VOLUME 1034
-#define IDC_HIDVOL_WIZ_MODE_FULL 1035
-#define IDC_HIDVOL_WIZ_MODE_DIRECT 1036
-#define IDC_PASSWORD_DIRECT 1037
-#define IDC_SIZEBOX 1038
-#define IDC_SELECT_VOLUME_LOCATION 1039
-#define IDC_NEXT 1040
-#define IDC_PREV 1041
-#define IDT_ENCRYPTION_ALGO 1042
-#define IDT_HASH_ALGO 1043
-#define IDT_FORMAT_OPTIONS 1044
-#define IDT_FILESYSTEM 1045
-#define IDT_CLUSTER 1046
-#define IDT_RANDOM_POOL 1047
-#define IDT_HEADER_KEY 1048
-#define IDT_MASTER_KEY 1049
-#define IDT_DONE 1050
-#define IDT_SPEED 1051
-#define IDT_LEFT 1052
-#define IDT_CONFIRM 1053
-#define IDT_PASSWORD 1054
-#define IDC_SHOW_PASSWORD_SINGLE 1055
-#define IDC_SHOW_PASSWORD 1056
-#define IDC_LINK_MORE_INFO_ABOUT_CIPHER 1057
-#define IDC_LINK_HASH_INFO 1058
-#define IDC_POS_BOX 1059
-#define IDC_BITMAP_WIZARD 1060
-#define IDC_FILE_CONTAINER 1061
-#define IDC_NONSYS_DEVICE 1062
-#define IDC_SYS_DEVICE 1063
-#define IDT_FILE_CONTAINER 1064
-#define IDT_NON_SYS_DEVICE 1065
-#define IDT_SYS_DEVICE 1066
-#define IDC_WHOLE_SYS_DRIVE 1067
-#define IDC_SYS_PARTITION 1068
-#define IDT_WHOLE_SYS_DRIVE 1069
-#define IDT_SYS_PARTITION 1070
-#define IDT_RESCUE_DISK_INFO 1071
-#define IDC_MORE_INFO 1072
-#define IDC_MORE_INFO_ON_SYS_ENCRYPTION 1073
-#define IDT_COLLECTING_RANDOM_DATA_NOTE 1074
-#define IDC_MORE_INFO_ON_CONTAINERS 1075
-#define IDC_SINGLE_BOOT 1076
-#define IDC_MULTI_BOOT 1077
-#define IDT_MULTI_BOOT 1078
-#define IDT_SINGLE_BOOT 1079
-#define IDC_SYS_POOL_CONTENTS 1080
-#define IDT_PARTIAL_POOL_CONTENTS 1081
-#define IDC_DOWNLOAD_CD_BURN_SOFTWARE 1082
-#define IDT_RESCUE_DISK_BURN_INFO 1083
-#define IDT_WIPE_MODE_INFO 1084
-#define IDC_WIPE_MODE 1085
-#define IDC_SELECT 1086
-#define IDT_SYSENC_KEYS_GEN_INFO 1087
-#define IDC_DISPLAY_KEYS 1088
-#define IDC_PAUSE 1089
-#define IDT_WIPE_MODE 1090
-#define IDC_MORE_INFO_SYS_ENCRYPTION 1091
-#define IDC_BOX_HELP_NORMAL_VOL 1092
-#define IDT_STATUS 1093
-#define IDT_PROGRESS 1094
-#define IDT_SYSENC_DRIVE_ANALYSIS_INFO 1095
-#define IDC_SYSENC_NORMAL 1096
-#define IDC_SYSENC_HIDDEN 1097
-#define IDC_BOX_HELP_SYSENC_NORMAL 1098
-#define IDC_HIDDEN_SYSENC_INFO_LINK 1099
-#define IDT_PASS 1100
-#define IDC_DEVICE_TRANSFORM_MODE_FORMAT 1101
-#define IDC_DEVICE_TRANSFORM_MODE_INPLACE 1102
+#define IDC_DRIVE_LETTER_LIST 1008
+#define IDC_COMBO_BOX_HASH_ALGO 1009
+#define IDC_SPACE_LEFT 1010
+#define IDC_VERIFY 1011
+#define IDC_KB 1012
+#define IDC_NO_HISTORY 1013
+#define IDC_MB 1014
+#define IDC_PROGRESS_BAR 1015
+#define IDC_GB 1016
+#define IDC_ABORT_BUTTON 1017
+#define IDC_HEADER_KEY 1018
+#define IDC_LIST_BOX 1019
+#define IDC_DISK_KEY 1020
+#define IDC_RANDOM_BYTES 1021
+#define IDC_CIPHER_TEST 1022
+#define IDC_BENCHMARK 1023
+#define IDC_QUICKFORMAT 1024
+#define IDC_BYTESWRITTEN 1025
+#define IDC_WRITESPEED 1026
+#define IDC_KEY_FILES 1027
+#define IDC_TIMEREMAIN 1028
+#define IDC_CLUSTERSIZE 1029
+#define IDC_FILESYS 1030
+#define IDT_DRIVE_LETTER 1031
+#define IDC_SHOW_KEYS 1032
+#define IDC_STD_VOL 1033
+#define IDC_HIDDEN_VOL 1034
+#define IDC_OPEN_OUTER_VOLUME 1035
+#define IDC_HIDVOL_WIZ_MODE_FULL 1036
+#define IDC_HIDVOL_WIZ_MODE_DIRECT 1037
+#define IDC_PASSWORD_DIRECT 1038
+#define IDC_SIZEBOX 1039
+#define IDC_SELECT_VOLUME_LOCATION 1040
+#define IDC_NEXT 1041
+#define IDC_PREV 1042
+#define IDT_ENCRYPTION_ALGO 1043
+#define IDT_HASH_ALGO 1044
+#define IDT_FORMAT_OPTIONS 1045
+#define IDT_FILESYSTEM 1046
+#define IDT_CLUSTER 1047
+#define IDT_RANDOM_POOL 1048
+#define IDT_HEADER_KEY 1049
+#define IDT_MASTER_KEY 1050
+#define IDT_DONE 1051
+#define IDT_SPEED 1052
+#define IDT_LEFT 1053
+#define IDT_CONFIRM 1054
+#define IDT_PASSWORD 1055
+#define IDC_SHOW_PASSWORD_SINGLE 1056
+#define IDC_SHOW_PASSWORD 1057
+#define IDC_POS_BOX 1058
+#define IDC_BITMAP_WIZARD 1059
+#define IDC_FILE_CONTAINER 1060
+#define IDC_NONSYS_DEVICE 1061
+#define IDC_SYS_DEVICE 1062
+#define IDT_FILE_CONTAINER 1063
+#define IDT_NON_SYS_DEVICE 1064
+#define IDT_SYS_DEVICE 1065
+#define IDC_WHOLE_SYS_DRIVE 1066
+#define IDC_SYS_PARTITION 1067
+#define IDT_WHOLE_SYS_DRIVE 1068
+#define IDT_SYS_PARTITION 1069
+#define IDT_RESCUE_DISK_INFO 1070
+#define IDT_COLLECTING_RANDOM_DATA_NOTE 1071
+#define IDC_SINGLE_BOOT 1072
+#define IDC_MULTI_BOOT 1073
+#define IDT_MULTI_BOOT 1074
+#define IDT_SINGLE_BOOT 1075
+#define IDC_SYS_POOL_CONTENTS 1076
+#define IDT_PARTIAL_POOL_CONTENTS 1077
+#define IDC_DOWNLOAD_CD_BURN_SOFTWARE 1078
+#define IDT_RESCUE_DISK_BURN_INFO 1079
+#define IDT_WIPE_MODE_INFO 1080
+#define IDC_WIPE_MODE 1081
+#define IDC_SELECT 1082
+#define IDT_SYSENC_KEYS_GEN_INFO 1083
+#define IDC_DISPLAY_KEYS 1084
+#define IDC_PAUSE 1085
+#define IDT_WIPE_MODE 1086
+#define IDC_BOX_HELP_NORMAL_VOL 1087
+#define IDT_STATUS 1088
+#define IDT_PROGRESS 1089
+#define IDT_SYSENC_DRIVE_ANALYSIS_INFO 1090
+#define IDC_SYSENC_NORMAL 1091
+#define IDC_SYSENC_HIDDEN 1092
+#define IDC_BOX_HELP_SYSENC_NORMAL 1093
+#define IDT_PASS 1094
+#define IDC_DEVICE_TRANSFORM_MODE_FORMAT 1095
+#define IDC_DEVICE_TRANSFORM_MODE_INPLACE 1096
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NO_MFC 1
-#define _APS_NEXT_RESOURCE_VALUE 132
+#define _APS_NEXT_RESOURCE_VALUE 133
#define _APS_NEXT_COMMAND_VALUE 40001
-#define _APS_NEXT_CONTROL_VALUE 1103
+#define _APS_NEXT_CONTROL_VALUE 1097
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
diff --recursive -bu truecrypt-7.1a-source/Format/Tcformat.c truecrypt-7.2-source/Format/Tcformat.c
--- truecrypt-7.1a-source/Format/Tcformat.c 2012-02-07 11:36:48.000000000 +0100
+++ truecrypt-7.2-source/Format/Tcformat.c 2014-05-27 18:36:03.000000000 +0200
@@ -87,12 +87,13 @@
SYSENC_PRETEST_INFO_PAGE,
SYSENC_PRETEST_RESULT_PAGE,
SYSENC_ENCRYPTION_PAGE,
- NONSYS_INPLACE_ENC_RESUME_PASSWORD_PAGE,
+ NONSYS_INPLACE_ENC_PASSWORD_PAGE,
NONSYS_INPLACE_ENC_RESUME_PARTITION_SEL_PAGE,
NONSYS_INPLACE_ENC_RAND_DATA_PAGE,
NONSYS_INPLACE_ENC_WIPE_MODE_PAGE,
- NONSYS_INPLACE_ENC_ENCRYPTION_PAGE,
- NONSYS_INPLACE_ENC_ENCRYPTION_FINISHED_PAGE,
+ NONSYS_INPLACE_ENC_TRANSFORM_PAGE,
+ NONSYS_INPLACE_ENC_TRANSFORM_FINISHED_PAGE,
+ NONSYS_INPLACE_DEC_TRANSFORM_FINISHED_DRIVE_LETTER_PAGE,
FORMAT_PAGE,
FORMAT_FINISHED_PAGE,
SYSENC_HIDDEN_OS_INITIAL_INFO_PAGE,
@@ -145,10 +146,13 @@
BOOL bDirectSysEncMode = FALSE;
BOOL bDirectSysEncModeCommand = SYSENC_COMMAND_NONE;
BOOL DirectDeviceEncMode = FALSE;
+BOOL DirectNonSysInplaceDecStartMode = FALSE;
BOOL DirectNonSysInplaceEncResumeMode = FALSE;
+BOOL DirectNonSysInplaceDecResumeMode = FALSE;
BOOL DirectPromptNonSysInplaceEncResumeMode = FALSE;
-volatile BOOL bInPlaceEncNonSys = FALSE; /* If TRUE, existing data on a non-system partition/volume are to be encrypted (for system encryption, this flag is ignored) */
-volatile BOOL bInPlaceEncNonSysResumed = FALSE; /* If TRUE, the wizard is supposed to resume (or has resumed) process of non-system in-place encryption. */
+volatile BOOL bInPlaceEncNonSys = FALSE; /* If TRUE, existing data on a non-system partition/volume are to be encrypted (or decrypted if bInPlaceDecNonSys is TRUE) in place (for system encryption, this flag is ignored) */
+volatile BOOL bInPlaceDecNonSys = FALSE; /* If TRUE, existing data on a non-system partition/volume are to be decrypted in place (for system encryption, this flag is ignored) */
+volatile BOOL bInPlaceEncNonSysResumed = FALSE; /* If TRUE, the wizard is supposed to resume (or has resumed) process of non-system in-place encryption/decryption. */
volatile BOOL bFirstNonSysInPlaceEncResumeDone = FALSE;
__int64 NonSysInplaceEncBytesDone = 0;
__int64 NonSysInplaceEncTotalSize = 0;
@@ -566,7 +570,10 @@
}
if (newWizardMode != WIZARD_MODE_NONSYS_DEVICE)
+ {
bInPlaceEncNonSys = FALSE;
+ bInPlaceDecNonSys = FALSE;
+ }
if (newWizardMode == WIZARD_MODE_NONSYS_DEVICE && !IsAdmin() && IsUacSupported())
{
@@ -574,11 +581,16 @@
return FALSE;
}
+ {
// The contents of the following items may be inappropriate after a change of mode
+
+ if (! (bInPlaceDecNonSys && !bInPlaceEncNonSysResumed)) // If we are starting (but not resuming) decryption of non-system volume, we actually need szFileName as it contains the command line param.
szFileName[0] = 0;
+
szDiskFile[0] = 0;
nUIVolumeSize = 0;
nVolumeSize = 0;
+ }
WizardMode = newWizardMode;
}
@@ -976,6 +988,7 @@
bHiddenVolDirect = FALSE;
bWholeSysDrive = FALSE;
bInPlaceEncNonSys = FALSE;
+ bInPlaceDecNonSys = FALSE;
if (bDirectSysEncModeCommand == SYSENC_COMMAND_CREATE_HIDDEN_OS_ELEV)
{
@@ -1011,11 +1024,11 @@
return TRUE;
}
-void SwitchWizardToNonSysInplaceEncResumeMode (void)
+void SwitchWizardToNonSysInplaceEncResumeMode (BOOL decrypt)
{
if (!IsAdmin() && IsUacSupported())
{
- if (!ElevateWholeWizardProcess ("/zinplace"))
+ if (!ElevateWholeWizardProcess (decrypt ? "/resumeinplacedec" : "/zinplace"))
AbortProcessSilent ();
}
@@ -1025,11 +1038,37 @@
CreateNonSysInplaceEncMutex ();
bInPlaceEncNonSys = TRUE;
+ bInPlaceDecNonSys = decrypt;
bInPlaceEncNonSysResumed = TRUE;
ChangeWizardMode (WIZARD_MODE_NONSYS_DEVICE);
- LoadPage (MainDlg, NONSYS_INPLACE_ENC_RESUME_PASSWORD_PAGE);
+ LoadPage (MainDlg, NONSYS_INPLACE_ENC_PASSWORD_PAGE);
+}
+
+void SwitchWizardToNonSysInplaceDecStartMode (char *volPath)
+{
+ if (!IsAdmin() && IsUacSupported())
+ {
+ if (!ElevateWholeWizardProcess ((string ("/inplacedec \"") + volPath + "\"").c_str()))
+ AbortProcessSilent ();
+ }
+
+ if (!IsAdmin())
+ AbortProcess("ADMIN_PRIVILEGES_WARN_DEVICES");
+
+ if (!CheckRequirementsForNonSysInPlaceDec (volPath, FALSE))
+ AbortProcessSilent ();
+
+ CreateNonSysInplaceEncMutex ();
+
+ bInPlaceEncNonSys = TRUE;
+ bInPlaceDecNonSys = TRUE;
+ bInPlaceEncNonSysResumed = FALSE;
+
+ ChangeWizardMode (WIZARD_MODE_NONSYS_DEVICE);
+
+ LoadPage (MainDlg, NONSYS_INPLACE_ENC_PASSWORD_PAGE);
}
// Use this function e.g. if the config file with the system encryption settings was lost or not written
@@ -1235,8 +1274,6 @@
break;
}
- wcscpy_s (hyperLink, sizeof(hyperLink) / 2, GetString ("IDC_LINK_MORE_INFO_ABOUT_CIPHER"));
-
SetWindowTextW (GetDlgItem (hwndDlg, IDC_BOX_HELP), auxLine);
}
else
@@ -1244,11 +1281,6 @@
// No info available for this encryption algorithm
SetWindowTextW (GetDlgItem (hwndDlg, IDC_BOX_HELP), L"");
}
-
-
- // Update hyperlink
- SetWindowTextW (GetDlgItem (hwndDlg, IDC_LINK_MORE_INFO_ABOUT_CIPHER), hyperLink);
- AccommodateTextField (hwndDlg, IDC_LINK_MORE_INFO_ABOUT_CIPHER, FALSE, hUserUnderlineFont);
}
}
@@ -1639,6 +1671,7 @@
return;
}
+ bVolTransformThreadCancel = FALSE;
bSystemEncryptionInProgress = FALSE;
WaitCursor ();
@@ -1815,6 +1848,9 @@
case NONSYS_INPLACE_ENC_STATUS_ENCRYPTING:
wcscpy (nonSysInplaceEncUIStatus, GetString ("PROGRESS_STATUS_ENCRYPTING"));
break;
+ case NONSYS_INPLACE_ENC_STATUS_DECRYPTING:
+ wcscpy (nonSysInplaceEncUIStatus, GetString ("PROGRESS_STATUS_DECRYPTING"));
+ break;
case NONSYS_INPLACE_ENC_STATUS_FINALIZING:
wcscpy (nonSysInplaceEncUIStatus, GetString ("PROGRESS_STATUS_FINALIZING"));
break;
@@ -1834,12 +1870,28 @@
void UpdateNonSysInPlaceEncControls (void)
{
- EnableWindow (GetDlgItem (hCurPage, IDC_WIPE_MODE), !(bVolTransformThreadRunning || bVolTransformThreadToRun));
+ // Reduce flickering by updating a GUI element only when a relevant change affects it
+ static BOOL lastbVolTransformThreadRunning = !bVolTransformThreadRunning;
+ static BOOL lastbVolTransformThreadToRun = !bVolTransformThreadToRun;
+ static BOOL lastbInPlaceEncNonSysResumed = !bInPlaceEncNonSysResumed;
+
+ EnableWindow (GetDlgItem (hCurPage, IDC_WIPE_MODE), !(bVolTransformThreadRunning || bVolTransformThreadToRun) && !bInPlaceDecNonSys);
+ if (lastbVolTransformThreadRunning != bVolTransformThreadRunning
+ || lastbVolTransformThreadToRun != bVolTransformThreadToRun)
+ {
SetWindowTextW (GetDlgItem (hCurPage, IDC_PAUSE),
GetString ((bVolTransformThreadRunning || bVolTransformThreadToRun) ? "IDC_PAUSE" : "RESUME"));
+ lastbVolTransformThreadRunning = bVolTransformThreadRunning;
+ lastbVolTransformThreadToRun = bVolTransformThreadToRun;
+ }
+
+ if (lastbInPlaceEncNonSysResumed != bInPlaceEncNonSysResumed)
+ {
SetWindowTextW (GetDlgItem (MainDlg, IDCANCEL), GetString (bInPlaceEncNonSysResumed ? "DEFER" : "CANCEL"));
+ lastbInPlaceEncNonSysResumed = bInPlaceEncNonSysResumed;
+ }
EnableWindow (GetDlgItem (hCurPage, IDC_PAUSE), bFirstNonSysInPlaceEncResumeDone
&& NonSysInplaceEncStatus != NONSYS_INPLACE_ENC_STATUS_FINALIZING
@@ -1904,11 +1956,12 @@
if (bVolTransformThreadRunning
&& (nonSysInplaceEncStatus == NONSYS_INPLACE_ENC_STATUS_ENCRYPTING
+ || nonSysInplaceEncStatus == NONSYS_INPLACE_ENC_STATUS_DECRYPTING
|| nonSysInplaceEncStatus == NONSYS_INPLACE_ENC_STATUS_FINALIZING
|| nonSysInplaceEncStatus == NONSYS_INPLACE_ENC_STATUS_FINISHED))
{
if (lastNonSysInplaceEncStatus != nonSysInplaceEncStatus
- && nonSysInplaceEncStatus == NONSYS_INPLACE_ENC_STATUS_ENCRYPTING)
+ && (nonSysInplaceEncStatus == NONSYS_INPLACE_ENC_STATUS_ENCRYPTING || nonSysInplaceEncStatus == NONSYS_INPLACE_ENC_STATUS_DECRYPTING))
{
InitNonSysInplaceEncProgressBar ();
}
@@ -1942,7 +1995,7 @@
InitProgressBar (totalSize,
NonSysInplaceEncBytesDone,
- FALSE,
+ bInPlaceDecNonSys,
TRUE,
TRUE,
TRUE);
@@ -2345,7 +2398,7 @@
volParams->hiddenVolHostSize = nHiddenVolHostSize;
volParams->ea = nVolumeEA;
volParams->pkcs5 = hash_algo;
- volParams->headerFlags = CreatingHiddenSysVol() ? TC_HEADER_FLAG_ENCRYPTED_SYSTEM : 0;
+ volParams->headerFlags = (CreatingHiddenSysVol() ? TC_HEADER_FLAG_ENCRYPTED_SYSTEM : 0);
volParams->fileSystem = fileSystem;
volParams->clusterSize = clusterSize;
volParams->sparseFileSwitch = bSparseFileSwitch;
@@ -2355,8 +2408,19 @@
volParams->password = &volumePassword;
volParams->hwndDlg = hwndDlg;
- if (bInPlaceEncNonSys)
+ if (bInPlaceDecNonSys)
+ {
+ // In-place decryption of non-system volume
+
+ if (!bInPlaceEncNonSysResumed)
+ DiscardUnreadableEncryptedSectors = FALSE;
+
+ nStatus = DecryptPartitionInPlace (volParams, &DiscardUnreadableEncryptedSectors);
+ }
+ else if (bInPlaceEncNonSys)
{
+ // In-place encryption of non-system volume
+
HANDLE hPartition = INVALID_HANDLE_VALUE;
SetNonSysInplaceEncUIStatus (NONSYS_INPLACE_ENC_STATUS_PREPARING);
@@ -2384,6 +2448,8 @@
}
else
{
+ // Format-encryption
+
InitProgressBar (GetVolumeDataAreaSize (bHidden, nVolumeSize), 0, FALSE, FALSE, FALSE, TRUE);
nStatus = TCFormatVolume (volParams);
@@ -2401,7 +2467,7 @@
&& nStatus == ERR_USER_ABORT
&& NonSysInplaceEncStatus == NONSYS_INPLACE_ENC_STATUS_FINISHED)
{
- // Ignore user abort if non-system in-place encryption successfully finished
+ // Ignore user abort if non-system in-place encryption/decryption successfully finished
nStatus = ERR_SUCCESS;
}
@@ -2428,7 +2494,7 @@
SetLastError (dwWin32FormatError);
if ((bVolTransformThreadCancel || nStatus == ERR_USER_ABORT)
- && !(bInPlaceEncNonSys && NonSysInplaceEncStatus == NONSYS_INPLACE_ENC_STATUS_FINISHED)) // Ignore user abort if non-system in-place encryption successfully finished.
+ && !(bInPlaceEncNonSys && NonSysInplaceEncStatus == NONSYS_INPLACE_ENC_STATUS_FINISHED)) // Ignore user abort if non-system in-place encryption/decryption successfully finished.
{
if (!bDevice && !(bHiddenVol && !bHiddenVolHost)) // If we're not creating a hidden volume and if it's a file container
{
@@ -2458,6 +2524,10 @@
else
{
SetNonSysInplaceEncUIStatus (NONSYS_INPLACE_ENC_STATUS_ERROR);
+
+ if (bInPlaceDecNonSys)
+ Error ("INPLACE_DEC_GENERIC_ERR");
+ else
ShowInPlaceEncErrMsgWAltSteps ("INPLACE_ENC_GENERIC_ERR_ALT_STEPS", TRUE);
}
}
@@ -2498,12 +2568,18 @@
}
else if (bInPlaceEncNonSys)
{
+ if (!bInPlaceDecNonSys)
+ {
Warning ("NONSYS_INPLACE_ENC_FINISHED_INFO");
-
HandleOldAssignedDriveLetter ();
}
else
{
+ // NOP - Final steps for in-place decryption are handled with the TC_APPMSG_NONSYS_INPLACE_ENC_FINISHED message.
+ }
+ }
+ else
+ {
Info("FORMAT_FINISHED_INFO");
if (bSparseFileSwitch && quickFormat)
@@ -2629,8 +2705,7 @@
switch (nPageNo)
{
case INTRO_PAGE:
- hCurPage = CreateDialogW (hInst, MAKEINTRESOURCEW (IDD_INTRO_PAGE_DLG), hwndDlg,
- (DLGPROC) PageDialogProc);
+ AbortProcess ("INSECURE_APP");
break;
case SYSENC_TYPE_PAGE:
@@ -2768,7 +2843,7 @@
(DLGPROC) PageDialogProc);
break;
- case NONSYS_INPLACE_ENC_RESUME_PASSWORD_PAGE:
+ case NONSYS_INPLACE_ENC_PASSWORD_PAGE:
hCurPage = CreateDialogW (hInst, MAKEINTRESOURCEW (IDD_PASSWORD_ENTRY_PAGE_DLG), hwndDlg,
(DLGPROC) PageDialogProc);
break;
@@ -2778,16 +2853,21 @@
(DLGPROC) PageDialogProc);
break;
- case NONSYS_INPLACE_ENC_ENCRYPTION_PAGE:
+ case NONSYS_INPLACE_ENC_TRANSFORM_PAGE:
hCurPage = CreateDialogW (hInst, MAKEINTRESOURCEW (IDD_INPLACE_ENCRYPTION_PAGE_DLG), hwndDlg,
(DLGPROC) PageDialogProc);
break;
- case NONSYS_INPLACE_ENC_ENCRYPTION_FINISHED_PAGE:
+ case NONSYS_INPLACE_ENC_TRANSFORM_FINISHED_PAGE:
hCurPage = CreateDialogW (hInst, MAKEINTRESOURCEW (IDD_INFO_PAGE_DLG), hwndDlg,
(DLGPROC) PageDialogProc);
break;
+ case NONSYS_INPLACE_DEC_TRANSFORM_FINISHED_DRIVE_LETTER_PAGE:
+ hCurPage = CreateDialogW (hInst, MAKEINTRESOURCEW (IDD_DRIVE_LETTER_SELECTION_PAGE), hwndDlg,
+ (DLGPROC) PageDialogProc);
+ break;
+
case FORMAT_PAGE:
hCurPage = CreateDialogW (hInst, MAKEINTRESOURCEW (IDD_FORMAT_PAGE_DLG), hwndDlg,
(DLGPROC) PageDialogProc);
@@ -3182,7 +3262,7 @@
if (bHiddenOS && bHiddenVolHost)
swprintf (szTmp, GetString ("OVERWRITEPROMPT_DEVICE_HIDDEN_OS_PARTITION"), szFileName, drive);
else
- swprintf (szTmp, GetString (bInPlaceEncNonSys ? "NONSYS_INPLACE_ENC_CONFIRM" : "OVERWRITEPROMPT_DEVICE"), type, szFileName, drive);
+ swprintf (szTmp, GetString (bInPlaceEncNonSys ? (bInPlaceDecNonSys ? "NONSYS_INPLACE_DEC_CONFIRM" : "NONSYS_INPLACE_ENC_CONFIRM") : "OVERWRITEPROMPT_DEVICE"), type, szFileName, drive);
x = MessageBoxW (MainDlg, szTmp, lpszTitle, YES_NO | MB_ICONWARNING | (bInPlaceEncNonSys ? MB_DEFBUTTON1 : MB_DEFBUTTON2));
@@ -3249,6 +3329,16 @@
return TRUE;
}
+
+void UpdateLastDialogId (void)
+{
+ static char PageDebugId[128];
+
+ sprintf (PageDebugId, "FORMAT_PAGE_%d", nCurPageNo);
+ LastDialogId = PageDebugId;
+}
+
+
void HandleOldAssignedDriveLetter (void)
{
if (bDevice)
@@ -3291,7 +3381,6 @@
not. - see DialogProc */
BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
- static char PageDebugId[128];
WORD lw = LOWORD (wParam);
WORD hw = HIWORD (wParam);
@@ -3302,8 +3391,7 @@
case WM_INITDIALOG:
LocalizeDialog (hwndDlg, "IDD_VOL_CREATION_WIZARD_DLG");
- sprintf (PageDebugId, "FORMAT_PAGE_%d", nCurPageNo);
- LastDialogId = PageDebugId;
+ UpdateLastDialogId ();
switch (nCurPageNo)
{
@@ -3315,9 +3403,6 @@
SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDC_BOX_TITLE), GetString ("INTRO_TITLE"));
- ToHyperlink (hwndDlg, IDC_MORE_INFO_ON_CONTAINERS);
- ToHyperlink (hwndDlg, IDC_MORE_INFO_ON_SYS_ENCRYPTION);
-
EnableWindow (GetDlgItem (hwndDlg, IDC_STD_VOL), TRUE);
EnableWindow (GetDlgItem (hwndDlg, IDC_HIDDEN_VOL), TRUE);
@@ -3344,8 +3429,6 @@
SetWindowTextW (GetDlgItem (hwndDlg, IDC_BOX_HELP), GetString ("SYSENC_HIDDEN_TYPE_HELP"));
SetWindowTextW (GetDlgItem (hwndDlg, IDC_BOX_HELP_SYSENC_NORMAL), GetString ("SYSENC_NORMAL_TYPE_HELP"));
- ToHyperlink (hwndDlg, IDC_HIDDEN_SYSENC_INFO_LINK);
-
EnableWindow (GetDlgItem (GetParent (hwndDlg), IDC_NEXT), TRUE);
EnableWindow (GetDlgItem (GetParent (hwndDlg), IDC_PREV), !bDirectSysEncMode);
@@ -3365,7 +3448,6 @@
EnableWindow (GetDlgItem (MainDlg, IDC_NEXT), TRUE);
EnableWindow (GetDlgItem (MainDlg, IDC_PREV), bDirectSysEncModeCommand != SYSENC_COMMAND_CREATE_HIDDEN_OS && bDirectSysEncModeCommand != SYSENC_COMMAND_CREATE_HIDDEN_OS_ELEV);
- ToHyperlink (hwndDlg, IDC_HIDDEN_SYSENC_INFO_LINK);
break;
case SYSENC_SPAN_PAGE:
@@ -3534,8 +3616,6 @@
SetWindowTextW (GetDlgItem (hwndDlg, IDC_BOX_HELP), GetString ("HIDDEN_VOLUME_TYPE_HELP"));
SetWindowTextW (GetDlgItem (hwndDlg, IDC_BOX_HELP_NORMAL_VOL), GetString ("NORMAL_VOLUME_TYPE_HELP"));
- ToHyperlink (hwndDlg, IDC_HIDDEN_VOL_HELP);
-
EnableWindow (GetDlgItem (GetParent (hwndDlg), IDC_NEXT), TRUE);
EnableWindow (GetDlgItem (GetParent (hwndDlg), IDC_PREV), TRUE);
@@ -3725,8 +3805,6 @@
ComboSelChangeEA (hwndDlg);
SetFocus (GetDlgItem (hwndDlg, IDC_COMBO_BOX));
- ToHyperlink (hwndDlg, IDC_LINK_MORE_INFO_ABOUT_CIPHER);
-
// Hash algorithms
if (SysEncInEffect ())
@@ -3744,8 +3822,6 @@
}
SelectAlgo (GetDlgItem (hwndDlg, IDC_COMBO_BOX_HASH_ALGO), &hash_algo);
- ToHyperlink (hwndDlg, IDC_LINK_HASH_INFO);
-
// Wizard buttons
SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDC_NEXT), GetString ("NEXT"));
SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDC_PREV), GetString ("PREV"));
@@ -3848,7 +3924,7 @@
break;
case HIDDEN_VOL_HOST_PASSWORD_PAGE:
- case NONSYS_INPLACE_ENC_RESUME_PASSWORD_PAGE:
+ case NONSYS_INPLACE_ENC_PASSWORD_PAGE:
SendMessage (GetDlgItem (hwndDlg, IDC_PASSWORD_DIRECT), EM_LIMITTEXT, MAX_PASSWORD, 0);
@@ -3858,7 +3934,7 @@
SetCheckBox (hwndDlg, IDC_KEYFILES_ENABLE, KeyFilesEnable);
- SetWindowTextW (GetDlgItem (hwndDlg, IDC_BOX_HELP), GetString (bInPlaceEncNonSys ? "NONSYS_INPLACE_ENC_RESUME_PASSWORD_PAGE_HELP" : "PASSWORD_HIDDENVOL_HOST_DIRECT_HELP"));
+ SetWindowTextW (GetDlgItem (hwndDlg, IDC_BOX_HELP), GetString (bInPlaceEncNonSys ? (bInPlaceEncNonSysResumed ? "NONSYS_INPLACE_ENC_RESUME_PASSWORD_PAGE_HELP" : "NONSYS_INPLACE_DEC_PASSWORD_PAGE_HELP") : "PASSWORD_HIDDENVOL_HOST_DIRECT_HELP"));
SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDC_BOX_TITLE), GetString (bInPlaceEncNonSys ? "PASSWORD" : "PASSWORD_HIDVOL_HOST_TITLE"));
@@ -4203,8 +4279,6 @@
EnableWindow (GetDlgItem (GetParent (hwndDlg), IDCANCEL), TRUE);
EnableWindow (GetDlgItem (GetParent (hwndDlg), IDHELP), TRUE);
- ToHyperlink (hwndDlg, IDC_MORE_INFO_SYS_ENCRYPTION);
-
if (SystemEncryptionStatus == SYSENC_STATUS_DECRYPTING)
{
nWipeMode = TC_WIPE_NONE;
@@ -4250,7 +4324,7 @@
break;
- case NONSYS_INPLACE_ENC_ENCRYPTION_PAGE:
+ case NONSYS_INPLACE_ENC_TRANSFORM_PAGE:
if (bInPlaceEncNonSysResumed)
{
@@ -4260,39 +4334,46 @@
nWipeMode = savedWipeAlgorithm;
}
- SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDC_BOX_TITLE), GetString ("ENCRYPTION"));
+ SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDC_BOX_TITLE), GetString (bInPlaceDecNonSys ? "DECRYPTION" : "ENCRYPTION"));
- SetWindowTextW (GetDlgItem (hwndDlg, IDC_BOX_HELP), GetString ("NONSYS_INPLACE_ENC_ENCRYPTION_PAGE_INFO"));
+ SetWindowTextW (GetDlgItem (hwndDlg, IDC_BOX_HELP), GetString (bInPlaceDecNonSys ? "NONSYS_INPLACE_DEC_DECRYPTION_PAGE_INFO" : "NONSYS_INPLACE_ENC_ENCRYPTION_PAGE_INFO"));
SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDCANCEL), GetString (bInPlaceEncNonSysResumed ? "DEFER" : "CANCEL"));
SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDC_PREV), GetString ("PREV"));
- SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDC_NEXT), GetString (bInPlaceEncNonSysResumed ? "RESUME" : "ENCRYPT"));
+ SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDC_NEXT), GetString (bInPlaceEncNonSysResumed ? "RESUME" : (bInPlaceDecNonSys ? "DECRYPT" : "ENCRYPT")));
SetWindowTextW (GetDlgItem (hwndDlg, IDC_PAUSE), GetString ("IDC_PAUSE"));
- EnableWindow (GetDlgItem (GetParent (hwndDlg), IDC_PREV), !bInPlaceEncNonSysResumed);
+ EnableWindow (GetDlgItem (GetParent (hwndDlg), IDC_PREV), !bInPlaceEncNonSysResumed && !bInPlaceDecNonSys);
EnableWindow (GetDlgItem (GetParent (hwndDlg), IDC_NEXT), TRUE);
EnableWindow (GetDlgItem (GetParent (hwndDlg), IDCANCEL), TRUE);
EnableWindow (GetDlgItem (GetParent (hwndDlg), IDHELP), TRUE);
EnableWindow (GetDlgItem (hwndDlg, IDC_PAUSE), FALSE);
- ShowWindow (GetDlgItem (hwndDlg, IDC_MORE_INFO_SYS_ENCRYPTION), SW_HIDE);
-
+ if (bInPlaceDecNonSys)
+ {
+ ShowWindow(GetDlgItem(hwndDlg, IDT_FORMAT_OPTIONS), SW_HIDE);
+ ShowWindow(GetDlgItem(hwndDlg, IDT_WIPE_MODE), SW_HIDE);
+ ShowWindow(GetDlgItem(hwndDlg, IDC_WIPE_MODE), SW_HIDE);
+ }
+ else
+ {
EnableWindow (GetDlgItem (hwndDlg, IDC_WIPE_MODE), TRUE);
PopulateWipeModeCombo (GetDlgItem (hwndDlg, IDC_WIPE_MODE), FALSE, TRUE);
SelectAlgo (GetDlgItem (hwndDlg, IDC_WIPE_MODE), (int *) &nWipeMode);
+ }
break;
- case NONSYS_INPLACE_ENC_ENCRYPTION_FINISHED_PAGE:
+ case NONSYS_INPLACE_ENC_TRANSFORM_FINISHED_PAGE:
bConfirmQuit = FALSE;
- SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDC_BOX_TITLE), GetString ("NONSYS_INPLACE_ENC_FINISHED_TITLE"));
+ SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDC_BOX_TITLE), GetString (bInPlaceDecNonSys ? "NONSYS_INPLACE_DEC_FINISHED_TITLE" : "NONSYS_INPLACE_ENC_FINISHED_TITLE"));
- SetWindowTextW (GetDlgItem (hwndDlg, IDC_BOX_HELP), GetString ("NONSYS_INPLACE_ENC_FINISHED_INFO"));
+ SetWindowTextW (GetDlgItem (hwndDlg, IDC_BOX_HELP), GetString (bInPlaceDecNonSys ? "NONSYS_INPLACE_DEC_FINISHED_INFO" : "NONSYS_INPLACE_ENC_FINISHED_INFO"));
SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDC_PREV), GetString ("PREV"));
SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDC_NEXT), GetString ("FINALIZE"));
@@ -4304,6 +4385,54 @@
break;
+ case NONSYS_INPLACE_DEC_TRANSFORM_FINISHED_DRIVE_LETTER_PAGE:
+
+ SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDC_BOX_TITLE), GetString ("NONSYS_INPLACE_DEC_FINISHED_TITLE"));
+
+ SetWindowTextW (GetDlgItem (hwndDlg, IDC_BOX_HELP), GetString ("NONSYS_INPLACE_DEC_FINISHED_DRIVE_LETTER_SEL_INFO"));
+
+ SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDC_PREV), GetString ("PREV"));
+ SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDC_NEXT), GetString ("FINALIZE"));
+ EnableWindow (GetDlgItem (GetParent (hwndDlg), IDC_PREV), FALSE);
+ EnableWindow (GetDlgItem (GetParent (hwndDlg), IDC_NEXT), TRUE);
+
+ SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDCANCEL), GetString ("CANCEL"));
+
+ // The Cancel button and the X button must be disabled to prevent the user from forgetting to assign a drive letter to the partition by closing
+ // the window accidentally or clicking Cancel. The user is forced to click Finish to assign at least the pre-selected free drive letter.
+ // This is critical because inexperienced users would not know how to access data on the decrypted volume without a drive letter.
+ EnableWindow (GetDlgItem (GetParent (hwndDlg), IDCANCEL), FALSE);
+ DisableCloseButton (MainDlg);
+ bConfirmQuit = TRUE; // Alt-F4 will still work but the user will be prompted to confirm the action.
+
+ // Decryption of non-system volume finished, no drive letter is assigned to the decrypted volume, and free drive letters are available.
+ // This is critical because inexperienced users would not know how to access data on the decrypted volume. We cannot allow exit
+ // until a drive letter is freed up and assigned to the decrypted volume.
+
+ while (GetFirstAvailableDrive () == -1)
+ {
+ Error ("NONSYS_INPLACE_DEC_FINISHED_NO_DRIVE_LETTER_AVAILABLE");
+ }
+
+ // Populate the combobox with free drive letters
+ {
+ DWORD dwUsedDrives = GetLogicalDrives();
+ char szDriveLetter[] = {' ', ':', 0 };
+ int i;
+
+ for (i = 3; i < 26; i++)
+ {
+ if (!(dwUsedDrives & 1 << i))
+ {
+ // Add
+ szDriveLetter [0] = (char) (i + 'A');
+ AddComboPair (GetDlgItem (hCurPage, IDC_DRIVE_LETTER_LIST), szDriveLetter, i);
+ }
+ }
+ }
+ SendMessage (GetDlgItem (hwndDlg, IDC_DRIVE_LETTER_LIST), CB_SETCURSEL, 0, 0);
+ break;
+
case FORMAT_PAGE:
{
BOOL bNTFSallowed = FALSE;
@@ -4620,10 +4749,6 @@
}
return 0;
- case WM_HELP:
- OpenPageHelp (GetParent (hwndDlg), nCurPageNo);
- return 1;
-
case TC_APPMSG_PERFORM_POST_SYSENC_WMINIT_TASKS:
AfterSysEncProgressWMInitTasks (hwndDlg);
return 1;
@@ -4645,14 +4770,6 @@
case IDC_SYS_DEVICE:
UpdateWizardModeControls (hwndDlg, WIZARD_MODE_SYS_DEVICE);
return 1;
-
- case IDC_MORE_INFO_ON_CONTAINERS:
- Applink ("introcontainer", TRUE, "");
- return 1;
-
- case IDC_MORE_INFO_ON_SYS_ENCRYPTION:
- Applink ("introsysenc", TRUE, "");
- return 1;
}
}
@@ -4671,19 +4788,9 @@
bHiddenVol = FALSE;
bHiddenVolHost = FALSE;
return 1;
-
- case IDC_HIDDEN_SYSENC_INFO_LINK:
- Applink ("hiddensysenc", TRUE, "");
- return 1;
}
}
- if (nCurPageNo == SYSENC_HIDDEN_OS_REQ_CHECK_PAGE && lw == IDC_HIDDEN_SYSENC_INFO_LINK)
- {
- Applink ("hiddensysenc", TRUE, "");
- return 1;
- }
-
if (nCurPageNo == SYSENC_SPAN_PAGE)
{
switch (lw)
@@ -4801,10 +4908,6 @@
return 1;
}
break;
-
- case IDC_MORE_INFO_SYS_ENCRYPTION:
- Applink ("sysencprogressinfo", TRUE, "");
- return 1;
}
}
@@ -4850,7 +4953,7 @@
}
break;
- case NONSYS_INPLACE_ENC_ENCRYPTION_PAGE:
+ case NONSYS_INPLACE_ENC_TRANSFORM_PAGE:
{
switch (lw)
{
@@ -4892,12 +4995,6 @@
return 1;
}
- if (lw == IDC_HIDDEN_VOL_HELP && nCurPageNo == VOLUME_TYPE_PAGE)
- {
- Applink ("hiddenvolume", TRUE, "");
- return 1;
- }
-
if (lw == IDC_ABORT_BUTTON && nCurPageNo == FORMAT_PAGE)
{
if (MessageBoxW (hwndDlg, GetString ("FORMAT_ABORT"), lpszTitle, MB_YESNO | MB_ICONQUESTION | MB_DEFBUTTON2 ) == IDYES)
@@ -4937,32 +5034,6 @@
return 1;
}
- if (lw == IDC_LINK_MORE_INFO_ABOUT_CIPHER && nCurPageNo == CIPHER_PAGE)
- {
- char name[100];
-
- int nIndex = SendMessage (GetDlgItem (hCurPage, IDC_COMBO_BOX), CB_GETCURSEL, 0, 0);
- nIndex = SendMessage (GetDlgItem (hCurPage, IDC_COMBO_BOX), CB_GETITEMDATA, nIndex, 0);
- EAGetName (name, nIndex);
-
- if (strcmp (name, "AES") == 0)
- Applink ("aes", FALSE, "");
- else if (strcmp (name, "Serpent") == 0)
- Applink ("serpent", FALSE, "");
- else if (strcmp (name, "Twofish") == 0)
- Applink ("twofish", FALSE, "");
- else if (EAGetCipherCount (nIndex) > 1)
- Applink ("cascades", TRUE, "");
-
- return 1;
- }
-
- if (lw == IDC_LINK_HASH_INFO && nCurPageNo == CIPHER_PAGE)
- {
- Applink ("hashalgorithms", TRUE, "");
- return 1;
- }
-
if (hw == CBN_EDITCHANGE && nCurPageNo == VOLUME_LOCATION_PAGE)
{
EnableWindow (GetDlgItem (GetParent (hwndDlg), IDC_NEXT),
@@ -5028,7 +5099,7 @@
if (nCurPageNo == PASSWORD_PAGE
|| nCurPageNo == HIDDEN_VOL_HOST_PASSWORD_PAGE
- || nCurPageNo == NONSYS_INPLACE_ENC_RESUME_PASSWORD_PAGE)
+ || nCurPageNo == NONSYS_INPLACE_ENC_PASSWORD_PAGE)
{
if (lw == IDC_KEY_FILES)
{
@@ -5051,10 +5122,10 @@
SetCheckBox (hwndDlg, IDC_KEYFILES_ENABLE, KeyFilesEnable);
- if (nCurPageNo != HIDDEN_VOL_HOST_PASSWORD_PAGE && nCurPageNo != NONSYS_INPLACE_ENC_RESUME_PASSWORD_PAGE)
+ if (nCurPageNo != HIDDEN_VOL_HOST_PASSWORD_PAGE && nCurPageNo != NONSYS_INPLACE_ENC_PASSWORD_PAGE)
EnableWindow (GetDlgItem (hwndDlg, IDC_KEY_FILES), KeyFilesEnable);
- if (nCurPageNo != HIDDEN_VOL_HOST_PASSWORD_PAGE && nCurPageNo != NONSYS_INPLACE_ENC_RESUME_PASSWORD_PAGE)
+ if (nCurPageNo != HIDDEN_VOL_HOST_PASSWORD_PAGE && nCurPageNo != NONSYS_INPLACE_ENC_PASSWORD_PAGE)
{
VerifyPasswordAndUpdate (hwndDlg, GetDlgItem (GetParent (hwndDlg), IDC_NEXT),
GetDlgItem (hCurPage, IDC_PASSWORD),
@@ -5070,7 +5141,7 @@
{
KeyFilesEnable = GetCheckBox (hwndDlg, IDC_KEYFILES_ENABLE);
- if (nCurPageNo != HIDDEN_VOL_HOST_PASSWORD_PAGE && nCurPageNo != NONSYS_INPLACE_ENC_RESUME_PASSWORD_PAGE)
+ if (nCurPageNo != HIDDEN_VOL_HOST_PASSWORD_PAGE && nCurPageNo != NONSYS_INPLACE_ENC_PASSWORD_PAGE)
{
EnableWindow (GetDlgItem (hwndDlg, IDC_KEY_FILES), KeyFilesEnable);
@@ -5085,7 +5156,7 @@
}
if (nCurPageNo == HIDDEN_VOL_HOST_PASSWORD_PAGE
- || nCurPageNo == NONSYS_INPLACE_ENC_RESUME_PASSWORD_PAGE)
+ || nCurPageNo == NONSYS_INPLACE_ENC_PASSWORD_PAGE)
{
if (hw == EN_CHANGE)
{
@@ -5317,8 +5388,6 @@
{
if (IsWindowsIsoBurnerAvailable())
LaunchWindowsIsoBurner (hwndDlg, szRescueDiskISO);
- else
- Applink ("isoburning", TRUE, "");
return 1;
}
@@ -5544,6 +5613,8 @@
KillTimer (hwndDlg, TIMER_ID_SYSENC_PROGRESS);
+ UpdateLastDialogId ();
+
try
{
if (BootEncStatus.DriveMounted) // If we had been really encrypting/decrypting (not just proceeding to deinstall)
@@ -5668,6 +5739,8 @@
if (!bVolTransformThreadRunning && !bVolTransformThreadToRun)
{
KillTimer (hwndDlg, TIMER_ID_NONSYS_INPLACE_ENC_PROGRESS);
+
+ UpdateLastDialogId ();
}
UpdateNonSysInPlaceEncControls ();
@@ -5745,6 +5818,7 @@
else
{
KillTimer (hwndDlg, TIMER_ID_SYSENC_DRIVE_ANALYSIS_PROGRESS);
+
UpdateProgressBarProc (SYSENC_DRIVE_ANALYSIS_ETA);
Sleep (1500); // User-friendly GUI
@@ -5807,6 +5881,7 @@
// The driver stopped wiping
KillTimer (hwndDlg, TIMER_ID_WIPE_PROGRESS);
+ UpdateLastDialogId ();
try
{
@@ -5890,8 +5965,29 @@
KillTimer (hwndDlg, TIMER_ID_NONSYS_INPLACE_ENC_PROGRESS);
- LoadPage (hwndDlg, NONSYS_INPLACE_ENC_ENCRYPTION_FINISHED_PAGE);
+ if (bInPlaceDecNonSys)
+ {
+ // Decryption of non-system volume finished and free drive letters are available. Check if a drive letter is assigned to the decrypted volume.
+
+ WCHAR deviceName[MAX_PATH];
+
+ strcpy ((char *)deviceName, szDiskFile);
+ ToUNICODE ((char *)deviceName);
+
+ if (GetDiskDeviceDriveLetter (deviceName) < 0)
+ {
+ // No drive letter is assigned to the device
+ MessageBeep (MB_OK);
+ LoadPage (hwndDlg, NONSYS_INPLACE_DEC_TRANSFORM_FINISHED_DRIVE_LETTER_PAGE);
+ return 1;
+ }
+ else
+ {
+ Info ("NONSYS_INPLACE_DEC_FINISHED_INFO");
+ }
+ }
+ LoadPage (hwndDlg, NONSYS_INPLACE_ENC_TRANSFORM_FINISHED_PAGE);
return 1;
case TC_APPMSG_VOL_TRANSFORM_THREAD_ENDED:
@@ -5923,14 +6019,9 @@
NormalCursor ();
return 1;
- case WM_HELP:
-
- OpenPageHelp (hwndDlg, nCurPageNo);
- return 1;
-
case TC_APPMSG_FORMAT_USER_QUIT:
- if (nCurPageNo == NONSYS_INPLACE_ENC_ENCRYPTION_PAGE
+ if (nCurPageNo == NONSYS_INPLACE_ENC_TRANSFORM_PAGE
&& (bVolTransformThreadRunning || bVolTransformThreadToRun || bInPlaceEncNonSysResumed))
{
// Non-system encryption in progress
@@ -6023,12 +6114,7 @@
case WM_COMMAND:
- if (lw == IDHELP)
- {
- OpenPageHelp (hwndDlg, nCurPageNo);
- return 1;
- }
- else if (lw == IDCANCEL)
+ if (lw == IDCANCEL)
{
PostMessage (hwndDlg, TC_APPMSG_FORMAT_USER_QUIT, 0, 0);
return 1;
@@ -6710,7 +6796,7 @@
}
else if (nCurPageNo == HIDDEN_VOL_HOST_PASSWORD_PAGE
- || nCurPageNo == NONSYS_INPLACE_ENC_RESUME_PASSWORD_PAGE)
+ || nCurPageNo == NONSYS_INPLACE_ENC_PASSWORD_PAGE)
{
WaitCursor ();
@@ -6849,10 +6935,10 @@
}
}
}
- else
+ else if (bInPlaceEncNonSysResumed)
{
/* Scan all available partitions to discover all partitions where non-system in-place
- encryption has been interrupted. */
+ encryption/decryption has been interrupted. */
BOOL tmpbDevice;
DeferredNonSysInPlaceEncDevices.clear();
@@ -6895,12 +6981,115 @@
return 1;
}
- nNewPageNo = NONSYS_INPLACE_ENC_ENCRYPTION_PAGE - 1; // Skip irrelevant pages
+ nNewPageNo = NONSYS_INPLACE_ENC_TRANSFORM_PAGE - 1; // Skip irrelevant pages
}
NormalCursor();
}
+ else
+ {
+ /* Try to mount the non-system volume to decrypt in place (the process has not started yet, we are NOT trying to resume it).
+ We will try to mount it using the backup header, which we require to work (i.e. be non-damaged) before we start writing
+ to the volume (the primary header will be overwritten by decrypted data soon after the decryption process begins, so the
+ backup header will contain the only copy of the master key). */
+
+ int driveNo = -1;
+
+ // The volume may already be mounted. We need to dismount it first in order to verify the supplied password/keyfile(s) is/are correct.
+ if (IsMountedVolume (szFileName))
+ {
+ driveNo = GetMountedVolumeDriveNo (szFileName);
+ if (driveNo == -1
+ || !UnmountVolume (hwndDlg, driveNo, TRUE))
+ {
+ handleWin32Error (MainDlg);
+ AbortProcess ("CANT_DISMOUNT_VOLUME");
+ }
+ }
+
+ driveNo = GetLastAvailableDrive ();
+
+ if (driveNo < 0)
+ AbortProcess ("NO_FREE_DRIVES");
+
+ MountOptions mountOptions;
+ ZeroMemory (&mountOptions, sizeof (mountOptions));
+
+ mountOptions.UseBackupHeader = FALSE; // This must be FALSE at this point because otherwise we wouldn't be able to detect a legacy volume
+ mountOptions.ReadOnly = TRUE;
+ mountOptions.Removable = ConfigReadInt ("MountVolumesRemovable", FALSE);
+
+ // Check that it is not a hidden or legacy volume
+
+ if (MountVolume (hwndDlg, driveNo, szFileName, &volumePassword, FALSE, TRUE, &mountOptions, FALSE, TRUE) < 1)
+ {
+ NormalCursor();
+ return 1;
+ }
+
+ {
+ DWORD dwResult;
+ VOLUME_PROPERTIES_STRUCT volProp;
+
+ memset (&volProp, 0, sizeof(volProp));
+ volProp.driveNo = driveNo;
+ if (!DeviceIoControl (hDriver, TC_IOCTL_GET_VOLUME_PROPERTIES, &volProp, sizeof (volProp), &volProp, sizeof (volProp), &dwResult, NULL) || dwResult == 0)
+ {
+ handleWin32Error (hwndDlg);
+ UnmountVolume (hwndDlg, driveNo, TRUE);
+ AbortProcess ("CANT_GET_VOL_INFO");
+ }
+
+ if (volProp.volFormatVersion == TC_VOLUME_FORMAT_VERSION_PRE_6_0)
+ {
+ UnmountVolume (hwndDlg, driveNo, TRUE);
+ AbortProcess ("NONSYS_INPLACE_DECRYPTION_BAD_VOL_FORMAT");
+ }
+
+ if (volProp.hiddenVolume)
+ {
+ UnmountVolume (hwndDlg, driveNo, TRUE);
+ AbortProcess ("NONSYS_INPLACE_DECRYPTION_CANT_DECRYPT_HID_VOL");
+ }
+ }
+
+ // Remount the volume using the backup header to verify it is working
+
+ if (!UnmountVolume (hwndDlg, driveNo, TRUE))
+ {
+ handleWin32Error (MainDlg);
+ AbortProcess ("CANT_DISMOUNT_VOLUME");
+ }
+
+ mountOptions.UseBackupHeader = TRUE; // This must be TRUE at this point (we won't be using the regular header, which will be lost soon after the decryption process starts)
+
+ if (MountVolume (hwndDlg, driveNo, szFileName, &volumePassword, FALSE, TRUE, &mountOptions, FALSE, TRUE) < 1)
+ {
+ NormalCursor();
+ return 1;
+ }
+
+ if (!UnmountVolume (hwndDlg, driveNo, TRUE))
+ {
+ handleWin32Error (MainDlg);
+ AbortProcess ("CANT_DISMOUNT_VOLUME");
+ }
+
+ BOOL tmpbDevice;
+
+ CreateFullVolumePath (szDiskFile, szFileName, &tmpbDevice);
+
+ nVolumeSize = GetDeviceSize (szDiskFile);
+ if (nVolumeSize == -1)
+ {
+ handleWin32Error (MainDlg);
+ AbortProcessSilent ();
+ }
+
+ nNewPageNo = NONSYS_INPLACE_ENC_TRANSFORM_PAGE - 1; // Skip irrelevant pages
+ NormalCursor();
+ }
}
else if (nCurPageNo == FILESYS_PAGE)
@@ -7205,17 +7394,74 @@
}
else if (nCurPageNo == NONSYS_INPLACE_ENC_RESUME_PARTITION_SEL_PAGE)
{
- nNewPageNo = NONSYS_INPLACE_ENC_ENCRYPTION_PAGE - 1; // Skip irrelevant pages
+ nNewPageNo = NONSYS_INPLACE_ENC_TRANSFORM_PAGE - 1; // Skip irrelevant pages
}
- else if (nCurPageNo == NONSYS_INPLACE_ENC_ENCRYPTION_PAGE)
+ else if (nCurPageNo == NONSYS_INPLACE_ENC_TRANSFORM_PAGE)
{
/* In-place encryption start (the 'Next' button has been clicked) */
+ if (bInPlaceDecNonSys
+ && !bInPlaceEncNonSysResumed
+ && AskWarnYesNo ("NONSYS_INPLACE_ENC_CONFIRM_BACKUP") == IDNO)
+ {
+ // Cancel
+ return 1;
+ }
+
NonSysInplaceEncResume ();
return 1;
}
- else if (nCurPageNo == NONSYS_INPLACE_ENC_ENCRYPTION_FINISHED_PAGE)
+ else if (nCurPageNo == NONSYS_INPLACE_ENC_TRANSFORM_FINISHED_PAGE)
+ {
+ PostMessage (hwndDlg, TC_APPMSG_FORMAT_USER_QUIT, 0, 0);
+ return 1;
+ }
+ else if (nCurPageNo == NONSYS_INPLACE_DEC_TRANSFORM_FINISHED_DRIVE_LETTER_PAGE)
{
+ BOOL bDrvLetterAssignResult = FALSE;
+
+ int tmpDriveLetter = (int) SendMessage (GetDlgItem (hCurPage, IDC_DRIVE_LETTER_LIST),
+ CB_GETITEMDATA,
+ SendMessage (GetDlgItem (hCurPage, IDC_DRIVE_LETTER_LIST), CB_GETCURSEL, 0, 0),
+ 0);
+
+ if (tmpDriveLetter < 0)
+ tmpDriveLetter = GetFirstAvailableDrive ();
+
+ do
+ {
+ char szDriveLetter[] = {'A', ':', 0 };
+ char rootPath[] = {'A', ':', '\\', 0 };
+ char uniqVolName[MAX_PATH+1] = { 0 };
+
+ rootPath[0] += (char) tmpDriveLetter;
+ szDriveLetter[0] += (char) tmpDriveLetter;
+
+ if (DefineDosDevice (DDD_RAW_TARGET_PATH, szDriveLetter, szDiskFile))
+ {
+ bDrvLetterAssignResult = GetVolumeNameForVolumeMountPoint (rootPath, uniqVolName, MAX_PATH);
+
+ DefineDosDevice (DDD_RAW_TARGET_PATH|DDD_REMOVE_DEFINITION|DDD_EXACT_MATCH_ON_REMOVE,
+ szDriveLetter,
+ szDiskFile);
+
+ if (bDrvLetterAssignResult)
+ {
+ if (SetVolumeMountPoint (rootPath, uniqVolName) == 0)
+ bDrvLetterAssignResult = FALSE;
+ }
+ }
+
+ if (!bDrvLetterAssignResult)
+ {
+ if (AskErrYesNo ("ERR_CANNOT_ASSIGN_DRIVE_LETTER_NONSYS_DEC") == IDNO)
+ break;
+ }
+
+ } while (bDrvLetterAssignResult == FALSE);
+
+ bConfirmQuit = FALSE;
+
PostMessage (hwndDlg, TC_APPMSG_FORMAT_USER_QUIT, 0, 0);
return 1;
}
@@ -7677,7 +7923,7 @@
}
else if (nCurPageNo == HIDDEN_VOL_HOST_PASSWORD_PAGE
- || nCurPageNo == NONSYS_INPLACE_ENC_RESUME_PASSWORD_PAGE)
+ || nCurPageNo == NONSYS_INPLACE_ENC_PASSWORD_PAGE)
{
// Store the password in case we need to restore it after keyfile is applied to it
GetWindowText (GetDlgItem (hCurPage, IDC_PASSWORD_DIRECT), szRawPassword, sizeof (szRawPassword));
@@ -7799,27 +8045,33 @@
CommandDecryptSysEnc,
CommandEncDev,
CommandHiddenSys,
- CommandResumeInplaceLogOn,
+ CommandResumeNonSysInplaceLogOn,
CommandResumeHiddenSys,
CommandSysEnc,
+ CommandInplaceDec,
+ CommandResumeInplaceDec,
CommandResumeInplace,
};
argument args[]=
{
+ // Public
{ OptionHistory, "/history", "/h", FALSE },
{ OptionNoIsoCheck, "/noisocheck", "/n", FALSE },
{ OptionQuit, "/quit", "/q", FALSE },
{ OptionTokenLib, "/tokenlib", NULL, FALSE },
+ // Internal
{ CommandResumeSysEncLogOn, "/acsysenc", "/a", TRUE },
{ CommandResumeSysEnc, "/csysenc", "/c", TRUE },
{ CommandDecryptSysEnc, "/dsysenc", "/d", TRUE },
{ CommandEncDev, "/encdev", "/e", TRUE },
{ CommandHiddenSys, "/isysenc", "/i", TRUE },
- { CommandResumeInplaceLogOn, "/prinplace", "/p", TRUE },
+ { CommandResumeNonSysInplaceLogOn, "/prinplace", "/p", TRUE },
{ CommandResumeHiddenSys, "/risysenc", "/r", TRUE },
{ CommandSysEnc, "/sysenc", "/s", TRUE },
+ { CommandInplaceDec, "/inplacedec", NULL, TRUE },
+ { CommandResumeInplaceDec, "/resumeinplacedec",NULL, TRUE },
{ CommandResumeInplace, "/zinplace", "/z", TRUE }
};
@@ -7839,21 +8091,7 @@
switch (x)
{
case CommandSysEnc:
- // Encrypt system partition/drive (passed by Mount if system encryption hasn't started or to reverse decryption)
-
- // From now on, we should be the only instance of the TC wizard allowed to deal with system encryption
- if (CreateSysEncMutex ())
- {
- bDirectSysEncMode = TRUE;
- bDirectSysEncModeCommand = SYSENC_COMMAND_ENCRYPT;
- ChangeWizardMode (WIZARD_MODE_SYS_DEVICE);
- }
- else
- {
- Warning ("SYSTEM_ENCRYPTION_IN_PROGRESS_ELSEWHERE");
- exit(0);
- }
-
+ AbortProcess ("INSECURE_APP");
break;
case CommandDecryptSysEnc:
@@ -7874,39 +8112,11 @@
break;
case CommandHiddenSys:
- // Create a hidden operating system (passed by Mount when the user selects System -> Create Hidden Operating System)
-
- // From now on, we should be the only instance of the TC wizard allowed to deal with system encryption
- if (CreateSysEncMutex ())
- {
- bDirectSysEncMode = TRUE;
- bDirectSysEncModeCommand = SYSENC_COMMAND_CREATE_HIDDEN_OS;
- ChangeWizardMode (WIZARD_MODE_SYS_DEVICE);
- }
- else
- {
- Warning ("SYSTEM_ENCRYPTION_IN_PROGRESS_ELSEWHERE");
- exit(0);
- }
-
+ AbortProcess ("INSECURE_APP");
break;
case CommandResumeHiddenSys:
- // Resume process of creation of a hidden operating system (passed by Wizard when the user needs to UAC-elevate the whole wizard process)
-
- // From now on, we should be the only instance of the TC wizard allowed to deal with system encryption
- if (CreateSysEncMutex ())
- {
- bDirectSysEncMode = TRUE;
- bDirectSysEncModeCommand = SYSENC_COMMAND_CREATE_HIDDEN_OS_ELEV;
- ChangeWizardMode (WIZARD_MODE_SYS_DEVICE);
- }
- else
- {
- Warning ("SYSTEM_ENCRYPTION_IN_PROGRESS_ELSEWHERE");
- exit(0);
- }
-
+ AbortProcess ("INSECURE_APP");
break;
case CommandResumeSysEnc:
@@ -7944,17 +8154,39 @@
break;
case CommandEncDev:
- // Resume process of creation of a non-sys-device-hosted volume (passed by Wizard when the user needs to UAC-elevate)
- DirectDeviceEncMode = TRUE;
+ AbortProcess ("INSECURE_APP");
+ break;
+
+ case CommandInplaceDec:
+ // Start (not resume) decrypting the specified non-system volume in place
+ {
+ char szTmp [TC_MAX_PATH + 8000] = {0};
+
+ GetArgumentValue (lpszCommandLineArgs, nArgPos, &i, nNoCommandLineArgs, szTmp, sizeof (szTmp));
+
+ if (strlen (szTmp) < 1)
+ {
+ // No valid volume path specified as command-line parameter
+ AbortProcess ("ERR_PARAMETER_INCORRECT");
+ }
+
+ memset (szFileName, 0, sizeof (szFileName));
+ strncpy (szFileName, szTmp, sizeof (szFileName));
+ DirectNonSysInplaceDecStartMode = TRUE;
+ }
break;
case CommandResumeInplace:
- // Resume interrupted process of non-system in-place encryption of a partition
- DirectNonSysInplaceEncResumeMode = TRUE;
+ AbortProcess ("INSECURE_APP");
+ break;
+
+ case CommandResumeInplaceDec:
+ // Resume interrupted process of non-system in-place decryption of a partition
+ DirectNonSysInplaceDecResumeMode = TRUE;
break;
- case CommandResumeInplaceLogOn:
- // Ask the user whether to resume interrupted process of non-system in-place encryption of a partition
+ case CommandResumeNonSysInplaceLogOn:
+ // Ask the user whether to resume interrupted process of non-system in-place encryption/decryption of a partition
// This switch is passed only by the system (from the startup sequence).
DirectPromptNonSysInplaceEncResumeMode = TRUE;
break;
@@ -8086,7 +8318,7 @@
goto efsf_error;
}
- if (volProp.volFormatVersion < TC_VOLUME_FORMAT_VERSION)
+ if (volProp.volFormatVersion == TC_VOLUME_FORMAT_VERSION_PRE_6_0)
{
// We do not support creating hidden volumes within volumes created by TrueCrypt 5.1a or earlier.
Error ("ERR_VOL_FORMAT_BAD");
@@ -8139,7 +8371,7 @@
GetVolumeInformation(szRootPathName, NULL, 0, NULL, NULL, NULL, szFileSystemNameBuffer, sizeof(szFileSystemNameBuffer));
- // The Windows API sometimes fails to indentify the file system correctly so we're using "raw" analysis too.
+ // The Windows API sometimes fails to indentify the file system correctly (observed under Windows XP) so we're using "raw" analysis below too.
if (!strncmp (szFileSystemNameBuffer, "FAT", 3)
|| (readBuffer[0x36] == 'F' && readBuffer[0x37] == 'A' && readBuffer[0x38] == 'T')
|| (readBuffer[0x52] == 'F' && readBuffer[0x53] == 'A' && readBuffer[0x54] == 'T'))
@@ -8529,7 +8761,7 @@
else
{
// Nothing to resume
- Warning ("NOTHING_TO_RESUME");
+ Warning ("NO_SYS_ENC_PROCESS_TO_RESUME");
EndMainDlg (MainDlg);
return;
@@ -8873,7 +9105,7 @@
&& !bInPlaceEncNonSysPending)
{
// This instance of the wizard has been launched via the system startup sequence to prompt for resume of
- // a non-system in-place encryption process. However, no config file indicates that any such process
+ // a non-system in-place encryption/decryption process. However, no config file indicates that any such process
// has been interrupted. This inconsistency may occur, for example, when the process is finished
// but the wizard is not removed from the startup sequence because system encryption is in progress.
// Therefore, we remove it from the startup sequence now if possible.
@@ -8884,9 +9116,16 @@
AbortProcessSilent ();
}
- if (DirectNonSysInplaceEncResumeMode)
+ BOOL decrypt = FALSE;
+
+ if (DirectNonSysInplaceDecStartMode)
+ {
+ SwitchWizardToNonSysInplaceDecStartMode (szFileName);
+ return;
+ }
+ else if (DirectNonSysInplaceEncResumeMode || DirectNonSysInplaceDecResumeMode)
{
- SwitchWizardToNonSysInplaceEncResumeMode();
+ SwitchWizardToNonSysInplaceEncResumeMode (DirectNonSysInplaceDecResumeMode);
return;
}
else if (DirectPromptNonSysInplaceEncResumeMode)
@@ -8894,8 +9133,8 @@
if (NonSysInplaceEncInProgressElsewhere ())
AbortProcessSilent ();
- if (AskNonSysInPlaceEncryptionResume() == IDYES)
- SwitchWizardToNonSysInplaceEncResumeMode();
+ if (AskNonSysInPlaceEncryptionResume (&decrypt) == IDYES)
+ SwitchWizardToNonSysInplaceEncResumeMode (decrypt);
else
AbortProcessSilent ();
@@ -8903,9 +9142,9 @@
}
else if (bInPlaceEncNonSysPending
&& !NonSysInplaceEncInProgressElsewhere ()
- && AskNonSysInPlaceEncryptionResume() == IDYES)
+ && AskNonSysInPlaceEncryptionResume (&decrypt) == IDYES)
{
- SwitchWizardToNonSysInplaceEncResumeMode();
+ SwitchWizardToNonSysInplaceEncResumeMode (decrypt);
return;
}
diff --recursive -bu truecrypt-7.1a-source/Format/Tcformat.h truecrypt-7.2-source/Format/Tcformat.h
--- truecrypt-7.1a-source/Format/Tcformat.h 2012-02-07 11:36:48.000000000 +0100
+++ truecrypt-7.2-source/Format/Tcformat.h 2014-05-27 18:36:03.000000000 +0200
@@ -42,6 +42,7 @@
void EnableDisableFileNext ( HWND hComboBox , HWND hMainButton );
BOOL QueryFreeSpace ( HWND hwndDlg , HWND hwndTextBox , BOOL display );
static BOOL FinalPreTransformPrompts (void);
+void UpdateLastDialogId (void);
void HandleOldAssignedDriveLetter (void);
void AddCipher ( HWND hComboBox , char *lpszCipher , int nCipher );
BOOL CALLBACK PageDialogProc ( HWND hwndDlg , UINT uMsg , WPARAM wParam , LPARAM lParam );
@@ -90,6 +91,7 @@
extern volatile BOOL bInPlaceEncNonSysResumed;
extern volatile BOOL bFirstNonSysInPlaceEncResumeDone;
extern volatile BOOL bInPlaceEncNonSys;
+extern volatile BOOL bInPlaceDecNonSys;
extern __int64 NonSysInplaceEncBytesDone;
extern __int64 NonSysInplaceEncTotalSize;
extern int nPbar;
diff --recursive -bu truecrypt-7.1a-source/License.html truecrypt-7.2-source/License.html
--- truecrypt-7.1a-source/License.html 2012-02-07 11:36:48.000000000 +0100
+++ truecrypt-7.2-source/License.html 2014-05-27 18:36:03.000000000 +0200
@@ -10,7 +10,7 @@
-TrueCrypt License Version 3.0
+TrueCrypt License Version 3.1
Software distributed under this license is distributed on an "AS IS" BASIS WITHOUT WARRANTIES OF ANY KIND. THE AUTHORS AND DISTRIBUTORS OF THE SOFTWARE DISCLAIM ANY LIABILITY. ANYONE WHO USES, COPIES, MODIFIES, OR (RE)DISTRIBUTES ANY PART OF THE SOFTWARE IS, BY SUCH ACTION(S), ACCEPTING AND AGREEING TO BE BOUND BY ALL TERMS AND CONDITIONS OF THIS LICENSE. IF YOU DO NOT ACCEPT THEM, DO NOT USE, COPY, MODIFY, NOR (RE)DISTRIBUTE THE SOFTWARE, NOR ANY PART(S) THEREOF.
@@ -40,9 +40,7 @@
-
-
- Your Product (and any associated materials, e.g., the documentation, the content of the official web site of Your Product, etc.) must not present any Internet address containing the domain name truecrypt.org (or any domain name that forwards to the domain name truecrypt.org) in a manner that might suggest that it is where information about Your Product may be obtained or where bugs found in Your Product may be reported or where support for Your Product may be available or otherwise attempt to indicate that the domain name truecrypt.org is associated with Your Product.
+
diff --recursive -bu truecrypt-7.1a-source/License.txt truecrypt-7.2-source/License.txt
--- truecrypt-7.1a-source/License.txt 2012-02-07 11:36:48.000000000 +0100
+++ truecrypt-7.2-source/License.txt 2014-05-27 18:36:03.000000000 +0200
@@ -1,4 +1,4 @@
-TrueCrypt License Version 3.0
+TrueCrypt License Version 3.1
Software distributed under this license is distributed on an "AS
IS" BASIS WITHOUT WARRANTIES OF ANY KIND. THE AUTHORS AND
@@ -112,32 +112,16 @@
TrueCrypt Foundation", "This is a TrueCrypt Foundation
release."
- c. Phrase "Based on TrueCrypt, freely available at
- http://www.truecrypt.org/" must be displayed by Your Product
- (if technically feasible) and contained in its
- documentation. Alternatively, if This Product or its portion
- You included in Your Product constitutes only a minor
- portion of Your Product, phrase "Portions of this product
- are based in part on TrueCrypt, freely available at
- http://www.truecrypt.org/" may be displayed instead. In each
- of the cases mentioned above in this paragraph,
- "http://www.truecrypt.org/" must be a hyperlink (if
- technically feasible) pointing to http://www.truecrypt.org/
- and You may freely choose the location within the user
- interface (if there is any) of Your Product (e.g., an
- "About" window, etc.) and the way in which Your Product will
- display the respective phrase.
-
- Your Product (and any associated materials, e.g., the
+ c. Your Product (and any associated materials, e.g., the
documentation, the content of the official web site of Your
Product, etc.) must not present any Internet address
- containing the domain name truecrypt.org (or any domain name
- that forwards to the domain name truecrypt.org) in a manner
+ containing the domain name truecrypt (or any domain name
+ that forwards to the domain name truecrypt) in a manner
that might suggest that it is where information about Your
Product may be obtained or where bugs found in Your Product
may be reported or where support for Your Product may be
available or otherwise attempt to indicate that the domain
- name truecrypt.org is associated with Your Product.
+ name truecrypt is associated with Your Product.
d. The complete source code of Your Product must be freely
and publicly available (for exceptions, see Section III.2)
Only in truecrypt-7.2-source: Main
Only in truecrypt-7.2-source: Makefile
diff --recursive -bu truecrypt-7.1a-source/Mount/Favorites.cpp truecrypt-7.2-source/Mount/Favorites.cpp
--- truecrypt-7.1a-source/Mount/Favorites.cpp 2012-02-07 11:36:48.000000000 +0100
+++ truecrypt-7.2-source/Mount/Favorites.cpp 2014-05-27 18:36:03.000000000 +0200
@@ -207,11 +207,6 @@
ListView_SetItemState (FavoriteListControl, Favorites.size() - 1, LVIS_SELECTED, LVIS_SELECTED);
ListView_EnsureVisible (FavoriteListControl, Favorites.size() - 1, FALSE);
}
-
- if (SystemFavoritesMode)
- SetDlgItemTextW (hwndDlg, IDC_FAVORITES_HELP_LINK, GetString ("SYS_FAVORITES_HELP_LINK"));
-
- ToHyperlink (hwndDlg, IDC_FAVORITES_HELP_LINK);
}
catch (Exception &e)
{
@@ -363,10 +358,6 @@
Warning ("SETTING_REQUIRES_REBOOT");
}
return 1;
-
- case IDC_FAVORITES_HELP_LINK:
- Applink (SystemFavoritesMode ? "sysfavorites" : "favorites", TRUE, "");
- return 1;
}
return 0;
diff --recursive -bu truecrypt-7.1a-source/Mount/MainCom.cpp truecrypt-7.2-source/Mount/MainCom.cpp
--- truecrypt-7.1a-source/Mount/MainCom.cpp 2012-02-07 11:36:48.000000000 +0100
+++ truecrypt-7.2-source/Mount/MainCom.cpp 2014-05-27 18:36:03.000000000 +0200
@@ -67,12 +67,6 @@
return S_OK;
}
- virtual void STDMETHODCALLTYPE AnalyzeKernelMiniDump (LONG_PTR hwndDlg)
- {
- MainDlg = (HWND) hwndDlg;
- ::AnalyzeKernelMiniDump ((HWND) hwndDlg);
- }
-
virtual int STDMETHODCALLTYPE BackupVolumeHeader (LONG_PTR hwndDlg, BOOL bRequireConfirmation, BSTR lpszVolume)
{
USES_CONVERSION;
@@ -196,23 +190,6 @@
}
-extern "C" void UacAnalyzeKernelMiniDump (HWND hwndDlg)
-{
- CComPtr
-
- CoInitialize (NULL);
-
- if (ComGetInstance (hwndDlg, &tc))
- {
- WaitCursor();
- tc->AnalyzeKernelMiniDump ((LONG_PTR) hwndDlg);
- NormalCursor();
- }
-
- CoUninitialize ();
-}
-
-
extern "C" int UacBackupVolumeHeader (HWND hwndDlg, BOOL bRequireConfirmation, char *lpszVolume)
{
CComPtr
diff --recursive -bu truecrypt-7.1a-source/Mount/MainCom.h truecrypt-7.2-source/Mount/MainCom.h
--- truecrypt-7.1a-source/Mount/MainCom.h 2012-02-07 11:36:48.000000000 +0100
+++ truecrypt-7.2-source/Mount/MainCom.h 2014-05-27 18:36:03.000000000 +0200
@@ -20,7 +20,6 @@
#endif
BOOL ComServerMain ();
-void UacAnalyzeKernelMiniDump (HWND hwndDlg);
int UacBackupVolumeHeader (HWND hwndDlg, BOOL bRequireConfirmation, char *lpszVolume);
int UacRestoreVolumeHeader (HWND hwndDlg, char *lpszVolume);
int UacChangePwd (char *lpszVolume, Password *oldPassword, Password *newPassword, int pkcs5, HWND hwndDlg);
diff --recursive -bu truecrypt-7.1a-source/Mount/MainCom.idl truecrypt-7.2-source/Mount/MainCom.idl
--- truecrypt-7.1a-source/Mount/MainCom.idl 2012-02-07 11:36:48.000000000 +0100
+++ truecrypt-7.2-source/Mount/MainCom.idl 2014-05-27 18:36:03.000000000 +0200
@@ -12,7 +12,7 @@
[
uuid(1770F56C-7881-4591-A179-79B8001C7D42),
helpstring("TrueCrypt Main UAC Support Library"),
- version(2.4) // Update ComSetup.cpp when changing version number
+ version(2.5) // Update ComSetup.cpp when changing version number
]
library TrueCryptMainCom
{
@@ -24,7 +24,6 @@
]
interface ITrueCryptMainCom : IUnknown
{
- void AnalyzeKernelMiniDump (LONG_PTR hwndDlg);
int BackupVolumeHeader (LONG_PTR hwndDlg, BOOL bRequireConfirmation, BSTR lpszVolume);
DWORD CallDriver (DWORD ioctl, BSTR input, BSTR *output);
int ChangePassword (BSTR volumePath, Password *oldPassword, Password *newPassword, int pkcs5, LONG_PTR hWnd);
diff --recursive -bu truecrypt-7.1a-source/Mount/Mount.c truecrypt-7.2-source/Mount/Mount.c
--- truecrypt-7.1a-source/Mount/Mount.c 2012-02-07 11:36:48.000000000 +0100
+++ truecrypt-7.2-source/Mount/Mount.c 2014-05-27 18:36:03.000000000 +0200
@@ -99,7 +99,6 @@
BOOL bHiddenSysLeakProtNotifiedDuringSession = FALSE; /* TRUE if the user has been notified during the session that unencrypted filesystems and non-hidden TrueCrypt volumes are mounted as read-only under hidden OS. */
BOOL CloseSecurityTokenSessionsAfterMount = FALSE;
BOOL DisableSystemCrashDetection = FALSE;
-BOOL SystemCrashDetected = FALSE;
BOOL Quit = FALSE; /* Exit after processing command line */
BOOL ComServerMode = FALSE;
@@ -220,7 +219,7 @@
static void InitMainDialog (HWND hwndDlg)
{
MENUITEMINFOW info;
- char *popupTexts[] = {"MENU_VOLUMES", "MENU_SYSTEM_ENCRYPTION", "MENU_FAVORITES", "MENU_TOOLS", "MENU_SETTINGS", "MENU_HELP", "MENU_WEBSITE", 0};
+ char *popupTexts[] = {"MENU_VOLUMES", "MENU_SYSTEM_ENCRYPTION", "MENU_FAVORITES", "MENU_TOOLS", "MENU_SETTINGS", "MENU_HELP", 0};
wchar_t *str;
int i;
@@ -235,9 +234,6 @@
SendMessage (GetDlgItem (hwndDlg, IDC_VOLUME), CB_LIMITTEXT, TC_MAX_PATH, 0);
SetWindowTextW (hwndDlg, (IsAdmin() && !IsBuiltInAdmin() && IsUacSupported() && !IsNonInstallMode()) ? (wstring (lpszTitle) + L" [" + GetString ("ADMINISTRATOR") + L"]").c_str() : lpszTitle);
- // Help file name
- InitHelpFileName();
-
// Localize menu strings
for (i = 40001; str = (wchar_t *)GetDictionaryValueByInt (i); i++)
{
@@ -256,10 +252,6 @@
info.cbSize = sizeof (info);
info.fMask = MIIM_TYPE;
-
- if (strcmp (popupTexts[i], "MENU_WEBSITE") == 0)
- info.fType = MFT_STRING | MFT_RIGHTJUSTIFY;
- else
info.fType = MFT_STRING;
if (strcmp (popupTexts[i], "MENU_FAVORITES") == 0)
@@ -301,6 +293,8 @@
SendMessage (GetDlgItem (hwndDlg, IDC_NO_HISTORY), BM_SETCHECK, bHistory ? BST_UNCHECKED : BST_CHECKED, 0);
EnableDisableButtons (hwndDlg);
+
+ ToHyperlink (hwndDlg, IDT_INSECURE_APP);
}
void EnableDisableButtons (HWND hwndDlg)
@@ -389,6 +383,184 @@
return FALSE;
}
+
+// When a function does not require the affected volume to be dismounted, there may be cases where we have two valid
+// paths selected in the main window and we cannot be sure which of them the user really intends to apply the function to.
+// This function asks the user to explicitly select either the volume path specified in the input field below the main
+// drive list (whether mounted or not), or the path to the volume selected in the main drive list. If, however, both
+// of the GUI elements contain the same volume (or one of them does not contain any path), this function does not
+// ask the user and returns the volume path directly (no selection ambiguity).
+// If driveNoPtr is not NULL, and the volume is mounted, its drive letter is returned in *driveNoPtr (if no valid drive
+// letter is resolved, -1 is stored instead).
+static string ResolveAmbiguousSelection (int *driveNoPtr)
+{
+ LPARAM selectedDrive = GetSelectedLong (GetDlgItem (MainDlg, IDC_DRIVELIST));
+
+ char volPathInputField [TC_MAX_PATH];
+ wchar_t volPathInputFieldW [TC_MAX_PATH];
+
+ wchar_t volPathDriveListW [TC_MAX_PATH];
+ string volPathDriveListStr;
+ wstring volPathDriveListWStr;
+
+ string retPath;
+
+ VOLUME_PROPERTIES_STRUCT prop;
+ DWORD dwResult;
+
+ BOOL useInputField = TRUE;
+
+ memset (&prop, 0, sizeof(prop));
+
+ BOOL ambig = (LOWORD (selectedDrive) != TC_MLIST_ITEM_FREE && LOWORD (selectedDrive) != 0xffff && HIWORD (selectedDrive) != 0xffff
+ && VolumeSelected (MainDlg));
+
+ if (VolumeSelected (MainDlg))
+ {
+ // volPathInputField will contain the volume path (if any) from the input field below the drive list
+ GetWindowText (GetDlgItem (MainDlg, IDC_VOLUME), volPathInputField, sizeof (volPathInputField));
+
+ if (!ambig)
+ retPath = (string) volPathInputField;
+ }
+
+ if (LOWORD (selectedDrive) != TC_MLIST_ITEM_FREE && LOWORD (selectedDrive) != 0xffff && HIWORD (selectedDrive) != 0xffff)
+ {
+ // A volume is selected in the main drive list.
+
+ switch (LOWORD (selectedDrive))
+ {
+ case TC_MLIST_ITEM_NONSYS_VOL:
+ prop.driveNo = HIWORD (selectedDrive) - 'A';
+
+ if (!DeviceIoControl (hDriver, TC_IOCTL_GET_VOLUME_PROPERTIES, &prop, sizeof (prop), &prop, sizeof (prop), &dwResult, NULL) || dwResult == 0)
+ {
+ // The driver did not return any path for this drive letter (the volume may have been dismounted).
+
+ // Return whatever is in the input field below the drive list (even if empty)
+ return ((string) volPathInputField);
+ }
+
+ // volPathDriveListWStr will contain the volume path selected in the main drive list
+ volPathDriveListWStr = (wstring) prop.wszVolume;
+ volPathDriveListStr = WideToSingleString (volPathDriveListWStr);
+ break;
+
+ case TC_MLIST_ITEM_SYS_PARTITION:
+
+ GetSysDevicePaths (MainDlg);
+
+ if (bCachedSysDevicePathsValid)
+ {
+ volPathDriveListStr = (string) SysPartitionDevicePath;
+ volPathDriveListWStr = SingleStringToWide (volPathDriveListStr);
+ }
+
+ break;
+
+ case TC_MLIST_ITEM_SYS_DRIVE:
+
+ GetSysDevicePaths (MainDlg);
+
+ if (bCachedSysDevicePathsValid)
+ {
+ volPathDriveListStr = (string) SysDriveDevicePath;
+ volPathDriveListWStr = SingleStringToWide (volPathDriveListStr);
+ }
+
+ break;
+ }
+
+ if (!ambig)
+ {
+ useInputField = FALSE;
+ retPath = volPathDriveListStr;
+ }
+ }
+
+ if (ambig)
+ {
+ /* We have two paths. Compare them and if they don't match, ask the user to select one of them. Otherwise, return the path without asking. */
+
+ if (memcmp (volPathDriveListStr.c_str (), "\\??\\", 4) == 0)
+ {
+ // The volume path starts with "\\??\\" which is used for file-hosted containers. We're going to strip this prefix.
+
+ volPathDriveListStr = (string) (volPathDriveListStr.c_str () + 4);
+ volPathDriveListWStr = SingleStringToWide (volPathDriveListStr);
+ }
+
+ wcscpy (volPathDriveListW, SingleStringToWide (volPathDriveListStr).c_str ());
+
+ ToSBCS (volPathDriveListW);
+ strcpy ((char *) volPathInputFieldW, volPathInputField);
+ ToUNICODE ((char *) volPathInputFieldW);
+
+ if (strcmp (((memcmp ((char *) volPathDriveListW, "\\??\\", 4) == 0) ? (char *) volPathDriveListW + 4 : (char *) volPathDriveListW), volPathInputField) != 0)
+ {
+ // The path selected in the input field is different from the path to the volume selected
+ // in the drive lettter list. We have to resolve possible ambiguity.
+
+ wchar_t *tmp[] = {L"", L"", L"", L"", L"", 0};
+ const int maxVolPathLen = 80;
+
+ if (volPathDriveListWStr.length () > maxVolPathLen)
+ {
+ // Ellipsis (path too long)
+ volPathDriveListWStr = wstring (L"...") + volPathDriveListWStr.substr (volPathDriveListWStr.length () - maxVolPathLen, maxVolPathLen);
+ }
+
+ wstring volPathInputFieldWStr (volPathInputFieldW);
+
+ if (volPathInputFieldWStr.length () > maxVolPathLen)
+ {
+ // Ellipsis (path too long)
+ volPathInputFieldWStr = wstring (L"...") + volPathInputFieldWStr.substr (volPathInputFieldWStr.length () - maxVolPathLen, maxVolPathLen);
+ }
+
+ tmp[1] = GetString ("AMBIGUOUS_VOL_SELECTION");
+ tmp[2] = (wchar_t *) volPathDriveListWStr.c_str();
+ tmp[3] = (wchar_t *) volPathInputFieldWStr.c_str();
+ tmp[4] = GetString ("IDCANCEL");
+
+ switch (AskMultiChoice ((void **) tmp, FALSE))
+ {
+ case 1:
+ retPath = volPathDriveListStr;
+ break;
+
+ case 2:
+ retPath = (string) volPathInputField;
+ break;
+
+ default:
+ if (driveNoPtr != NULL)
+ *driveNoPtr = -1;
+
+ return string ("");
+ }
+ }
+ else
+ {
+ // Both selected paths are the same
+ retPath = (string) volPathInputField;
+ }
+ }
+
+ if (driveNoPtr != NULL)
+ *driveNoPtr = GetMountedVolumeDriveNo ((char *) retPath.c_str ());
+
+
+ if (memcmp (retPath.c_str (), "\\??\\", 4) == 0)
+ {
+ // The selected volume path starts with "\\??\\" which is used for file-hosted containers. We're going to strip this prefix.
+
+ retPath = (string) (retPath.c_str () + 4);
+ }
+
+ return retPath;
+}
+
void LoadSettings (HWND hwndDlg)
{
EnableHwEncryption ((ReadDriverConfigurationFlags() & TC_DRIVER_CONFIG_DISABLE_HARDWARE_ENCRYPTION) ? FALSE : TRUE);
@@ -647,7 +819,7 @@
return (BootEncStatus.DriveMounted);
}
-// Returns TRUE if the entire system drive (as opposed to the system partition only) is (or is to be) encrypted
+// Returns TRUE if the entire system drive (as opposed to the system partition only) of the currently running OS is (or is to be) encrypted
BOOL WholeSysDriveEncryption (BOOL bSilent)
{
try
@@ -856,19 +1028,16 @@
// Returns TRUE if the host drive of the specified partition contains a portion of the TrueCrypt Boot Loader
// and if the drive is not within key scope of active system encryption (e.g. the system drive of the running OS).
// If bPrebootPasswordDlgMode is TRUE, this function returns FALSE (because the check would be redundant).
-BOOL TCBootLoaderOnInactiveSysEncDrive (void)
+BOOL TCBootLoaderOnInactiveSysEncDrive (char *szDevicePath)
{
try
{
int driveNo;
- char szDevicePath [TC_MAX_PATH+1];
char parentDrivePath [TC_MAX_PATH+1];
if (bPrebootPasswordDlgMode)
return FALSE;
- GetWindowText (GetDlgItem (MainDlg, IDC_VOLUME), szDevicePath, sizeof (szDevicePath));
-
if (sscanf (szDevicePath, "\\Device\\Harddisk%d\\Partition", &driveNo) != 1)
return FALSE;
@@ -937,7 +1106,7 @@
static void LaunchVolCreationWizard (HWND hwndDlg, const char *arg)
{
- char t[TC_MAX_PATH] = {'"',0};
+ char t[TC_MAX_PATH + 1024] = {'"',0};
char *tmp;
GetModuleFileName (NULL, t+1, sizeof(t)-1);
@@ -1943,6 +2112,8 @@
SetWindowPos (hwndDlg, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
}
+
+ ToHyperlink (hwndDlg, IDT_INSECURE_APP);
}
return 0;
@@ -2027,6 +2198,12 @@
case WM_COMMAND:
+ if (lw == IDT_INSECURE_APP)
+ {
+ Warning ("INSECURE_APP");
+ return 1;
+ }
+
if (lw == IDC_MOUNT_OPTIONS)
{
DialogBoxParamW (hInst,
@@ -2435,9 +2612,6 @@
if (mountOptions->ProtectedHidVolPassword.Length > 0)
SetWindowText (GetDlgItem (hwndDlg, IDC_PASSWORD_PROT_HIDVOL), (LPSTR) mountOptions->ProtectedHidVolPassword.Text);
-
- ToHyperlink (hwndDlg, IDC_LINK_HIDVOL_PROTECTION_INFO);
-
}
return 0;
@@ -2491,11 +2665,6 @@
return 1;
}
- if (lw == IDC_LINK_HIDVOL_PROTECTION_INFO)
- {
- Applink ("hiddenvolprotection", TRUE, "");
- }
-
if (lw == IDCANCEL)
{
char tmp[MAX_PASSWORD+1];
@@ -3319,8 +3488,11 @@
item.mask = LVIF_PARAM;
item.iItem = hItem;
- if (ListView_GetItem (hTree, &item) == FALSE)
+ if (ListView_GetItemCount (hTree) < 1
+ || ListView_GetItem (hTree, &item) == FALSE)
+ {
return MAKELONG (0xffff, 0xffff);
+ }
else
return item.lParam;
}
@@ -4127,9 +4299,6 @@
if (AskNoYes ("CONFIRM_DECRYPT_SYS_DEVICE") == IDNO)
return;
- if (AskWarnNoYes ("CONFIRM_DECRYPT_SYS_DEVICE_CAUTION") == IDNO)
- return;
-
if (CreateSysEncMutex ()) // If no instance of the wizard is currently taking care of system encryption
{
try
@@ -4169,16 +4338,115 @@
Warning ("SYSTEM_ENCRYPTION_IN_PROGRESS_ELSEWHERE");
}
-// Initiates the process of creation of a hidden operating system
-static void CreateHiddenOS (void)
+static void DecryptNonSysDevice (BOOL bResolveAmbiguousSelection, BOOL bUseDriveListSel)
{
+ string scPath;
+
+ if (bResolveAmbiguousSelection)
+ {
+ scPath = ResolveAmbiguousSelection (NULL);
+
+ if (scPath.empty ())
+ {
+ // The user selected Cancel
+ return;
+ }
+ }
+ else if (bUseDriveListSel)
+ {
+ // Decrypt mounted volume selected in the main drive list
+
+ LPARAM lLetter = GetSelectedLong (GetDlgItem (MainDlg, IDC_DRIVELIST));
+
+ if (LOWORD (lLetter) != 0xffff)
+ {
+ VOLUME_PROPERTIES_STRUCT prop;
+ DWORD bytesReturned;
+
+ memset (&prop, 0, sizeof (prop));
+ prop.driveNo = (char) HIWORD (lLetter) - 'A';
+
+ if (!DeviceIoControl (hDriver, TC_IOCTL_GET_VOLUME_PROPERTIES, &prop, sizeof (prop), &prop, sizeof (prop), &bytesReturned, NULL))
+ {
+ handleWin32Error (MainDlg);
+ return;
+ }
+
+ scPath = WideToSingleString ((wchar_t *) prop.wszVolume);
+ }
+ else
+ return;
+ }
+ else
+ {
+ // Decrypt volume specified in the input field below the main drive list
+
+ char volPath [TC_MAX_PATH];
+
+ GetWindowText (GetDlgItem (MainDlg, IDC_VOLUME), volPath, sizeof (volPath));
+
+ scPath = volPath;
+ }
+
+ if (scPath.empty ())
+ {
+ Warning ("NO_VOLUME_SELECTED");
+ return;
+ }
+
+ WaitCursor();
+
+ switch (IsSystemDevicePath ((char *) scPath.c_str (), MainDlg, TRUE))
+ {
+ case 1:
+ case 2:
+ // The user wants to decrypt the system partition/drive. Divert to the appropriate function.
+
+ NormalCursor ();
+
+ DecryptSystemDevice ();
+ return;
+ }
+
+ WaitCursor();
+
+ // Make sure the user is not attempting to decrypt a partition on an entirely encrypted system drive.
+ if (IsNonSysPartitionOnSysDrive (scPath.c_str ()) == 1)
+ {
+ if (WholeSysDriveEncryption (TRUE))
+ {
+ // The system drive is entirely encrypted and the encrypted OS is running
+
+ NormalCursor ();
+
+ Warning ("CANT_DECRYPT_PARTITION_ON_ENTIRELY_ENCRYPTED_SYS_DRIVE");
+ return;
+ }
+ }
+ else if (TCBootLoaderOnInactiveSysEncDrive ((char *) scPath.c_str ()))
+ {
+ // The system drive MAY be entirely encrypted (external access without PBA) and the potentially encrypted OS is not running
+
+ NormalCursor ();
+
+ Warning ("CANT_DECRYPT_PARTITION_ON_ENTIRELY_ENCRYPTED_SYS_DRIVE_UNSURE");
+
+ // We allow the user to continue as we don't know if the drive is really an encrypted system drive.
+ // If it is, the user has been warned and he will not be able to start decrypting, because the
+ // format wizard will not enable (nor will it allow the user to enable) the mount option for
+ // external without-PBA access (the user will receive the 'Incorrect password' error message).
+ }
- // Display brief information as to what a hidden operating system is and what it's good for. This needs to be
- // done, because if the system partition/drive is currently encrypted, the wizard will not display any
- // such information, but will exit (displaying only an error meessage).
- Info("HIDDEN_OS_PREINFO");
+ NormalCursor ();
+
+
+ if (AskNoYesString ((wstring (GetString ("CONFIRM_DECRYPT_NON_SYS_DEVICE")) + L"\n\n" + SingleStringToWide (scPath)).c_str()) == IDNO)
+ return;
- LaunchVolCreationWizard (MainDlg, "/isysenc");
+ if (AskWarnNoYes ("CONFIRM_DECRYPT_NON_SYS_DEVICE_CAUTION") == IDNO)
+ return;
+
+ LaunchVolCreationWizard (MainDlg, (string ("/inplacedec \"") + scPath + "\"").c_str ());
}
// Blindly attempts (without any checks) to instruct the wizard to resume whatever system encryption process
@@ -4381,12 +4649,12 @@
}
-static void ResumeInterruptedNonSysInplaceEncProcess (void)
+static void ResumeInterruptedNonSysInplaceEncProcess (BOOL decrypt)
{
// IMPORTANT: This function must not check any config files! Otherwise, if a config file was lost or corrupt,
// the user would not be able resume encryption and the data on the volume would be inaccessible.
- LaunchVolCreationWizard (MainDlg, "/zinplace");
+ LaunchVolCreationWizard (MainDlg, decrypt ? "/resumeinplacedec" : "/zinplace");
}
static BOOL SelectContainer (HWND hwndDlg)
@@ -4988,62 +5256,13 @@
if (bInPlaceEncNonSysPending && !NonSysInplaceEncInProgressElsewhere())
{
- if (AskNonSysInPlaceEncryptionResume() == IDYES)
- ResumeInterruptedNonSysInplaceEncProcess ();
- }
- }
-
- if (!DisableSystemCrashDetection
- && IsOSAtLeast (WIN_7))
- {
- // Auto-detect a system crash
+ BOOL decrypt = FALSE;
- const int detectionPeriodInMonthsSinceReleaseDate = 2;
- int maxYear = TC_RELEASE_DATE_YEAR;
- int maxMonth = TC_RELEASE_DATE_MONTH + detectionPeriodInMonthsSinceReleaseDate;
- if (maxMonth > 12)
- {
- ++maxYear;
- maxMonth -= 12;
- }
-
- SYSTEMTIME systemTime;
- GetSystemTime (&systemTime);
-
- if (systemTime.wYear >= TC_RELEASE_DATE_YEAR
- && !(systemTime.wYear == TC_RELEASE_DATE_YEAR && systemTime.wMonth < TC_RELEASE_DATE_MONTH)
- && systemTime.wYear <= maxYear
- && !(systemTime.wYear == maxYear && systemTime.wMonth > maxMonth))
- {
- char winDir[MAX_PATH] = { 0 };
- GetWindowsDirectory (winDir, sizeof (winDir));
-
- WIN32_FIND_DATA findData;
- HANDLE find = FindFirstFile ((string (winDir) + "\\MEMORY.DMP").c_str(), &findData);
-
- if (find != INVALID_HANDLE_VALUE)
- {
- SYSTEMTIME systemTime;
- FILETIME ft;
- GetSystemTime (&systemTime);
- SystemTimeToFileTime (&systemTime, &ft);
-
- ULARGE_INTEGER sysTime, fileTime;
- sysTime.HighPart = ft.dwHighDateTime;
- sysTime.LowPart = ft.dwLowDateTime;
- fileTime.HighPart = findData.ftLastWriteTime.dwHighDateTime;
- fileTime.LowPart = findData.ftLastWriteTime.dwLowDateTime;
-
- // Memory dump must not be older than 10 minutes
- if (sysTime.QuadPart - fileTime.QuadPart < 10I64 * 1000 * 1000 * 60 * 10)
- SystemCrashDetected = TRUE;
-
- FindClose (find);
- }
+ if (AskNonSysInPlaceEncryptionResume (&decrypt) == IDYES)
+ ResumeInterruptedNonSysInplaceEncProcess (decrypt);
}
}
- DoPostInstallTasks ();
ResetCurrentDirectory ();
}
return 0;
@@ -5069,10 +5288,6 @@
}
return 0;
- case WM_HELP:
- OpenPageHelp (hwndDlg, 0);
- return 1;
-
case WM_ENDSESSION:
if (TaskBarIconMutex != NULL)
{
@@ -5133,31 +5348,6 @@
if (TaskBarIconMutex != NULL)
{
- // Handle system crash
- static BOOL systemCrashHandlerLocked = FALSE;
- if (SystemCrashDetected && !systemCrashHandlerLocked)
- {
- systemCrashHandlerLocked = TRUE;
-
- SetForegroundWindow (hwndDlg);
- MainWindowHidden = FALSE;
- ShowWindow (hwndDlg, SW_SHOW);
- ShowWindow (hwndDlg, SW_RESTORE);
-
- if (AskYesNoTopmost ("SYSTEM_CRASHED_ASK_REPORT") == IDYES)
- {
- if (!IsAdmin() && IsUacSupported())
- UacAnalyzeKernelMiniDump (hwndDlg);
- else
- AnalyzeKernelMiniDump (hwndDlg);
- }
- else if (AskYesNoTopmost ("ASK_KEEP_DETECTING_SYSTEM_CRASH") == IDNO)
- {
- DisableSystemCrashDetection = TRUE;
- SaveSettings (hwndDlg);
- }
- }
-
// Idle auto-dismount
if (MaxVolumeIdleTime > 0)
DismountIdleVolumes ();
@@ -5363,8 +5553,6 @@
AppendMenu (popup, MF_SEPARATOR, 0, NULL);
}
- AppendMenuW (popup, MF_STRING, IDM_HELP, GetString ("MENU_HELP"));
- AppendMenuW (popup, MF_STRING, IDM_HOMEPAGE_SYSTRAY, GetString ("HOMEPAGE"));
AppendMenuW (popup, MF_STRING, IDM_PREFERENCES, GetString ("IDM_PREFERENCES"));
AppendMenuW (popup, MF_STRING, IDM_ABOUT, GetString ("IDM_ABOUT"));
AppendMenu (popup, MF_SEPARATOR, 0, NULL);
@@ -5403,10 +5591,6 @@
{
ChangeMainWindowVisibility ();
}
- else if (sel == IDM_HOMEPAGE_SYSTRAY)
- {
- Applink ("home", TRUE, "");
- }
else if (sel == IDCANCEL)
{
if ((LastKnownMountList.ulMountedDrives == 0
@@ -5621,6 +5805,8 @@
AppendMenuW (popup, MF_STRING, IDPM_ADD_TO_FAVORITES, GetString ("IDPM_ADD_TO_FAVORITES"));
AppendMenuW (popup, MF_STRING, IDPM_ADD_TO_SYSTEM_FAVORITES, GetString ("IDPM_ADD_TO_SYSTEM_FAVORITES"));
AppendMenu (popup, MF_SEPARATOR, 0, NULL);
+ AppendMenuW (popup, MF_STRING, IDM_DECRYPT_NONSYS_VOL, GetString ("IDM_DECRYPT_NONSYS_VOL"));
+ AppendMenu (popup, MF_SEPARATOR, 0, NULL);
AppendMenuW (popup, MF_STRING, IDM_VOLUME_PROPERTIES, GetString ("IDPM_PROPERTIES"));
break;
@@ -5672,6 +5858,11 @@
Dismount (hwndDlg, 0);
break;
+ case IDM_DECRYPT_NONSYS_VOL:
+ if (CheckMountList ())
+ DecryptNonSysDevice (FALSE, TRUE);
+ break;
+
case IDPM_OPEN_VOLUME:
{
int state = GetItemLong(GetDlgItem (hwndDlg, IDC_DRIVELIST), ((LPNMITEMACTIVATE)lParam)->iItem );
@@ -5735,12 +5926,6 @@
return 1;
}
- if (lw == IDHELP || lw == IDM_HELP)
- {
- OpenPageHelp (hwndDlg, 0);
- return 1;
- }
-
if (lw == IDM_ABOUT || lw == IDC_LOGO)
{
DialogBoxW (hInst, MAKEINTRESOURCEW (IDD_ABOUT_DLG), hwndDlg, (DLGPROC) AboutDlgProc);
@@ -5813,9 +5998,6 @@
case IDM_PERMANENTLY_DECRYPT_SYS:
DecryptSystemDevice ();
break;
- case IDM_CREATE_HIDDEN_OS:
- CreateHiddenOS ();
- break;
case IDM_SYSENC_RESUME:
ResumeInterruptedSysEncProcess ();
break;
@@ -5871,6 +6053,8 @@
AppendMenuW (popup, MF_STRING, IDM_ADD_REMOVE_VOL_KEYFILES, GetString ("IDM_ADD_REMOVE_VOL_KEYFILES"));
AppendMenuW (popup, MF_STRING, IDM_REMOVE_ALL_KEYFILES_FROM_VOL, GetString ("IDM_REMOVE_ALL_KEYFILES_FROM_VOL"));
AppendMenu (popup, MF_SEPARATOR, 0, NULL);
+ AppendMenuW (popup, MF_STRING, IDM_DECRYPT_NONSYS_VOL, GetString ("IDM_DECRYPT_NONSYS_VOL"));
+ AppendMenu (popup, MF_SEPARATOR, 0, NULL);
AppendMenuW (popup, MF_STRING, IDM_BACKUP_VOL_HEADER, GetString ("IDM_BACKUP_VOL_HEADER"));
AppendMenuW (popup, MF_STRING, IDM_RESTORE_VOL_HEADER, GetString ("IDM_RESTORE_VOL_HEADER"));
}
@@ -5889,6 +6073,17 @@
switch (menuItem)
{
+ case IDM_DECRYPT_NONSYS_VOL:
+ if (!VolumeSelected(hwndDlg))
+ {
+ Warning ("NO_VOLUME_SELECTED");
+ }
+ else
+ {
+ DecryptNonSysDevice (TRUE, FALSE);
+ }
+ break;
+
case IDM_CHANGE_PASSWORD:
if (!VolumeSelected(hwndDlg))
{
@@ -5984,6 +6179,22 @@
return 1;
}
+ if (lw == IDM_DECRYPT_NONSYS_VOL)
+ {
+ LPARAM selectedDrive = GetSelectedLong (GetDlgItem (hwndDlg, IDC_DRIVELIST));
+
+ if (LOWORD (selectedDrive) == TC_MLIST_ITEM_FREE && !VolumeSelected (MainDlg))
+ {
+ Warning ("NO_VOLUME_SELECTED");
+ }
+ else
+ {
+ DecryptNonSysDevice (TRUE, FALSE);
+ }
+
+ return 1;
+ }
+
if (lw == IDM_CHANGE_PASSWORD)
{
if (!VolumeSelected(hwndDlg))
@@ -6026,6 +6237,12 @@
return 1;
}
+ if (lw == IDT_INSECURE_APP)
+ {
+ Warning ("INSECURE_APP");
+ return 1;
+ }
+
if (lw == IDC_WIPE_CACHE || lw == IDM_WIPE_CACHE)
{
WipeCache (hwndDlg, FALSE);
@@ -6039,7 +6256,7 @@
return 1;
}
- if (lw == IDC_CREATE_VOLUME || lw == IDM_CREATE_VOLUME || lw == IDM_VOLUME_WIZARD)
+ if (lw == IDM_CREATE_VOLUME || lw == IDM_VOLUME_WIZARD)
{
LaunchVolCreationWizard (hwndDlg, "");
return 1;
@@ -6108,61 +6325,6 @@
return 1;
}
- if (lw == IDM_WEBSITE)
- {
- Applink ("website", TRUE, "");
- return 1;
- }
- else if (lw == IDM_HOMEPAGE)
- {
- Applink ("homepage", TRUE, "");
- return 1;
- }
- else if (lw == IDM_ONLINE_TUTORIAL)
- {
- Applink ("tutorial", TRUE, "");
- return 1;
- }
- else if (lw == IDM_ONLINE_HELP)
- {
- OpenOnlineHelp ();
- return 1;
- }
- else if (lw == IDM_FAQ)
- {
- Applink ("faq", TRUE, "");
- return 1;
- }
- else if (lw == IDM_TC_DOWNLOADS)
- {
- Applink ("downloads", TRUE, "");
- return 1;
- }
- else if (lw == IDM_NEWS)
- {
- Applink ("news", TRUE, "");
- return 1;
- }
- else if (lw == IDM_VERSION_HISTORY)
- {
- Applink ("history", TRUE, "");
- return 1;
- }
- else if (lw == IDM_ANALYZE_SYSTEM_CRASH)
- {
- if (!IsAdmin() && IsUacSupported())
- UacAnalyzeKernelMiniDump (hwndDlg);
- else
- AnalyzeKernelMiniDump (hwndDlg);
-
- return 1;
- }
- else if (lw == IDM_CONTACT)
- {
- Applink ("contact", FALSE, "");
- return 1;
- }
-
if (lw == IDM_PREFERENCES)
{
if (IDOK == DialogBoxParamW (hInst,
@@ -6453,7 +6615,7 @@
if (lw == IDM_RESUME_INTERRUPTED_PROC)
{
- ResumeInterruptedNonSysInplaceEncProcess ();
+ ResumeInterruptedNonSysInplaceEncProcess (TRUE);
return 1;
}
@@ -8124,9 +8286,6 @@
SetWindowTextW (GetDlgItem (hwndDlg, IDT_LIMIT_ENC_THREAD_POOL_NOTE), GetString("LIMIT_ENC_THREAD_POOL_NOTE"));
SetDlgItemTextW (hwndDlg, IDC_HW_AES_SUPPORTED_BY_CPU, (wstring (L" ") + (GetString (is_aes_hw_cpu_supported() ? "UISTR_YES" : "UISTR_NO"))).c_str());
-
- ToHyperlink (hwndDlg, IDC_MORE_INFO_ON_HW_ACCELERATION);
- ToHyperlink (hwndDlg, IDC_MORE_INFO_ON_THREAD_BASED_PARALLELIZATION);
}
return 0;
@@ -8237,14 +8396,6 @@
case IDC_BENCHMARK:
Benchmark (hwndDlg);
return 1;
-
- case IDC_MORE_INFO_ON_HW_ACCELERATION:
- Applink ("hwacceleration", TRUE, "");
- return 1;
-
- case IDC_MORE_INFO_ON_THREAD_BASED_PARALLELIZATION:
- Applink ("parallelization", TRUE, "");
- return 1;
}
return 0;
@@ -8606,340 +8757,6 @@
}
-void AnalyzeKernelMiniDump (HWND hwndDlg)
-{
- char winDir[MAX_PATH] = { 0 };
- GetWindowsDirectory (winDir, sizeof (winDir));
- string memDumpPath = string (winDir) + "\\MEMORY.DMP";
- string tmpDumpPath;
-
- string dumpPath = FindLatestFileOrDirectory (string (winDir) + "\\Minidump", "*.dmp", false, true);
- if (dumpPath.empty())
- {
- Error ("NO_MINIDUMP_FOUND");
- return;
- }
-
- WIN32_FIND_DATA findData;
- HANDLE find = FindFirstFile (memDumpPath.c_str(), &findData);
-
- if (find != INVALID_HANDLE_VALUE)
- {
- ULARGE_INTEGER memDumpTime, miniDumpTime;
- memDumpTime.HighPart = findData.ftLastWriteTime.dwHighDateTime;
- memDumpTime.LowPart = findData.ftLastWriteTime.dwLowDateTime;
-
- FindClose (find);
-
- find = FindFirstFile (dumpPath.c_str(), &findData);
- if (find != INVALID_HANDLE_VALUE)
- {
- miniDumpTime.HighPart = findData.ftLastWriteTime.dwHighDateTime;
- miniDumpTime.LowPart = findData.ftLastWriteTime.dwLowDateTime;
-
- if (_abs64 (miniDumpTime.QuadPart - memDumpTime.QuadPart) < 10I64 * 1000 * 1000 * 60 * 5)
- {
- // Rename MEMORY.DMP file first as it can be deleted by Windows when system crash dialog is closed
- tmpDumpPath = memDumpPath + ".true_crypt.dmp"; // Application name must be mangled to avoid interfering with crash analysis
-
- if (MoveFile (memDumpPath.c_str(), tmpDumpPath.c_str()))
- dumpPath = tmpDumpPath;
- else
- tmpDumpPath.clear();
- }
-
- FindClose (find);
- }
- }
-
- finally_do_arg2 (string, tmpDumpPath, string, memDumpPath,
- {
- if (!finally_arg.empty())
- {
- if (AskYesNo ("ASK_DELETE_KERNEL_CRASH_DUMP") == IDYES)
- DeleteFile (finally_arg.c_str());
- else
- MoveFile (finally_arg.c_str(), finally_arg2.c_str());
- }
- });
-
- STARTUPINFO startupInfo;
- PROCESS_INFORMATION procInfo;
-
- ZeroMemory (&startupInfo, sizeof (startupInfo));
- ZeroMemory (&procInfo, sizeof (procInfo));
-
- if (!IsApplicationInstalled (Is64BitOs() ? "Debugging Tools for Windows (x64)" : "Debugging Tools for Windows (x86)"))
- {
- if (AskOkCancel ("ASK_DEBUGGER_INSTALL") != IDOK)
- return;
-
- if (!CreateProcess (NULL, (LPSTR) (string ("msiexec.exe /qb /i " TC_APPLINK "&dest=ms-debug-tools-x") + (Is64BitOs() ? "64" : "86")).c_str(),
- NULL, NULL, FALSE, 0, NULL, NULL, &startupInfo, &procInfo))
- {
- handleWin32Error (hwndDlg);
- return;
- }
-
- WaitCursor();
- WaitForSingleObject (procInfo.hProcess, INFINITE);
- NormalCursor();
-
- DWORD exitCode;
- if (!GetExitCodeProcess (procInfo.hProcess, &exitCode) || exitCode != 0)
- return;
- }
-
- if (AskOkCancel ("SYSTEM_CRASH_ANALYSIS_INFO") == IDCANCEL)
- return;
-
- ZeroMemory (&startupInfo, sizeof (startupInfo));
- ZeroMemory (&procInfo, sizeof (procInfo));
-
- SECURITY_ATTRIBUTES securityAttrib;
- securityAttrib.bInheritHandle = TRUE;
- securityAttrib.nLength = sizeof (securityAttrib);
- securityAttrib.lpSecurityDescriptor = NULL;
-
- HANDLE hChildStdoutWrite = INVALID_HANDLE_VALUE;
- HANDLE hChildStdoutRead = INVALID_HANDLE_VALUE;
- if (!CreatePipe (&hChildStdoutRead, &hChildStdoutWrite, &securityAttrib, 0))
- {
- handleWin32Error (hwndDlg);
- return;
- }
- SetHandleInformation (hChildStdoutRead, HANDLE_FLAG_INHERIT, 0);
-
- startupInfo.hStdInput = INVALID_HANDLE_VALUE;
- startupInfo.hStdOutput = hChildStdoutWrite;
- startupInfo.cb = sizeof (startupInfo);
- startupInfo.hStdError = hChildStdoutWrite;
- startupInfo.dwFlags |= STARTF_USESTDHANDLES;
-
- list
- string kdPath;
- char progPath[MAX_PATH];
- if (SHGetSpecialFolderPath (hwndDlg, progPath, CSIDL_PROGRAM_FILES, FALSE))
- {
- if (Is64BitOs())
- {
- string s = progPath;
- size_t p = s.find (" (x86)");
- if (p != string::npos)
- {
- s = s.substr (0, p);
- if (_access (s.c_str(), 0) != -1)
- strcpy_s (progPath, sizeof (progPath), s.c_str());
- }
- }
-
- kdPath = string (progPath) + "\\Debugging Tools for Windows (" + (Is64BitOs() ? "x64" : "x86") + ")\\kd.exe";
- kdPaths.push_back (kdPath);
- }
-
- kdPath = FindLatestFileOrDirectory (string (winDir).substr (0, 1) + ":\\WinDDK", "*", true, false);
- kdPath += "\\Debuggers\\kd.exe";
- kdPaths.push_back (kdPath);
-
- kdPaths.push_back ("kd.exe");
-
- bool kdRunning = false;
- foreach (const string &kdPath, kdPaths)
- {
- if (CreateProcess (NULL, (LPSTR) ("\"" + kdPath + "\" -z \"" + dumpPath + "\" -y http://msdl.microsoft.com/download/symbols -c \".bugcheck; !analyze -v; q\"").c_str(),
- NULL, NULL, TRUE, CREATE_NO_WINDOW, NULL, NULL, &startupInfo, &procInfo))
- {
- kdRunning = true;
- break;
- }
- }
-
- if (!kdRunning)
- {
- handleWin32Error (hwndDlg);
- Error ("DEBUGGER_NOT_FOUND");
- return;
- }
-
- EnableElevatedCursorChange (hwndDlg);
- WaitCursor();
-
- CloseHandle (procInfo.hProcess);
- CloseHandle (procInfo.hThread);
- CloseHandle (hChildStdoutWrite);
-
- string output;
-
- while (TRUE)
- {
- DWORD bytesReceived;
- char pipeBuffer [4096];
-
- if (!ReadFile (hChildStdoutRead, pipeBuffer, sizeof (pipeBuffer), &bytesReceived, NULL))
- break;
-
- output.insert (output.size(), pipeBuffer, bytesReceived);
- }
-
- NormalCursor();
-
- bool otherDriver = (StringToUpperCase (output).find (StringToUpperCase (TC_APP_NAME)) == string::npos);
-
- size_t p, p2;
- while ((p = output.find ('`')) != string::npos)
- output.erase (output.begin() + p);
-
- p = output.find ("Bugcheck code ");
- if (p == string::npos)
- {
- Error ("ERR_PARAMETER_INCORRECT");
- return;
- }
-
- uint64 bugcheckCode;
- int n = sscanf (output.substr (p + 14, 8).c_str(), "%I64X", &bugcheckCode);
- if (n != 1)
- {
- Error ("ERR_PARAMETER_INCORRECT");
- return;
- }
-
- p = output.find ("Arguments ", p);
-
- uint64 bugcheckArgs[4];
- n = sscanf (output.substr (p + 10, (Is64BitOs() ? 17 : 9) * 4).c_str(), "%I64X %I64X %I64X %I64X", &bugcheckArgs[0], &bugcheckArgs[1], &bugcheckArgs[2], &bugcheckArgs[3]);
- if (n != 4)
- {
- Error ("ERR_PARAMETER_INCORRECT");
- return;
- }
-
- // Image name
- string imageName, imageVersion;
- p = output.find ("IMAGE_NAME:");
- if (p != string::npos)
- {
- p += 13;
- p2 = output.find ('\n', p);
- if (p2 != string::npos)
- imageName = output.substr (p, p2 - p);
- }
-
- // Stack trace
- p = output.find ("STACK_TEXT:");
- if (p == string::npos)
- {
- Error ("ERR_PARAMETER_INCORRECT");
- return;
- }
-
- p2 = output.find ("FOLLOWUP_IP:", p);
- if (p2 == string::npos)
- p2 = output.find ("STACK_COMMAND:", p);
- if (p2 == string::npos)
- p2 = output.size();
-
- output = output.substr (p, p2 - p);
-
- list
- p = 0;
- while ((p = output.find ("+", p)) != string::npos)
- {
- size_t p1 = output.rfind (" ", p);
- if (p1 == string::npos)
- break;
-
- p = output.find ('\n', p);
- if (p == string::npos)
- p = output.size() - 1;
-
- string s = output.substr (p1 + 1, p - p1 - 1);
-
- if (s.find ('(') == 0)
- s = s.substr (1);
- if (s.rfind (')') == s.size() - 1)
- s = s.substr (0, s.size() - 1);
-
- retAddrs.push_back (s);
- }
-
- char url[MAX_URL_LENGTH];
- sprintf (url, TC_APPLINK_SECURE "&dest=syserr-report&os=%s&osver=%d.%d.%d&arch=%s&err=%I64x&arg1=%I64x&arg2=%I64x&arg3=%I64x&arg4=%I64x&flag=%s&drv=%s",
- GetWindowsEdition().c_str(),
- CurrentOSMajor,
- CurrentOSMinor,
- CurrentOSServicePack,
- Is64BitOs() ? "x64" : "x86",
- bugcheckCode,
- bugcheckArgs[0],
- bugcheckArgs[1],
- bugcheckArgs[2],
- bugcheckArgs[3],
- otherDriver ? "0" : "1",
- imageName.empty() ? "-" : imageName.c_str()
- );
-
- stringstream stackTraceArgs;
- int i = 0;
- foreach (const string &retAddr, retAddrs)
- {
- stackTraceArgs << "&st" << i++ << "=" << retAddr;
- }
-
- wstring msg;
-
- if (!imageName.empty() && StringToUpperCase (imageName) != StringToUpperCase (TC_APP_NAME) + ".SYS")
- {
- msg += wstring (GetString ("SYSTEM_CRASH_UPDATE_DRIVER")) + L"\n\n" + SingleStringToWide (imageName);
-
- string description, company, product;
- if (GetExecutableImageInformation (string (winDir) + "\\System32\\drivers\\" + imageName, imageVersion, description, company, product))
- {
- string s;
- if (!description.empty())
- s += description;
- if (!company.empty())
- s += "; " + company;
- if (!product.empty())
- s += "; " + product;
-
- if (s.find ("; ") == 0)
- s = s.substr (3);
-
- if (!s.empty())
- msg += SingleStringToWide (" (" + s + ")");
- }
-
- msg += L"\n\n";
- }
-
- if (otherDriver)
- {
- msg += GetString ("SYSTEM_CRASH_NO_TRUECRYPT");
- msg += L"\n\n";
- }
-
- string urlStr = string (url) + "&drvver=" + (imageVersion.empty() ? "-" : imageVersion) + stackTraceArgs.str();
-
- for (size_t i = 0; i < urlStr.size(); ++i)
- {
- if (urlStr[i] == '+')
- urlStr[i] = '.';
- }
-
- msg += GetString ("SYSTEM_CRASH_REPORT");
- msg += L"\n\n";
-
- msg += SingleStringToWide (urlStr);
-
- msg += L"\n\n";
- msg += GetString ("ASK_SEND_ERROR_REPORT");
-
- if (AskYesNoString (msg.c_str()) == IDYES)
- ShellExecute (NULL, "open", urlStr.c_str(), NULL, NULL, SW_SHOWNORMAL);
-}
-
-
static BOOL HandleDriveListMouseWheelEvent (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL bListMustBePointed)
{
static BOOL eventHandlerActive = FALSE;
diff --recursive -bu truecrypt-7.1a-source/Mount/Mount.h truecrypt-7.2-source/Mount/Mount.h
--- truecrypt-7.1a-source/Mount/Mount.h 2012-02-07 11:36:48.000000000 +0100
+++ truecrypt-7.2-source/Mount/Mount.h 2014-05-27 18:36:03.000000000 +0200
@@ -89,10 +89,9 @@
int GetCipherBlockSizeByDriveNo (int nDosDriveNo);
int GetModeOfOperationByDriveNo (int nDosDriveNo);
void ChangeMainWindowVisibility ();
-void LaunchVolCreationWizard (HWND hwndDlg);
BOOL WholeSysDriveEncryption (BOOL bSilent);
BOOL CheckSysEncMountWithoutPBA (const char *devicePath, BOOL quiet);
-BOOL TCBootLoaderOnInactiveSysEncDrive (void);
+BOOL TCBootLoaderOnInactiveSysEncDrive (char *szDevicePath);
void CreateRescueDisk (void);
int BackupVolumeHeader (HWND hwndDlg, BOOL bRequireConfirmation, char *lpszVolume);
int RestoreVolumeHeader (HWND hwndDlg, char *lpszVolume);
@@ -101,7 +100,6 @@
static BOOL CALLBACK BootLoaderPreferencesDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
void MountSelectedVolume (HWND hwndDlg, BOOL mountWithOptions);
uint32 ReadDriverConfigurationFlags ();
-void AnalyzeKernelMiniDump (HWND hwndDlg);
void HookMouseWheel (HWND hwndDlg, UINT ctrlId);
static BOOL HandleDriveListMouseWheelEvent (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL bListMustBePointed);
diff --recursive -bu truecrypt-7.1a-source/Mount/Mount.rc truecrypt-7.2-source/Mount/Mount.rc
--- truecrypt-7.1a-source/Mount/Mount.rc 2012-02-07 11:36:48.000000000 +0100
+++ truecrypt-7.2-source/Mount/Mount.rc 2014-05-27 18:36:03.000000000 +0200
@@ -14,13 +14,11 @@
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
-// English (U.S.) resources
+// English (United States) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
-#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
-#endif //_WIN32
/////////////////////////////////////////////////////////////////////////////
//
@@ -135,8 +133,6 @@
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
CONTROL "",IDC_DRIVELIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_ALIGNLEFT | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,8,5,360,135
- PUSHBUTTON "&Create Volume",IDC_CREATE_VOLUME,16,159,84,14
- PUSHBUTTON "&Volume Properties...",IDC_VOLUME_PROPERTIES,146,159,84,14
PUSHBUTTON "&Wipe Cache",IDC_WIPE_CACHE,276,159,84,14
COMBOBOX IDC_VOLUME,56,192,212,74,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP
CONTROL "&Never save history",IDC_NO_HISTORY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,56,207,122,10
@@ -147,7 +143,7 @@
PUSHBUTTON "&Auto-Mount Devices",IDC_MOUNTALL,100,243,84,18
PUSHBUTTON "Di&smount All",IDC_UNMOUNTALL,192,243,84,18,WS_GROUP
PUSHBUTTON "E&xit",IDC_EXIT,284,243,84,18,WS_GROUP
- CONTROL 112,IDC_LOGO,"Static",SS_BITMAP | SS_NOTIFY | WS_BORDER,16,192,27,31
+ CONTROL IDB_LOGO_96DPI,IDC_LOGO,"Static",SS_BITMAP | SS_NOTIFY | WS_BORDER,16,192,27,31
GROUPBOX "Volume",IDT_VOLUME,8,179,360,53
CONTROL "",IDC_STATIC,"Static",SS_ETCHEDFRAME,2,0,372,147
CONTROL "",IDC_STATIC,"Static",SS_ETCHEDFRAME,282,242,88,20
@@ -155,23 +151,25 @@
CONTROL "",IDC_STATIC,"Static",SS_ETCHEDFRAME,6,242,88,20
CONTROL "",IDC_STATIC,"Static",SS_ETCHEDFRAME,98,242,88,20
CONTROL "",IDC_STATIC,"Static",SS_ETCHEDFRAME,2,151,372,119
+ LTEXT "WARNING: Using TrueCrypt is not secure",IDT_INSECURE_APP,83,161,141,10,SS_NOTIFY
END
-IDD_PASSWORD_DLG DIALOGEX 0, 0, 280, 68
+IDD_PASSWORD_DLG DIALOGEX 0, 0, 281, 85
STYLE DS_SETFONT | DS_MODALFRAME | DS_3DLOOK | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION
CAPTION "Enter TrueCrypt Volume Password"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
- EDITTEXT IDC_PASSWORD,48,8,153,14,ES_PASSWORD | ES_AUTOHSCROLL
+ EDITTEXT IDC_PASSWORD,48,7,153,14,ES_PASSWORD | ES_AUTOHSCROLL
CONTROL "Cache passwords and keyfil&es in memory",IDC_CACHE,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,52,27,153,10
- CONTROL "&Display password",IDC_SHOW_PASSWORD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,52,40,83,10
- CONTROL "U&se keyfiles",IDC_KEYFILES_ENABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,52,52,83,11
- PUSHBUTTON "&Keyfiles...",IDC_KEY_FILES,137,49,64,14
- PUSHBUTTON "Mount Opti&ons...",IDC_MOUNT_OPTIONS,208,49,64,14
- DEFPUSHBUTTON "OK",IDOK,208,8,64,14
- PUSHBUTTON "Cancel",IDCANCEL,208,25,64,14
- RTEXT "Password:",IDT_PASSWORD,0,10,46,19
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,52,43,153,10
+ CONTROL "&Display password",IDC_SHOW_PASSWORD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,52,56,83,10
+ CONTROL "U&se keyfiles",IDC_KEYFILES_ENABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,52,68,83,11
+ PUSHBUTTON "&Keyfiles...",IDC_KEY_FILES,137,65,64,14
+ PUSHBUTTON "Mount Opti&ons...",IDC_MOUNT_OPTIONS,208,65,64,14
+ DEFPUSHBUTTON "OK",IDOK,208,7,64,14
+ PUSHBUTTON "Cancel",IDCANCEL,208,24,64,14
+ RTEXT "Password:",IDT_PASSWORD,0,9,46,19
+ LTEXT "WARNING: Using TrueCrypt is not secure",IDT_INSECURE_APP,51,27,146,10,SS_NOTIFY
END
IDD_TRAVELER_DLG DIALOGEX 0, 0, 300, 269
@@ -277,11 +275,9 @@
CONTROL "",IDC_HW_AES_SUPPORTED_BY_CPU,"Static",SS_LEFTNOWORDWRAP | WS_GROUP,294,21,57,12,WS_EX_CLIENTEDGE
CONTROL "Accelerate AES encryption/decryption by using the AES instructions of the processor (if available)",IDC_ENABLE_HARDWARE_ENCRYPTION,
"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,18,41,340,17
- LTEXT "More information",IDC_MORE_INFO_ON_HW_ACCELERATION,18,61,165,10,SS_NOTIFY
CONTROL "Do not use the following number of processors for encryption/decryption:",IDC_LIMIT_ENC_THREAD_POOL,
"Button",BS_AUTOCHECKBOX | BS_TOP | WS_TABSTOP,18,103,283,11
COMBOBOX IDC_ENCRYPTION_FREE_CPU_COUNT,304,101,48,51,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
- LTEXT "More information",IDC_MORE_INFO_ON_THREAD_BASED_PARALLELIZATION,18,159,165,10,SS_NOTIFY
PUSHBUTTON "&Benchmark",IDC_BENCHMARK,7,185,59,14
DEFPUSHBUTTON "OK",IDOK,257,185,50,14
PUSHBUTTON "Cancel",IDCANCEL,313,185,50,14
@@ -313,7 +309,6 @@
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,218,349,11
CONTROL "Do not mount selected volume when 'Mount Favorite Volumes' &hot key is pressed",IDC_FAVORITE_DISABLE_HOTKEY,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,232,349,11
- LTEXT "Help on favorite volumes",IDC_FAVORITES_HELP_LINK,17,259,237,10,SS_NOTIFY
DEFPUSHBUTTON "OK",IDOK,269,257,50,14
PUSHBUTTON "Cancel",IDCANCEL,323,257,50,14
GROUPBOX "",IDC_FAV_VOL_OPTIONS_GROUP_BOX,7,121,366,130
@@ -362,7 +357,7 @@
IDD_PASSWORD_DLG, DIALOG
BEGIN
- BOTTOMMARGIN, 63
+ BOTTOMMARGIN, 80
END
IDD_TRAVELER_DLG, DIALOG
@@ -421,8 +416,8 @@
//
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 7,1,1,0
- PRODUCTVERSION 7,1,1,0
+ FILEVERSION 7,2,0,0
+ PRODUCTVERSION 7,2,0,0
FILEFLAGSMASK 0x17L
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -439,11 +434,11 @@
BEGIN
VALUE "CompanyName", "TrueCrypt Foundation"
VALUE "FileDescription", "TrueCrypt"
- VALUE "FileVersion", "7.1a"
+ VALUE "FileVersion", "7.2"
VALUE "LegalTrademarks", "TrueCrypt"
VALUE "OriginalFilename", "TrueCrypt.exe"
VALUE "ProductName", "TrueCrypt"
- VALUE "ProductVersion", "7.1a"
+ VALUE "ProductVersion", "7.2"
END
END
BLOCK "VarFileInfo"
@@ -504,8 +499,9 @@
MENUITEM "Select File...", IDM_SELECT_FILE
MENUITEM "Select Device...", IDM_SELECT_DEVICE
MENUITEM SEPARATOR
+ MENUITEM "Permanently Decrypt...", IDM_DECRYPT_NONSYS_VOL
+ MENUITEM "Resume Interrupted Decryption...", IDM_RESUME_INTERRUPTED_PROC
MENUITEM "Create New Volume...", IDM_CREATE_VOLUME
- MENUITEM "Resume Interrupted Process", IDM_RESUME_INTERRUPTED_PROC
MENUITEM SEPARATOR
MENUITEM "Mount Volume", IDM_MOUNT_VOLUME
MENUITEM "Mount Volume with Options", IDM_MOUNT_VOLUME_OPTIONS
@@ -523,11 +519,9 @@
END
POPUP "S&ystem"
BEGIN
- MENUITEM "Encrypt System Partition/Drive...", IDM_ENCRYPT_SYSTEM_DEVICE
MENUITEM "Permanently Decrypt System Partition/Drive", IDM_PERMANENTLY_DECRYPT_SYS
MENUITEM "Resume Interrupted Process", IDM_SYSENC_RESUME
- MENUITEM SEPARATOR
- MENUITEM "Create Hidden Operating System...", IDM_CREATE_HIDDEN_OS
+ MENUITEM "Encrypt System Partition/Drive...", IDM_ENCRYPT_SYSTEM_DEVICE
MENUITEM SEPARATOR
MENUITEM "Create Rescue Disk...", IDM_CREATE_RESCUE_DISK
MENUITEM "Verify Rescue Disk", IDM_VERIFY_RESCUE_DISK
@@ -588,23 +582,9 @@
END
POPUP "Hel&p"
BEGIN
- MENUITEM "User's Guide", IDM_HELP
- MENUITEM "Online Help", IDM_ONLINE_HELP
- MENUITEM "Beginner's Tutorial", IDM_ONLINE_TUTORIAL
- MENUITEM "Frequently Asked Questions", IDM_FAQ
- MENUITEM SEPARATOR
- MENUITEM "TrueCrypt Website", IDM_WEBSITE
- MENUITEM "Downloads", IDM_TC_DOWNLOADS
- MENUITEM "News", IDM_NEWS
- MENUITEM "Version History", IDM_VERSION_HISTORY
- MENUITEM SEPARATOR
- MENUITEM "Analyze a System Crash...", IDM_ANALYZE_SYSTEM_CRASH
- MENUITEM SEPARATOR
- MENUITEM "Contact", IDM_CONTACT
MENUITEM "Legal Notices", IDM_LICENSE
MENUITEM "About", IDM_ABOUT
END
- MENUITEM "&Homepage ", IDM_HOMEPAGE
END
@@ -618,7 +598,7 @@
IDS_UACSTRING "TrueCrypt"
END
-#endif // English (U.S.) resources
+#endif // English (United States) resources
/////////////////////////////////////////////////////////////////////////////
diff --recursive -bu truecrypt-7.1a-source/Mount/Resource.h truecrypt-7.2-source/Mount/Resource.h
--- truecrypt-7.1a-source/Mount/Resource.h 2012-02-07 11:36:48.000000000 +0100
+++ truecrypt-7.2-source/Mount/Resource.h 2014-05-27 18:36:03.000000000 +0200
@@ -58,168 +58,154 @@
#define IDC_PASSWORD 1035
#define IDC_BROWSE_FILES 1036
#define IDC_SELECT_DEVICE 1037
-#define IDC_CREATE_VOLUME 1038
-#define IDC_VOLUME_TOOLS 1039
-#define IDC_WIPE_CACHE 1040
-#define IDC_MOUNTALL 1041
-#define IDD_TRAVELER_DLG 1042
-#define IDC_SELECT_FILE 1043
-#define IDD_HOTKEYS_DLG 1044
-#define IDC_VOLUME_PROPERTIES 1045
-#define IDT_FILE_SETTINGS 1046
-#define IDD_PERFORMANCE_SETTINGS 1047
-#define IDT_AUTORUN 1048
-#define IDT_TRAVEL_INSERTION 1049
-#define IDT_TRAVEL_ROOT 1050
-#define IDT_VOLUME 1051
-#define IDT_PASSWORD 1052
-#define IDT_CURRENT 1053
-#define IDT_NEW 1054
-#define IDT_NEW_PASSWORD 1055
-#define IDT_CONFIRM_PASSWORD 1056
-#define IDT_PKCS5_PRF 1057
-#define IDT_PW_CACHE_OPTIONS 1058
-#define IDT_DEFAULT_MOUNT_OPTIONS 1059
-#define IDT_WINDOWS_RELATED_SETTING 1060
-#define IDC_CREATE 1061
-#define IDC_EXIT 1062
-#define IDC_TRAVEL_OPEN_EXPLORER 1063
-#define IDC_TRAV_CACHE_PASSWORDS 1064
-#define IDC_UNMOUNTALL 1065
-#define IDT_TASKBAR_ICON 1066
-#define IDT_AUTO_DISMOUNT 1067
-#define IDC_PREF_FORCE_AUTO_DISMOUNT 1068
-#define IDC_PREF_DISMOUNT_INACTIVE_TIME 1069
-#define IDT_MINUTES 1070
-#define IDC_PREF_DISMOUNT_SCREENSAVER 1071
-#define IDC_PREF_DISMOUNT_POWERSAVING 1072
-#define IDT_AUTO_DISMOUNT_ON 1073
-#define IDC_PREF_WIPE_CACHE_ON_AUTODISMOUNT 1074
-#define IDC_CLOSE_BKG_TASK_WHEN_NOVOL 1075
-#define IDC_MORE_INFO_ON_HW_ACCELERATION 1076
-#define IDT_LOGON 1077
-#define IDC_MORE_INFO_ON_THREAD_BASED_PARALLELIZATION 1078
-#define IDC_PREF_LOGON_START 1079
-#define IDC_PREF_LOGON_MOUNT_DEVICES 1080
-#define IDC_SHOW_PASSWORD_CHPWD_NEW 1081
-#define IDC_HK_DISMOUNT_BALLOON_TOOLTIP 1082
-#define IDC_SHOW_PASSWORD_CHPWD_ORI 1083
-#define IDC_HK_DISMOUNT_PLAY_SOUND 1084
-#define IDC_HOTKEY_ASSIGN 1085
-#define IDC_HOTKEY_REMOVE 1086
-#define IDC_HOTKEY_KEY 1087
-#define IDT_HOTKEY_KEY 1088
-#define IDC_HOTKEY_LIST 1089
-#define IDC_RESET_HOTKEYS 1090
-#define IDT_DISMOUNT_ACTION 1091
-#define IDT_ASSIGN_HOTKEY 1092
-#define IDC_HK_MOD_SHIFT 1093
-#define IDC_HK_MOD_CTRL 1094
-#define IDC_HK_MOD_ALT 1095
-#define IDC_HK_MOD_WIN 1096
-#define IDC_SHOW_PASSWORD 1097
-#define IDC_LOGO 1098
-#define IDT_PKCS11_LIB_PATH 1099
-#define IDC_PKCS11_MODULE 1100
-#define IDC_SELECT_PKCS11_MODULE 1101
-#define IDC_AUTO_DETECT_PKCS11_MODULE 1102
-#define IDC_CLOSE_TOKEN_SESSION_AFTER_MOUNT 1103
-#define IDT_SECURITY_OPTIONS 1104
-#define IDC_DISABLE_BOOT_LOADER_OUTPUT 1105
-#define IDC_ALLOW_ESC_PBA_BYPASS 1106
-#define IDC_CUSTOM_BOOT_LOADER_MESSAGE 1107
-#define IDC_BOOT_LOADER_CACHE_PASSWORD 1108
-#define IDC_MORE_SETTINGS 1109
-#define IDT_CUSTOM_BOOT_LOADER_MESSAGE 1110
-#define IDC_CUSTOM_BOOT_LOADER_MESSAGE_HELP 1111
-#define IDT_BOOT_LOADER_SCREEN_OPTIONS 1112
-#define IDT_PKCS11_LIB_HELP 1113
-#define IDT_ACCELERATION_OPTIONS 1114
-#define IDC_ENABLE_HARDWARE_ENCRYPTION 1115
-#define IDC_FAVORITE_VOLUMES_LIST 1116
-#define IDC_FAVORITE_MOUNT_READONLY 1117
-#define IDC_FAVORITE_MOUNT_REMOVABLE 1118
-#define IDC_FAVORITE_MOUNT_ON_ARRIVAL 1119
-#define IDC_FAVORITE_LABEL 1120
-#define IDT_FAVORITE_LABEL 1121
-#define IDC_FAVORITE_MOUNT_ON_LOGON 1122
-#define IDC_FAVORITE_DISABLE_HOTKEY 1123
-#define IDC_FAVORITE_MOVE_UP 1124
-#define IDC_FAVORITE_MOVE_DOWN 1125
-#define IDC_FAVORITE_REMOVE 1126
-#define IDT_HW_AES_SUPPORTED_BY_CPU 1127
-#define IDC_FAVORITE_OPEN_EXPLORER_WIN_ON_MOUNT 1128
-#define IDC_HW_AES_SUPPORTED_BY_CPU 1129
-#define IDC_LIMIT_ENC_THREAD_POOL 1130
-#define IDC_ENCRYPTION_FREE_CPU_COUNT 1131
-#define IDT_PARALLELIZATION_OPTIONS 1132
-#define IDT_LIMIT_ENC_THREAD_POOL_NOTE 1133
-#define IDC_FAV_VOL_OPTIONS_GROUP_BOX 1134
-#define IDC_FAVORITES_HELP_LINK 1135
-#define IDC_FAV_VOL_OPTIONS_GLOBAL_SETTINGS_BOX 1136
-#define IDM_HELP 40001
-#define IDM_ABOUT 40002
-#define IDM_UNMOUNT_VOLUME 40003
-#define IDM_CLEAR_HISTORY 40004
-#define IDM_BENCHMARK 40005
-#define IDM_TRAVELER 40006
-#define IDM_MOUNT_VOLUME_OPTIONS 40007
-#define IDM_FAQ 40008
-#define IDM_REFRESH_DRIVE_LETTERS 40009
-#define IDM_DEFAULT_KEYFILES 40010
-#define IDM_WEBSITE 40011
-#define IDM_MOUNTALL 40012
-#define IDM_UNMOUNTALL 40013
-#define IDM_MOUNT_VOLUME 40014
-#define IDM_CHANGE_PASSWORD 40015
-#define IDM_VOLUME_WIZARD 40016
-#define IDM_CREATE_VOLUME 40017
-#define IDM_WIPE_CACHE 40018
-#define IDM_PREFERENCES 40019
-#define IDM_LICENSE 40020
-#define IDM_SELECT_FILE 40021
-#define IDM_SELECT_DEVICE 40022
-#define IDM_VOLUME_PROPERTIES 40023
-#define IDM_LANGUAGE 40024
-#define IDM_MOUNT_FAVORITE_VOLUMES 40025
-#define IDM_BACKUP_VOL_HEADER 40026
-#define IDM_RESTORE_VOL_HEADER 40027
-#define IDM_HOTKEY_SETTINGS 40028
-#define IDM_TC_DOWNLOADS 40029
-#define IDM_NEWS 40030
-#define IDM_CONTACT 40031
-#define IDM_VERSION_HISTORY 40032
-#define IDM_HOMEPAGE 40033
-#define IDM_TEST_VECTORS 40034
-#define IDM_ADD_REMOVE_VOL_KEYFILES 40035
-#define IDM_REMOVE_ALL_KEYFILES_FROM_VOL 40036
-#define IDM_CHANGE_HEADER_KEY_DERIV_ALGO 40037
-#define IDM_KEYFILE_GENERATOR 40038
-#define IDM_ONLINE_TUTORIAL 40039
-#define IDM_ONLINE_HELP 40040
-#define IDM_CHANGE_SYS_HEADER_KEY_DERIV_ALGO 40041
-#define IDM_CHANGE_SYS_PASSWORD 40042
-#define IDM_CREATE_RESCUE_DISK 40043
-#define IDM_PERMANENTLY_DECRYPT_SYS 40044
-#define IDM_VERIFY_RESCUE_DISK 40045
-#define IDM_SYSTEM_ENCRYPTION_STATUS 40046
-#define IDM_ENCRYPT_SYSTEM_DEVICE 40047
-#define IDM_SYSENC_RESUME 40048
-#define IDM_MOUNT_SYSENC_PART_WITHOUT_PBA 40049
-#define IDM_CREATE_HIDDEN_OS 40050
-#define IDM_TOKEN_PREFERENCES 40051
-#define IDM_CLOSE_ALL_TOKEN_SESSIONS 40052
-#define IDM_SYS_ENC_SETTINGS 40053
-#define IDM_SYSENC_SETTINGS 40054
-#define IDM_RESUME_INTERRUPTED_PROC 40055
-#define IDM_MANAGE_TOKEN_KEYFILES 40056
-#define IDM_SYS_FAVORITES_SETTINGS 40057
-#define IDM_ORGANIZE_FAVORITES 40058
-#define IDM_ORGANIZE_SYSTEM_FAVORITES 40059
-#define IDM_ADD_VOLUME_TO_FAVORITES 40060
-#define IDM_ADD_VOLUME_TO_SYSTEM_FAVORITES 40061
-#define IDM_PERFORMANCE_SETTINGS 40062
-#define IDM_ANALYZE_SYSTEM_CRASH 40063
+#define IDC_VOLUME_TOOLS 1038
+#define IDC_WIPE_CACHE 1039
+#define IDC_MOUNTALL 1040
+#define IDD_TRAVELER_DLG 1041
+#define IDC_SELECT_FILE 1042
+#define IDD_HOTKEYS_DLG 1043
+#define IDC_VOLUME_PROPERTIES 1044
+#define IDT_FILE_SETTINGS 1045
+#define IDD_PERFORMANCE_SETTINGS 1046
+#define IDT_AUTORUN 1047
+#define IDT_TRAVEL_INSERTION 1048
+#define IDT_TRAVEL_ROOT 1049
+#define IDT_VOLUME 1050
+#define IDT_PASSWORD 1051
+#define IDT_CURRENT 1052
+#define IDT_NEW 1053
+#define IDT_NEW_PASSWORD 1054
+#define IDT_CONFIRM_PASSWORD 1055
+#define IDT_PKCS5_PRF 1056
+#define IDT_PW_CACHE_OPTIONS 1057
+#define IDT_DEFAULT_MOUNT_OPTIONS 1058
+#define IDT_WINDOWS_RELATED_SETTING 1059
+#define IDC_CREATE 1060
+#define IDC_EXIT 1061
+#define IDC_TRAVEL_OPEN_EXPLORER 1062
+#define IDC_TRAV_CACHE_PASSWORDS 1063
+#define IDC_UNMOUNTALL 1064
+#define IDT_TASKBAR_ICON 1065
+#define IDT_AUTO_DISMOUNT 1066
+#define IDC_PREF_FORCE_AUTO_DISMOUNT 1067
+#define IDC_PREF_DISMOUNT_INACTIVE_TIME 1068
+#define IDT_MINUTES 1069
+#define IDC_PREF_DISMOUNT_SCREENSAVER 1070
+#define IDC_PREF_DISMOUNT_POWERSAVING 1071
+#define IDT_AUTO_DISMOUNT_ON 1072
+#define IDC_PREF_WIPE_CACHE_ON_AUTODISMOUNT 1073
+#define IDC_CLOSE_BKG_TASK_WHEN_NOVOL 1074
+#define IDT_LOGON 1075
+#define IDC_PREF_LOGON_START 1076
+#define IDC_PREF_LOGON_MOUNT_DEVICES 1077
+#define IDC_SHOW_PASSWORD_CHPWD_NEW 1078
+#define IDC_HK_DISMOUNT_BALLOON_TOOLTIP 1079
+#define IDC_SHOW_PASSWORD_CHPWD_ORI 1080
+#define IDC_HK_DISMOUNT_PLAY_SOUND 1081
+#define IDC_HOTKEY_ASSIGN 1082
+#define IDC_HOTKEY_REMOVE 1083
+#define IDC_HOTKEY_KEY 1084
+#define IDT_HOTKEY_KEY 1085
+#define IDC_HOTKEY_LIST 1086
+#define IDC_RESET_HOTKEYS 1087
+#define IDT_DISMOUNT_ACTION 1088
+#define IDT_ASSIGN_HOTKEY 1089
+#define IDC_HK_MOD_SHIFT 1090
+#define IDC_HK_MOD_CTRL 1091
+#define IDC_HK_MOD_ALT 1092
+#define IDC_HK_MOD_WIN 1093
+#define IDC_SHOW_PASSWORD 1094
+#define IDC_LOGO 1095
+#define IDT_PKCS11_LIB_PATH 1096
+#define IDC_PKCS11_MODULE 1097
+#define IDC_SELECT_PKCS11_MODULE 1098
+#define IDC_AUTO_DETECT_PKCS11_MODULE 1099
+#define IDC_CLOSE_TOKEN_SESSION_AFTER_MOUNT 1100
+#define IDT_SECURITY_OPTIONS 1101
+#define IDC_DISABLE_BOOT_LOADER_OUTPUT 1102
+#define IDC_ALLOW_ESC_PBA_BYPASS 1103
+#define IDC_CUSTOM_BOOT_LOADER_MESSAGE 1104
+#define IDC_BOOT_LOADER_CACHE_PASSWORD 1105
+#define IDC_MORE_SETTINGS 1106
+#define IDT_CUSTOM_BOOT_LOADER_MESSAGE 1107
+#define IDC_CUSTOM_BOOT_LOADER_MESSAGE_HELP 1108
+#define IDT_BOOT_LOADER_SCREEN_OPTIONS 1109
+#define IDT_PKCS11_LIB_HELP 1110
+#define IDT_ACCELERATION_OPTIONS 1111
+#define IDC_ENABLE_HARDWARE_ENCRYPTION 1112
+#define IDC_FAVORITE_VOLUMES_LIST 1113
+#define IDC_FAVORITE_MOUNT_READONLY 1114
+#define IDC_FAVORITE_MOUNT_REMOVABLE 1115
+#define IDC_FAVORITE_MOUNT_ON_ARRIVAL 1116
+#define IDC_FAVORITE_LABEL 1117
+#define IDT_FAVORITE_LABEL 1118
+#define IDC_FAVORITE_MOUNT_ON_LOGON 1119
+#define IDC_FAVORITE_DISABLE_HOTKEY 1120
+#define IDC_FAVORITE_MOVE_UP 1121
+#define IDC_FAVORITE_MOVE_DOWN 1122
+#define IDC_FAVORITE_REMOVE 1123
+#define IDT_HW_AES_SUPPORTED_BY_CPU 1124
+#define IDC_FAVORITE_OPEN_EXPLORER_WIN_ON_MOUNT 1125
+#define IDC_HW_AES_SUPPORTED_BY_CPU 1126
+#define IDC_LIMIT_ENC_THREAD_POOL 1127
+#define IDC_ENCRYPTION_FREE_CPU_COUNT 1128
+#define IDT_PARALLELIZATION_OPTIONS 1129
+#define IDT_LIMIT_ENC_THREAD_POOL_NOTE 1130
+#define IDC_FAV_VOL_OPTIONS_GROUP_BOX 1131
+#define IDC_FAV_VOL_OPTIONS_GLOBAL_SETTINGS_BOX 1132
+#define IDT_INSECURE_APP 1133
+#define IDM_ABOUT 40001
+#define IDM_UNMOUNT_VOLUME 40002
+#define IDM_CLEAR_HISTORY 40003
+#define IDM_BENCHMARK 40004
+#define IDM_TRAVELER 40005
+#define IDM_MOUNT_VOLUME_OPTIONS 40006
+#define IDM_REFRESH_DRIVE_LETTERS 40007
+#define IDM_DEFAULT_KEYFILES 40008
+#define IDM_MOUNTALL 40009
+#define IDM_UNMOUNTALL 40010
+#define IDM_MOUNT_VOLUME 40011
+#define IDM_CHANGE_PASSWORD 40012
+#define IDM_VOLUME_WIZARD 40013
+#define IDM_CREATE_VOLUME 40014
+#define IDM_WIPE_CACHE 40015
+#define IDM_PREFERENCES 40016
+#define IDM_LICENSE 40017
+#define IDM_SELECT_FILE 40018
+#define IDM_SELECT_DEVICE 40019
+#define IDM_VOLUME_PROPERTIES 40020
+#define IDM_LANGUAGE 40021
+#define IDM_MOUNT_FAVORITE_VOLUMES 40022
+#define IDM_BACKUP_VOL_HEADER 40023
+#define IDM_RESTORE_VOL_HEADER 40024
+#define IDM_HOTKEY_SETTINGS 40025
+#define IDM_TEST_VECTORS 40026
+#define IDM_ADD_REMOVE_VOL_KEYFILES 40027
+#define IDM_REMOVE_ALL_KEYFILES_FROM_VOL 40028
+#define IDM_CHANGE_HEADER_KEY_DERIV_ALGO 40029
+#define IDM_KEYFILE_GENERATOR 40030
+#define IDM_CHANGE_SYS_HEADER_KEY_DERIV_ALGO 40031
+#define IDM_CHANGE_SYS_PASSWORD 40032
+#define IDM_CREATE_RESCUE_DISK 40033
+#define IDM_PERMANENTLY_DECRYPT_SYS 40034
+#define IDM_VERIFY_RESCUE_DISK 40035
+#define IDM_SYSTEM_ENCRYPTION_STATUS 40036
+#define IDM_ENCRYPT_SYSTEM_DEVICE 40037
+#define IDM_SYSENC_RESUME 40038
+#define IDM_MOUNT_SYSENC_PART_WITHOUT_PBA 40039
+#define IDM_TOKEN_PREFERENCES 40040
+#define IDM_CLOSE_ALL_TOKEN_SESSIONS 40041
+#define IDM_SYS_ENC_SETTINGS 40042
+#define IDM_SYSENC_SETTINGS 40043
+#define IDM_RESUME_INTERRUPTED_PROC 40044
+#define IDM_MANAGE_TOKEN_KEYFILES 40045
+#define IDM_SYS_FAVORITES_SETTINGS 40046
+#define IDM_ORGANIZE_FAVORITES 40047
+#define IDM_ORGANIZE_SYSTEM_FAVORITES 40048
+#define IDM_ADD_VOLUME_TO_FAVORITES 40049
+#define IDM_ADD_VOLUME_TO_SYSTEM_FAVORITES 40050
+#define IDM_PERFORMANCE_SETTINGS 40051
+#define IDM_DECRYPT_NONSYS_VOL 40052
// Next default values for new objects
//
@@ -227,8 +213,8 @@
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NO_MFC 1
#define _APS_NEXT_RESOURCE_VALUE 118
-#define _APS_NEXT_COMMAND_VALUE 40064
-#define _APS_NEXT_CONTROL_VALUE 1137
+#define _APS_NEXT_COMMAND_VALUE 40053
+#define _APS_NEXT_CONTROL_VALUE 1134
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
Only in truecrypt-7.2-source/Platform: Unix
diff --recursive -bu truecrypt-7.1a-source/Readme.txt truecrypt-7.2-source/Readme.txt
--- truecrypt-7.1a-source/Readme.txt 2012-02-07 11:36:48.000000000 +0100
+++ truecrypt-7.2-source/Readme.txt 2014-05-27 18:36:03.000000000 +0200
@@ -1,4 +1,12 @@
-This archive contains the source code of TrueCrypt 7.1a.
+
+WARNING: Using TrueCrypt is not secure as it may contain unfixed security issues
+
+The development of TrueCrypt was ended in 5/2014 after Microsoft terminated
+support of Windows XP. Windows 8/7/Vista and later offer integrated support for
+encrypted disks and virtual disk images. Such integrated support is also
+available on other platforms. You should migrate any data encrypted by TrueCrypt
+to encrypted disks or virtual disk images supported on your platform.
+
Important
@@ -24,14 +32,6 @@
Requirements for Building TrueCrypt for Linux and Mac OS X
Instructions for Building TrueCrypt for Linux and Mac OS X
-III. FreeBSD and OpenSolaris
-
-IV. Third-Party Developers (Contributors)
-
-V. Legal Information
-
-VI. Further Information
-
I. Windows
@@ -41,33 +41,14 @@
------------------------------------------------
- Microsoft Visual C++ 2008 SP1 (Professional Edition or compatible)
-- Microsoft Visual C++ 1.52 (available from MSDN Subscriber Downloads)
+- Microsoft Visual C++ 1.52
- Microsoft Windows SDK for Windows 7 (configured for Visual C++)
- Microsoft Windows Driver Kit 7.1.0 (build 7600.16385.1)
- RSA Security Inc. PKCS #11 Cryptographic Token Interface (Cryptoki) 2.20
- header files (available at ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-11/v2-20)
+ header files
- NASM assembler 2.08 or compatible
- gzip compressor
-IMPORTANT:
-
-The 64-bit editions of Windows Vista and later versions of Windows, and in
-some cases (e.g. playback of HD DVD content) also the 32-bit editions, do not
-allow the TrueCrypt driver to run without an appropriate digital signature.
-Therefore, all .sys files in official TrueCrypt binary packages are digitally
-signed with the digital certificate of the TrueCrypt Foundation, which was
-issued by a certification authority. At the end of each official .exe and
-.sys file, there are embedded digital signatures and all related certificates
-(i.e. all certificates in the relevant certification chain, such as the
-certification authority certificates, CA-MS cross-certificate, and the
-TrueCrypt Foundation certificate). Keep this in mind if you compile TrueCrypt
-and compare your binaries with the official binaries. If your binaries are
-unsigned, the sizes of the official binaries will usually be approximately
-10 KB greater than sizes of your binaries (there may be further differences
-if you use a different version of the compiler, or if you install a different
-or no service pack for Visual Studio, or different hotfixes for it, or if you
-use different versions of the required SDKs).
-
Instructions for Building TrueCrypt for Windows:
------------------------------------------------
@@ -111,13 +92,11 @@
- NASM assembler 2.08 or compatible (x86/x64 architecture only)
- pkg-config
- wxWidgets 2.8 shared library and header files installed or
- wxWidgets 2.8 library source code (available at http://www.wxwidgets.org)
-- FUSE library and header files (available at http://fuse.sourceforge.net
- and http://code.google.com/p/macfuse)
+ wxWidgets 2.8 library source code
+- FUSE library and header files
- RSA Security Inc. PKCS #11 Cryptographic Token Interface (Cryptoki) 2.20
- header files (available at ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-11/v2-20)
- located in a standard include path or in a directory defined by the
- environment variable 'PKCS11_INC'.
+ header files located in a standard include path or in a directory
+ defined by the environment variable 'PKCS11_INC'
Instructions for Building TrueCrypt for Linux and Mac OS X:
@@ -152,58 +131,3 @@
$ make NOGUI=1 WX_ROOT=/usr/src/wxWidgets wxbuild
$ make NOGUI=1 WXSTATIC=1
-
-
-
-III. FreeBSD and OpenSolaris
-============================
-
-Support status for FreeBSD: http://www.truecrypt.org/misc/freebsd
-Support status for OpenSolaris: http://www.truecrypt.org/misc/opensolaris
-
-
-
-IV. Third-Party Developers (Contributors)
-=========================================
-
-If you intend to implement a feature, please contact us first to make sure:
-
-1) That the feature has not been implemented (we may have already implemented
- it, but haven't released the code yet).
-2) That the feature is acceptable.
-3) Whether we need help of third-party developers with implementing the feature.
-
-Information on how to contact us can be found at:
-http://www.truecrypt.org/contact
-
-
-
-V. Legal Information
-====================
-
-Copyright Information
----------------------
-
-This software as a whole:
-Copyright (c) 2012 TrueCrypt Developers Association. All rights reserved.
-
-Portions of this software:
-Copyright (c) 2003-2012 TrueCrypt Developers Association. All rights reserved.
-Copyright (c) 1998-2000 Paul Le Roux. All rights reserved.
-Copyright (c) 1998-2008 Brian Gladman, Worcester, UK. All rights reserved.
-Copyright (c) 2002-2004 Mark Adler. All rights reserved.
-For more information, please see the legal notices attached to parts of the
-source code.
-
-Trademark Information
----------------------
-
-Any trademarks contained in the source code, binaries, and/or in the
-documentation, are the sole property of their respective owners.
-
-
-
-VI. Further Information
-=======================
-
-http://www.truecrypt.org
diff --recursive -bu truecrypt-7.1a-source/Release/Setup Files/License.txt truecrypt-7.2-source/Release/Setup Files/License.txt
--- truecrypt-7.1a-source/Release/Setup Files/License.txt 2012-02-07 11:36:48.000000000 +0100
+++ truecrypt-7.2-source/Release/Setup Files/License.txt 2014-05-27 18:36:03.000000000 +0200
@@ -1,4 +1,4 @@
-TrueCrypt License Version 3.0
+TrueCrypt License Version 3.1
Software distributed under this license is distributed on an "AS
IS" BASIS WITHOUT WARRANTIES OF ANY KIND. THE AUTHORS AND
@@ -112,32 +112,16 @@
TrueCrypt Foundation", "This is a TrueCrypt Foundation
release."
- c. Phrase "Based on TrueCrypt, freely available at
- http://www.truecrypt.org/" must be displayed by Your Product
- (if technically feasible) and contained in its
- documentation. Alternatively, if This Product or its portion
- You included in Your Product constitutes only a minor
- portion of Your Product, phrase "Portions of this product
- are based in part on TrueCrypt, freely available at
- http://www.truecrypt.org/" may be displayed instead. In each
- of the cases mentioned above in this paragraph,
- "http://www.truecrypt.org/" must be a hyperlink (if
- technically feasible) pointing to http://www.truecrypt.org/
- and You may freely choose the location within the user
- interface (if there is any) of Your Product (e.g., an
- "About" window, etc.) and the way in which Your Product will
- display the respective phrase.
-
- Your Product (and any associated materials, e.g., the
+ c. Your Product (and any associated materials, e.g., the
documentation, the content of the official web site of Your
Product, etc.) must not present any Internet address
- containing the domain name truecrypt.org (or any domain name
- that forwards to the domain name truecrypt.org) in a manner
+ containing the domain name truecrypt (or any domain name
+ that forwards to the domain name truecrypt) in a manner
that might suggest that it is where information about Your
Product may be obtained or where bugs found in Your Product
may be reported or where support for Your Product may be
available or otherwise attempt to indicate that the domain
- name truecrypt.org is associated with Your Product.
+ name truecrypt is associated with Your Product.
d. The complete source code of Your Product must be freely
and publicly available (for exceptions, see Section III.2)
Only in truecrypt-7.1a-source/Release/Setup Files: TrueCrypt User Guide.pdf
Only in truecrypt-7.2-source/Resources: Icons
diff --recursive -bu truecrypt-7.1a-source/Resources/Texts/License.rtf truecrypt-7.2-source/Resources/Texts/License.rtf
--- truecrypt-7.1a-source/Resources/Texts/License.rtf 2012-02-07 11:36:48.000000000 +0100
+++ truecrypt-7.2-source/Resources/Texts/License.rtf 2014-05-27 18:36:03.000000000 +0200
@@ -58,7 +58,7 @@
{\pgdsc1\pgdscuse195\pgwsxn12240\pghsxn15840\marglsxn1800\margrsxn1800\margtsxn1440\margbsxn1440\pgdscnxt1 Endnote;}
{\pgdsc2\pgdscuse195\pgwsxn12240\pghsxn15840\marglsxn1134\margrsxn567\margtsxn567\margbsxn567\pgdscnxt2 HTML;}}
{\*\pgdscno2}\paperh15840\paperw12240\margl1134\margr567\margt567\margb567\sectd\sbknone\pgwsxn12240\pghsxn15840\marglsxn1134\margrsxn567\margtsxn567\margbsxn567\ftnbj\ftnstart1\ftnrstcont\ftnnar\aenddoc\aftnrstcont\aftnstart1\aftnnrlc
-\pard\plain \ltrpar\s3\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sa283\rtlch\af2\afs16\lang255\ltrch\dbch\af2\langfe255\hich\f2\fs16\lang1033\loch\f2\fs16\lang1033{\rtlch \ltrch\loch\f2\fs16\lang1033\i0\b0{\ltrch\hich\b\loch\b TrueCrypt License Version 3.0}}{\rtlch \ltrch\loch\f2\fs16\lang1033\i0\b0 \line \line Software distributed under this license is distributed on an "AS IS" BASIS WITHOUT WARRANTIES OF ANY KIND. THE AUTHORS AND DISTRIBUTORS OF THE SOFTWARE DISCLAIM ANY LIABILITY. ANYONE WHO USES, COPIES, MODIFIES, OR (RE)DISTRIB
+\pard\plain \ltrpar\s3\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sa283\rtlch\af2\afs16\lang255\ltrch\dbch\af2\langfe255\hich\f2\fs16\lang1033\loch\f2\fs16\lang1033{\rtlch \ltrch\loch\f2\fs16\lang1033\i0\b0{\ltrch\hich\b\loch\b TrueCrypt License Version 3.1}}{\rtlch \ltrch\loch\f2\fs16\lang1033\i0\b0 \line \line Software distributed under this license is distributed on an "AS IS" BASIS WITHOUT WARRANTIES OF ANY KIND. THE AUTHORS AND DISTRIBUTORS OF THE SOFTWARE DISCLAIM ANY LIABILITY. ANYONE WHO USES, COPIES, MODIFIES, OR (RE)DISTRIB
UTES ANY PART OF THE SOFTWARE IS, BY SUCH ACTION(S), ACCEPTING AND AGREEING TO BE BOUND BY ALL TERMS AND CONDITIONS OF THIS LICENSE. IF YOU DO NOT ACCEPT THEM, DO NOT USE, COPY, MODIFY, NOR (RE)DISTRIBUTE THE SOFTWARE, NOR ANY PART(S) THEREOF.\line \line \line {\ltrch\hich\b\loch\b I. Definit
ions}\line \line {\ltrch\hich\b\loch\b 1}. "This Product" means the work (including, but not limited to, source code, graphics, texts, and accompanying files) made available under and governed by this version of this license ("License"), as may be indicated by, but is not limited to, copyr
ight notice(s) attached to or included in the work.\line \line {\ltrch\hich\b\loch\b 2}. "You" means (and "Your" refers to) an individual or a legal entity (e.g., a non-profit organization, commercial organization, government agency, etc.) exercising permissions granted by this License.\line \line
@@ -79,12 +79,9 @@
iated materials) must not incorporate and must not be confusingly similar to any of the TrueCrypt logos (including, but not limited to, the non-textual logo consisting primarily of a key in stylized form) or portion(s) thereof. All graphics contained in Th
is Product (logos, icons, etc.) must be removed from Your Product (or from Your modified version of This Product) and from any associated materials.}
\par \pard\plain {\listtext\pard\plain \li707\ri0\lin707\rin0\fi-283\sa283\f2\fs16\f2\fs16\f2\fs16 b.\tab}\ilvl0 \ltrpar\s3\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls2\li707\ri0\lin707\rin0\fi-283\sa283\rtlch\af2\afs16\lang255\ltrch\dbch\af2\langfe255\hich\f2\fs16\lang1033\loch\f2\fs16\lang1033 {\rtlch \ltrch\loch\f2\fs16\lang1033\i0\b0 The following phrases must be removed from Your Product and from any associated materials, except the text of this License: "A TrueCrypt Foundation Release", "Released by TrueCrypt Foundation", "This is a TrueCrypt Foundation release."}
-\par \pard\plain {\listtext\pard\plain \li707\ri0\lin707\rin0\fi-283\sa283\f2\fs16\f2\fs16\f2\fs16 c.\tab}\ilvl0 \ltrpar\s3\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls2\li707\ri0\lin707\rin0\fi-283\sa283\rtlch\af2\afs16\lang255\ltrch\dbch\af2\langfe255\hich\f2\fs16\lang1033\loch\f2\fs16\lang1033 {\rtlch \ltrch\loch\f2\fs16\lang1033\i0\b0 Phrase "{\ltrch\hich\i\loch\i Based on TrueCrypt, freely available at http://www.truecrypt.org/}" must be displayed by Your Product (if technically feasible) and contained in its documentation. Alternatively, if This Product or its portion You included in Your Product constitute
-s only a minor portion of Your Product, phrase "{\ltrch\hich\i\loch\i Portions of this product are based in part on TrueCrypt, freely available at http://www.truecrypt.org/}" may be displayed instead. In each of the cases mentioned above in this paragraph, "{\ltrch\hich\i\loch\i http://www.truecrypt.
-org/}" must be a hyperlink (if technically feasible) pointing to http://www.truecrypt.org/ and You may freely choose the location within the user interface (if there is any) of Your Product (e.g., an "About" window, etc.) and the way in which Your Product w
-ill display the respective phrase.\line \line Your Product (and any associated materials, e.g., the documentation, the content of the official web site of Your Product, etc.) must not present any Internet address containing the domain name truecrypt.org (or any doma
-in name that forwards to the domain name truecrypt.org) in a manner that might suggest that it is where information about Your Product may be obtained or where bugs found in Your Product may be reported or where support for Your Product may be available or
- otherwise attempt to indicate that the domain name truecrypt.org is associated with Your Product.}
+\par \pard\plain {\listtext\pard\plain \li707\ri0\lin707\rin0\fi-283\sa283\f2\fs16\f2\fs16\f2\fs16 c.\tab}\ilvl0 \ltrpar\s3\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls2\li707\ri0\lin707\rin0\fi-283\sa283\rtlch\af2\afs16\lang255\ltrch\dbch\af2\langfe255\hich\f2\fs16\lang1033\loch\f2\fs16\lang1033 {\rtlch \ltrch\loch\f2\fs16\lang1033\i0\b0 Your Product (and any associated materials, e.g., the documentation, the content of the official web site of Your Product, etc.) must not present any Internet address containing the domain name truecrypt (or any doma
+in name that forwards to the domain name truecrypt) in a manner that might suggest that it is where information about Your Product may be obtained or where bugs found in Your Product may be reported or where support for Your Product may be available or
+ otherwise attempt to indicate that the domain name truecrypt is associated with Your Product.}
\par \pard\plain {\listtext\pard\plain \li707\ri0\lin707\rin0\fi-283\sa283\f2\fs16\f2\fs16\f2\fs16 d.\tab}\ilvl0 \ltrpar\s3\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\ls2\li707\ri0\lin707\rin0\fi-283\sa283\rtlch\af2\afs16\lang255\ltrch\dbch\af2\langfe255\hich\f2\fs16\lang1033\loch\f2\fs16\lang1033 {\rtlch \ltrch\loch\f2\fs16\lang1033\i0\b0 The complete source code of Your Product must be freely and publicly available (for exceptions, see Section III.2) at least until You cease to distribute Your Product. This condition can be met in one or both of the following ways: (i) You include the comp
lete source code of Your Product with every copy of Your Product that You make and distribute and You make all such copies of Your Product available to the general public free of charge, and/or (ii) You include information (valid and correct at least until
You cease to distribute Your Product) about where the complete source code of Your Product can be obtained free of charge (e.g., an Internet address) or for a reasonable reproduction fee with every copy of Your Product that You make and distribute and, if
Only in truecrypt-7.1a-source: Setup
Only in truecrypt-7.1a-source: TrueCrypt.sln
Only in truecrypt-7.2-source: Volume