VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfelixreichmann <30237956+felixreichmann@users.noreply.github.com>2021-12-17 15:27:04 +0100
committerGitHub <noreply@github.com>2021-12-17 15:27:04 +0100
commit36f71280faf32cdea46b270ae40d71cb46032039 (patch)
tree2c70125105a9662de8ab6651e775e8227b3e6765 /src
parent1c51a76c7eab117bb6c74a3897a6df8197945c90 (diff)
parent7499ae384f8a64d04070a5ee0ae29b944a50bbcc (diff)
downloadVeraCrypt-36f71280faf32cdea46b270ae40d71cb46032039.tar.gz
VeraCrypt-36f71280faf32cdea46b270ae40d71cb46032039.zip
Merge pull request #1 from e2Security/NewInterface
System Encryption: translate password to US keyboard layout + improveā€¦
Diffstat (limited to 'src')
-rw-r--r--src/Common/Dlgcode.c363
-rw-r--r--src/Common/Dlgcode.h7
-rw-r--r--src/Common/Language.xml83
-rw-r--r--src/Common/Password.c16
-rw-r--r--src/Format/Format.rc92
-rw-r--r--src/Format/Resource.h58
-rw-r--r--src/Format/Tcformat.c1057
-rw-r--r--src/Format/Tcformat.h19
8 files changed, 1042 insertions, 653 deletions
diff --git a/src/Common/Dlgcode.c b/src/Common/Dlgcode.c
index 2e0b507a..8897a95e 100644
--- a/src/Common/Dlgcode.c
+++ b/src/Common/Dlgcode.c
@@ -203,6 +203,14 @@ BOOL EnableMemoryProtection = FALSE;
BOOL WaitDialogDisplaying = FALSE;
+wchar_t DefaultKeyboardLayout [KL_NAMELENGTH];
+HKL hklDefaultKeyboardLayout;
+HKL hklUSKeyboardLayout;
+int iPwdCounter = 0;
+wchar_t TranslatedPassword[MAX_PASSWORD + 1];
+BOOL bAltKeyDown = FALSE;
+BOOL bAltKeyWarningShown = FALSE; /* TRUE if the user has been informed that it is not possible to type characters by pressing keys while the right Alt key is held down. */
+
/* Handle to the device driver */
HANDLE hDriver = INVALID_HANDLE_VALUE;
@@ -1275,23 +1283,293 @@ void HandlePasswordEditWmChar (HWND hwnd, WPARAM wParam)
SendMessage(hwnd, EM_HIDEBALLOONTIP, 0, 0);
}
-// Protects an input field from having its content updated by a Paste action (call ToBootPwdField() to use this).
+/* Protects an input field from having its content updated by a Paste action and translates password into
+ US keyboard layout (call ToBootPwdField() to use this). */
static LRESULT CALLBACK BootPwdFieldProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
WNDPROC wp = (WNDPROC) GetWindowLongPtrW (hwnd, GWLP_USERDATA);
-
+
switch (message)
{
case WM_PASTE:
+ Error ("ERROR_PASTE_ACTION", GetParent(hwnd));
return 1;
+
+ case WM_LBUTTONDOWN:
+ if (CheckKeyboardLayout())
+ {
+ // put caret at the end if user tries to change caret position
+ int iLength = GetWindowTextLength (hwnd);
+ SendMessage (hwnd, EM_SETSEL, MAKELONG (iLength, iLength), MAKELONG (iLength, iLength));
+ SetFocus(hwnd);
+ return 1;
+ }
+ break;
+
+ case WM_DEADCHAR:
+ {
+ if (CheckKeyboardLayout())
+ {
+ if ((GetKeyState (VK_RMENU) < 0) || (GetKeyState (VK_MENU) < 0 && GetKeyState (VK_CONTROL) < 0))
+ {
+ bAltKeyDown = TRUE;
+
+ if (!bAltKeyWarningShown)
+ {
+ bAltKeyWarningShown = TRUE;
+
+ wchar_t szTmp [4096];
+ StringCbCopyW (szTmp, sizeof(szTmp), GetString ("ALT_KEY_CHARS_NOT_FOR_SYS_ENCRYPTION"));
+ StringCbCatW (szTmp, sizeof(szTmp), L"\n\n");
+ StringCbCatW (szTmp, sizeof(szTmp), GetString ("KEYB_LAYOUT_SYS_ENC_EXPLANATION"));
+ MessageBoxW (MainDlg, szTmp, lpszTitle, MB_ICONINFORMATION | MB_SETFOREGROUND | MB_TOPMOST);
+ }
+
+ return 1;
+ }
+
+ Warning ("DEAD_KEY_SUPPORT", GetParent (hwnd));
+ if (!(TranslatePwdToUSKbdLayout(hwnd, lParam, TRUE)))
+ return 1;
+ }
+ break;
+ }
+
+ case WM_SYSDEADCHAR:
+ {
+ if (GetKeyState (VK_MENU) < 0)
+ {
+ bAltKeyDown = TRUE;
+
+ if (!bAltKeyWarningShown)
+ {
+ bAltKeyWarningShown = TRUE;
+
+ wchar_t szTmp [4096];
+ StringCbCopyW (szTmp, sizeof(szTmp), GetString ("ALT_KEY_CHARS_NOT_FOR_SYS_ENCRYPTION"));
+ StringCbCatW (szTmp, sizeof(szTmp), L"\n\n");
+ StringCbCatW (szTmp, sizeof(szTmp), GetString ("KEYB_LAYOUT_SYS_ENC_EXPLANATION"));
+ MessageBoxW (MainDlg, szTmp, lpszTitle, MB_ICONINFORMATION | MB_SETFOREGROUND | MB_TOPMOST);
+ }
+
+ return 1;
+ }
+ break;
+ }
+
+ case WM_SYSCHAR:
+ if (GetKeyState (VK_MENU) < 0)
+ {
+ if (!bAltKeyWarningShown)
+ {
+ bAltKeyWarningShown = TRUE;
+
+ wchar_t szTmp [4096];
+ StringCbCopyW (szTmp, sizeof(szTmp), GetString ("ALT_KEY_CHARS_NOT_FOR_SYS_ENCRYPTION"));
+ StringCbCatW (szTmp, sizeof(szTmp), L"\n\n");
+ StringCbCatW (szTmp, sizeof(szTmp), GetString ("KEYB_LAYOUT_SYS_ENC_EXPLANATION"));
+ MessageBoxW (MainDlg, szTmp, lpszTitle, MB_ICONINFORMATION | MB_SETFOREGROUND | MB_TOPMOST);
+ }
+
+ return 1;
+ }
+ break;
+
case WM_CHAR:
+ {
+ if (bAltKeyDown == TRUE)
+ {
+ bAltKeyDown = FALSE;
+ return 1;
+ }
+
+ if (CheckKeyboardLayout ())
+ {
+ if (GetKeyState (VK_RMENU) < 0)
+ return 1;
+
+ if (!(TranslatePwdToUSKbdLayout(hwnd, lParam, FALSE)))
+ return 1;
+ }
+ else
+ {
+ wchar_t OrigPassword[MAX_PASSWORD + 1];
+ GetWindowText (hwnd, OrigPassword, ARRAYSIZE (OrigPassword));
+
+ iPwdCounter = (int) wcslen (OrigPassword);
+ TranslatedPassword[iPwdCounter] = (wchar_t) wParam;
+ iPwdCounter++;
+ TranslatedPassword[iPwdCounter] = '\0';
+ burn (OrigPassword, sizeof (OrigPassword));
+ }
+
HandlePasswordEditWmChar (hwnd, wParam);
break;
}
+ case WM_KEYDOWN:
+ if (CheckKeyboardLayout ())
+ {
+ if (wParam == VK_LEFT || wParam == VK_HOME)
+ {
+ // put caret at the end if user tries to change caret position
+ int iLength = GetWindowTextLength (hwnd);
+ SendMessage(hwnd, EM_SETSEL, MAKELONG (iLength, iLength), MAKELONG (iLength, iLength));
+ return 1;
+ }
+ }
+ break;
+ }
return CallWindowProcW (wp, hwnd, message, wParam, lParam);
}
+BOOL TranslatePwdToUSKbdLayout (HWND hwnd, LPARAM lParam, BOOL deadKey)
+{
+ BYTE keyState[256];
+ UINT scanCode = (lParam >> 16) & 0xFF;
+ UINT virtualKey = MapVirtualKeyExW (scanCode, MAPVK_VSC_TO_VK_EX, hklUSKeyboardLayout);
+
+ BOOL bKeyboardState = GetKeyboardState (keyState);
+ if (!bKeyboardState)
+ Error ("ERROR_GETTING_KEYB_STATE", GetParent (hwnd));
+
+ unsigned short tempChar[2] = {0};
+ wchar_t OrigPassword[MAX_PASSWORD + 1];
+
+ if (deadKey)
+ {
+ int iTemp;
+
+ do
+ iTemp = ToUnicode (virtualKey, scanCode, keyState, (LPWSTR)tempChar, sizeof (tempChar), 0);
+ while (iTemp < 0);
+
+ wchar_t tempOrigPwd[MAX_PASSWORD + 1];
+ GetWindowText (hwnd, tempOrigPwd, sizeof (tempOrigPwd));
+
+ int iLength = (int) wcslen (tempOrigPwd);
+ tempOrigPwd[iLength] = tempChar[0];
+ tempOrigPwd[++iLength] = '\0';
+
+ SetWindowText(hwnd, tempOrigPwd);
+ int iWindowTextLength = GetWindowTextLength (hwnd);
+ SendMessage (hwnd, EM_SETSEL, MAKELONG (iWindowTextLength, iWindowTextLength), MAKELONG (iWindowTextLength, iWindowTextLength));
+
+ tempChar[0] = '\0';
+
+ do
+ iTemp = ToUnicodeEx (virtualKey, scanCode, keyState, (LPWSTR)tempChar, sizeof ((LPWSTR)tempChar) / 2, 0, hklUSKeyboardLayout);
+ while (iTemp < 0);
+
+ if (iTemp == 0)
+ Error ("ERR_NO_TRANSLATION", GetParent(hwnd));
+
+ burn (tempOrigPwd, sizeof (tempOrigPwd));
+ }
+ else
+ {
+ // function MapVirtualKey map numpad keys like PageUp, PageDown, ... so they need to be set to right values
+ switch (scanCode)
+ {
+ case 71:
+ tempChar[0] = '7';
+ break;
+ case 72:
+ tempChar[0] = '8';
+ break;
+ case 73:
+ tempChar[0] = '9';
+ break;
+ case 75:
+ tempChar[0] = '4';
+ break;
+ case 76:
+ tempChar[0] = '5';
+ break;
+ case 77:
+ tempChar[0] = '6';
+ break;
+ case 79:
+ tempChar[0] = '1';
+ break;
+ case 80:
+ tempChar[0] = '2';
+ break;
+ case 81:
+ tempChar[0] = '3';
+ break;
+ case 82:
+ tempChar[0] = '0';
+ break;
+ case 83:
+ tempChar[0] = ',';
+ break;
+ case 57:
+ tempChar[0] = ' ';
+ break;
+ default:
+ int iReturnAscii;
+
+ iReturnAscii = ToAsciiEx (virtualKey, scanCode, keyState, tempChar, 0, hklUSKeyboardLayout);
+ if (iReturnAscii == 0)
+ Error ("ERR_NO_TRANSLATION", GetParent(hwnd));
+ break;
+ }
+ }
+
+ GetWindowText (hwnd, OrigPassword, ARRAYSIZE (OrigPassword));
+
+ if (tempChar[0] != '\0')
+ {
+ if ((wcslen (OrigPassword) == 0) && iPwdCounter != 0)
+ {
+ iPwdCounter = 0;
+ TranslatedPassword[iPwdCounter] = tempChar[0];
+ }
+ else if (iPwdCounter == 0)
+ {
+ TranslatedPassword[iPwdCounter] = tempChar[0];
+ }
+ else
+ {
+ if (deadKey)
+ iPwdCounter = wcslen (OrigPassword) - 1; // Dead key is already written in edit control
+ else
+ iPwdCounter = wcslen (OrigPassword);
+
+ TranslatedPassword[iPwdCounter] = tempChar[0];
+ }
+ TranslatedPassword[++iPwdCounter] = '\0';
+ }
+ else
+ {
+ burn (tempChar, sizeof (tempChar));
+ burn (OrigPassword, sizeof (OrigPassword));
+ return FALSE;
+ }
+
+ burn (tempChar, sizeof (tempChar));
+ burn (OrigPassword, sizeof (OrigPassword));
+ return TRUE;
+}
+
+wchar_t *GetTranslatedPassword ()
+{
+ return TranslatedPassword;
+}
+
+void WipeTranslatedPassword ()
+{
+ burn (TranslatedPassword, sizeof (TranslatedPassword));
+}
+
+BOOL CheckKeyboardLayout ()
+{
+ GetKeyboardLayoutName (DefaultKeyboardLayout);
+ if ((wcscmp (DefaultKeyboardLayout, TEXT ("00000409")) != 0) || (wcscmp (DefaultKeyboardLayout, TEXT ("00000409")) != 0))
+ return TRUE;
+ return FALSE;
+}
// Protects an input field from having its content updated by a Paste action. Used for pre-boot password
// input fields (only the US keyboard layout is supported in pre-boot environment so we must prevent the
@@ -1302,6 +1580,24 @@ void ToBootPwdField (HWND hwndDlg, UINT ctrlId)
WNDPROC originalwp = (WNDPROC) GetWindowLongPtrW (hwndCtrl, GWLP_USERDATA);
SendMessage (hwndCtrl, EM_LIMITTEXT, MAX_LEGACY_PASSWORD, 0);
+
+ GetKeyboardLayoutName (DefaultKeyboardLayout);
+
+ if (CheckKeyboardLayout ())
+ {
+ // Load US keyboard layout into the system
+ hklUSKeyboardLayout = LoadKeyboardLayout (TEXT ("00000409"), KLF_NOTELLSHELL);
+
+ if (hklUSKeyboardLayout == NULL)
+ AbortProcess ("ERROR_KEYB_LAYOUT_NOT_LOADED");
+
+ hklDefaultKeyboardLayout = LoadKeyboardLayout (DefaultKeyboardLayout, KLF_ACTIVATE);
+
+ /* If US keyboard layout is not availabe, LoadKeyboardLayout will return default system layout */
+
+ if (hklUSKeyboardLayout == hklDefaultKeyboardLayout)
+ AbortProcess ("ERROR_KEYB_LAYOUT_NOT_LOADED");
+ }
// if ToNormalPwdField has been called before, GWLP_USERDATA already contains original WNDPROC
if (!originalwp)
@@ -1311,6 +1607,12 @@ void ToBootPwdField (HWND hwndDlg, UINT ctrlId)
SetWindowLongPtrW (hwndCtrl, GWLP_WNDPROC, (LONG_PTR) BootPwdFieldProc);
}
+BOOL CheckIsIMESupported ()
+{
+ if (himm32dll == NULL)
+ return FALSE;
+ return TRUE;
+}
// Ensures that a warning is displayed when user is pasting a password longer than the maximum
// length which is set to 64 characters
static LRESULT CALLBACK NormalPwdFieldProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
@@ -2140,7 +2442,7 @@ SelectAlgo (HWND hComboBox, int *algo_id)
/* Something went wrong ; couldn't find the requested algo id so we drop
back to a default */
-
+
*algo_id = (int) SendMessage (hComboBox, CB_GETITEMDATA, 0, 0);
SendMessage (hComboBox, CB_SETCURSEL, 0, 0);
@@ -4730,6 +5032,53 @@ BOOL BrowseFiles (HWND hwndDlg, char *stringId, wchar_t *lpszFileName, BOOL keep
return BrowseFilesInDir (hwndDlg, stringId, NULL, lpszFileName, keepHistory, saveMode, browseFilter);
}
+BOOL BrowseFile (HWND hwndDlg, char *stringId, wchar_t *initialDir)
+{
+ OPENFILENAMEW ofn;
+ wchar_t file[TC_MAX_PATH] = { 0 };
+ wchar_t filter[1024];
+ BOOL status = FALSE;
+
+ CoInitialize (NULL);
+
+ ZeroMemory (&ofn, sizeof (ofn));
+
+ if (initialDir)
+ {
+ ofn.lpstrInitialDir = initialDir;
+ }
+
+ ofn.lStructSize = sizeof (ofn);
+ ofn.hwndOwner = hwndDlg;
+ StringCbPrintfW (filter, sizeof(filter), L"%ls (*.*)%c*.*%c",
+ GetString ("ALL_FILES"), 0, 0);
+ ofn.lpstrFilter = filter;
+ ofn.nFilterIndex = 1;
+ ofn.lpstrFile = NULL;
+ ofn.nMaxFile = sizeof (file) / sizeof (file[0]);
+ ofn.lpstrTitle = GetString (stringId);
+ ofn.lpstrDefExt = NULL;
+ ofn.Flags = OFN_HIDEREADONLY
+ | OFN_PATHMUSTEXIST
+ | OFN_DONTADDTORECENT;
+
+ SystemFileSelectorCallerThreadId = GetCurrentThreadId();
+ SystemFileSelectorCallPending = TRUE;
+
+ if (!GetOpenFileNameW (&ofn))
+ goto ret;
+
+ SystemFileSelectorCallPending = FALSE;
+
+ status = TRUE;
+
+ret:
+ SystemFileSelectorCallPending = FALSE;
+ ResetCurrentDirectory();
+ CoUninitialize();
+
+ return status;
+}
BOOL BrowseFilesInDir (HWND hwndDlg, char *stringId, wchar_t *initialDir, wchar_t *lpszFileName, BOOL keepHistory, BOOL saveMode, wchar_t *browseFilter, const wchar_t *initialFileName, const wchar_t *defaultExtension)
{
@@ -9519,8 +9868,6 @@ BOOL PrintHardCopyTextUTF16 (wchar_t *text, wchar_t *title, size_t textByteLen)
return TRUE;
}
-
-
BOOL IsNonInstallMode ()
{
HKEY hkey, hkeybis;
@@ -9619,7 +9966,6 @@ BOOL IsNonInstallMode ()
return TRUE;
}
-
LRESULT SetCheckBox (HWND hwndDlg, int dlgItem, BOOL state)
{
return SendDlgItemMessage (hwndDlg, dlgItem, BM_SETCHECK, state ? BST_CHECKED : BST_UNCHECKED, 0);
@@ -11361,7 +11707,7 @@ BYTE *MapResource (wchar_t *resourceType, int resourceId, PDWORD size)
{
HGLOBAL hResL;
HRSRC hRes;
- HINSTANCE hResInst = NULL;
+ HINSTANCE hResInst = NULL;
#ifdef SETUP_DLL
// In case we're being called from the SetupDLL project, FindResource()
@@ -11373,7 +11719,7 @@ BYTE *MapResource (wchar_t *resourceType, int resourceId, PDWORD size)
hRes = FindResource (hResInst, MAKEINTRESOURCE(resourceId), resourceType);
hResL = LoadResource (hResInst, hRes);
-
+
if (size != NULL)
*size = SizeofResource (hResInst, hRes);
@@ -15205,4 +15551,3 @@ BOOL GetHibernateStatus (BOOL& bHibernateEnabled, BOOL& bHiberbootEnabled)
return bResult;
}
-
diff --git a/src/Common/Dlgcode.h b/src/Common/Dlgcode.h
index 6370c2a7..86e655a7 100644
--- a/src/Common/Dlgcode.h
+++ b/src/Common/Dlgcode.h
@@ -259,6 +259,12 @@ typedef enum BitLockerEncryptionStatus
#define ISO_BURNER_TOOL L"isoburn.exe"
#define PRINT_TOOL L"notepad.exe"
+wchar_t *GetTranslatedPassword ();
+BOOL TranslatePwdToUSKbdLayout (HWND hwnd, LPARAM lParam, BOOL deadKey);
+void WipeTranslatedPassword ();
+BOOL CheckKeyboardLayout ();
+BOOL CheckIsIMESupported ();
+
void InitGlobalLocks ();
void FinalizeGlobalLocks ();
void cleanup ( void );
@@ -351,6 +357,7 @@ BOOL CALLBACK CipherTestDialogProc ( HWND hwndDlg , UINT uMsg , WPARAM wParam ,
void ResetCipherTest ( HWND hwndDlg , int idTestCipher );
void ResetCurrentDirectory ();
BOOL BrowseFiles (HWND hwndDlg, char *stringId, wchar_t *lpszFileName, BOOL keepHistory, BOOL saveMode, wchar_t *browseFilter);
+BOOL BrowseFile (HWND hwndDlg, char *stringId, wchar_t *initialDir);
BOOL BrowseDirectories (HWND hWnd, char *lpszTitle, wchar_t *dirName);
void handleError ( HWND hwndDlg , int code, const char* srcPos );
BOOL CheckFileStreamWriteErrors (HWND hwndDlg, FILE *file, const wchar_t *fileName);
diff --git a/src/Common/Language.xml b/src/Common/Language.xml
index cb1e7f79..fc946fce 100644
--- a/src/Common/Language.xml
+++ b/src/Common/Language.xml
@@ -6,9 +6,7 @@
<font lang="en" class="bold" size="13" face="Arial" />
<font lang="en" class="fixed" size="12" face="Lucida Console" />
<font lang="en" class="title" size="21" face="Times New Roman" />
-
- <entry lang="en" key="PAGE_1_TITLE">Encrypt Windows Drive (C:)</entry>
-
+
<entry lang="en" key="IDCANCEL">Cancel</entry>
<entry lang="en" key="IDC_ALL_USERS">Install &amp;for all users</entry>
<entry lang="en" key="IDC_BROWSE">Bro&amp;wse...</entry>
@@ -34,7 +32,6 @@
<entry lang="en" key="IDC_DEVICE_TRANSFORM_MODE_INPLACE">Encrypt partition in place</entry>
<entry lang="en" key="IDC_DISPLAY_KEYS">Display generated keys (their portions)</entry>
<entry lang="en" key="IDC_DISPLAY_POOL_CONTENTS">Display pool content</entry>
- <entry lang="en" key="IDC_DOWNLOAD_CD_BURN_SOFTWARE">Download CD/DVD recording software</entry>
<entry lang="en" key="IDC_FILE_CONTAINER">Create an encrypted file container</entry>
<entry lang="en" key="IDC_GB">&amp;GiB</entry>
<entry lang="en" key="IDC_TB">&amp;TiB</entry>
@@ -61,7 +58,7 @@
<entry lang="en" key="IDC_OPEN_OUTER_VOLUME">Open Outer Volume</entry>
<entry lang="en" key="IDC_PAUSE">&amp;Pause</entry>
<entry lang="en" key="IDC_PIM_ENABLE">Use P&amp;IM</entry>
- <entry lang="en" key="IDC_NEW_PIM_ENABLE">Use PIM</entry>
+ <entry lang="en" key="IDC_NEW_PIM_ENABLE">Modify PIM</entry>
<entry lang="en" key="IDC_QUICKFORMAT">Quick Format</entry>
<entry lang="en" key="IDC_SHOW_PASSWORD">&amp;Display password</entry>
<entry lang="en" key="IDC_SHOW_PASSWORD_SINGLE">&amp;Display password</entry>
@@ -73,7 +70,7 @@
<entry lang="en" key="IDC_SYS_DEVICE">Encrypt the system partition or entire system drive</entry>
<entry lang="en" key="IDC_SYS_PARTITION">Encrypt the Windows system partition</entry>
<entry lang="en" key="IDC_WHOLE_SYS_DRIVE">Encrypt the whole drive</entry>
- <entry lang="en" key="IDD_VOL_CREATION_WIZARD_DLG">Assistent to encrypt Windows drive (C:)</entry> <!--changed original: VeraCrypt Volume Creation Wizard -->
+ <entry lang="en" key="IDD_VOL_CREATION_WIZARD_DLG">VeraCrypt Wizard</entry>
<entry lang="en" key="IDT_CLUSTER">Cluster </entry>
<entry lang="en" key="IDT_COLLECTING_RANDOM_DATA_NOTE">IMPORTANT: Move your mouse as randomly as possible within this window. The longer you move it, the better. This significantly increases the cryptographic strength of the encryption keys. Then click Next to continue.</entry>
<entry lang="en" key="IDT_CONFIRM">&amp;Confirm:</entry>
@@ -630,7 +627,6 @@
<entry lang="en" key="PASSWORD_HIDVOL_HOST_TITLE">Outer Volume Password</entry>
<entry lang="en" key="PASSWORD_HIDVOL_TITLE">Hidden Volume Password</entry>
<entry lang="en" key="PASSWORD_HIDDEN_OS_TITLE">Password for Hidden Operating System</entry>
- <!-- Password -->
<entry lang="en" key="PASSWORD_LENGTH_WARNING">WARNING: Short passwords are easy to crack using brute force techniques!\n\nWe recommend choosing a password consisting of 20 or more characters. Are you sure you want to use a short password?</entry>
<entry lang="en" key="PASSWORD_TITLE">Volume Password</entry>
<entry lang="en" key="PASSWORD_WRONG">Operation failed due to one or more of the following:\n - Incorrect password.\n - Incorrect Volume PIM number.\n - Incorrect PRF (hash).\n - Not a valid volume.</entry>
@@ -939,8 +935,8 @@
<entry lang="en" key="ENTER_NORMAL_VOL_PASSWORD">Enter password for the normal/outer volume</entry>
<entry lang="en" key="ENTER_HIDDEN_VOL_PASSWORD">Enter password for the hidden volume</entry>
<entry lang="en" key="ENTER_HEADER_BACKUP_PASSWORD">Enter password for the header stored in backup file</entry>
-
-
+
+
<entry lang="en" key="KEYFILE_CREATED">Keyfiles have been successfully created.</entry>
<entry lang="en" key="KEYFILE_INCORRECT_NUMBER">The number of keyfiles you supplied is invalid.</entry>
<entry lang="en" key="KEYFILE_INCORRECT_SIZE">The keyfile size must be comprized between 64 and 1048576 bytes.</entry>
@@ -1110,7 +1106,6 @@
<entry lang="en" key="BOOT_PIM_REQUIRE_LONG_PASSWORD">Pre-boot authentication Password must contain 20 or more characters in order to use the specified PIM.\nShorter passwords can only be used if the PIM is 98 or greater.</entry>
<entry lang="en" key="KEYFILES_NOT_SUPPORTED_FOR_SYS_ENCRYPTION">Keyfiles are currently not supported for system encryption.</entry>
<entry lang="en" key="RESCUE_DISK_BACK_BUTTON">The Rescue Disk was already created depending on the selected options. In order to prevent incompatibility, you have to click 'cancel' and restart the system encryption process, if you want to modify any configuration.</entry>
- <entry lang="en" key="WARNING_PASSWORD_NOT_IDENTICAL">Passwords are not identical! Please type identic passwords in both fields!</entry>
<entry lang="en" key="CANNOT_RESTORE_KEYBOARD_LAYOUT">Warning: VeraCrypt could not restore the original keyboard layout. This may cause you to enter a password incorrectly.</entry>
<entry lang="en" key="CANT_CHANGE_KEYB_LAYOUT_FOR_SYS_ENCRYPTION">Error: Cannot set the keyboard layout for VeraCrypt to the standard US keyboard layout.\n\nNote that the password needs to be typed in the pre-boot environment (before Windows starts) where non-US Windows keyboard layouts are not available. Therefore, the password must always be typed using the standard US keyboard layout.</entry>
<entry lang="en" key="ALT_KEY_CHARS_NOT_FOR_SYS_ENCRYPTION">It is not possible to type characters by pressing keys while the right Alt key is held down. However, you can type most of such characters by pressing appropriate keys while the Shift key is held down.</entry>
@@ -1161,10 +1156,9 @@
<entry lang="en" key="WINDOWS_BOOT_LOADER_HINTS">If the currently running operating system is installed on the boot partition, then, after you encrypt it, you will need to enter the correct password even if you want to start any other unencrypted Windows system(s) (as they will share a single encrypted Windows boot loader/manager).\n\nIn contrast, if the currently running operating system is not installed on the boot partition (or if the Windows boot loader/manager is not used by any other system), then, after you encrypt this system, you will not need to enter the correct password to boot the other unencrypted system(s) -- you will only need to press the Esc key to start the unencrypted system (if there are multiple unencrypted systems, you will also need to choose which system to start in the VeraCrypt Boot Manager menu).\n\nNote: Typically, the earliest installed Windows system is installed on the boot partition.</entry>
<entry lang="en" key="SYSENC_PRE_DRIVE_ANALYSIS_TITLE">Encryption of Host Protected Area</entry>
<entry lang="en" key="SYSENC_PRE_DRIVE_ANALYSIS_HELP">At the end of many drives, there is an area that is normally hidden from the operating system (such areas are usually referred to as Host Protected Areas). However, some programs can read and write data from/to such areas.\n\nWARNING: Some computer manufacturers may use such areas to store tools and data for RAID, system recovery, system setup, diagnostic, or other purposes. If such tools or data must be accessible before booting, the hidden area should NOT be encrypted (choose 'No' above).\n\nDo you want VeraCrypt to detect and encrypt such a hidden area (if any) at the end of the system drive?</entry>
- <entry lang="en" key="SYSENC_TYPE_PAGE_TITLE">Type of System Encryption</entry>
+ <entry lang="en" key="SYSENC_TYPE_PAGE_TITLE">Encrypt Windows Drive (%c:)</entry>
<entry lang="en" key="SYSENC_NORMAL_TYPE_HELP">Select this option if you merely want to encrypt the system partition or the entire system drive.</entry>
<entry lang="en" key="SYSENC_HIDDEN_TYPE_HELP">It may happen that you are forced by somebody to decrypt the operating system. There are many situations where you cannot refuse to do so (for example, due to extortion). If you select this option, you will create a hidden operating system whose existence should be impossible to prove (provided that certain guidelines are followed). Thus, you will not have to decrypt or reveal the password to the hidden operating system. For a detailed explanation, please click the link below.</entry>
- <entry lang="en" key="SYSENC_ADVANCED_FEATURES_NOTE">Note: The advanced features hidden-OS encryption, full-disk encryption and multi-boot encryption are not possible on your system due to technical incompatibility (GPT partition).</entry>
<entry lang="en" key="HIDDEN_OS_PREINFO">It may happen that you are forced by somebody to decrypt the operating system. There are many situations where you cannot refuse to do so (for example, due to extortion).\n\nUsing this wizard, you can create a hidden operating system whose existence should be impossible to prove (provided that certain guidelines are followed). Thus, you will not have to decrypt or reveal the password for the hidden operating system.</entry>
<entry lang="en" key="SYSENC_HIDDEN_OS_REQ_CHECK_PAGE_TITLE">Hidden Operating System</entry>
<entry lang="en" key="SYSENC_HIDDEN_OS_REQ_CHECK_PAGE_HELP">In the following steps, you will create two VeraCrypt volumes (outer and hidden) within the first partition behind the system partition. The hidden volume will contain the hidden operating system (OS). VeraCrypt will create the hidden OS by copying the content of the system partition (where the currently running OS is installed) to the hidden volume. To the outer volume, you will copy some sensitive looking files that you actually do NOT want to hide. They will be there for anyone forcing you to disclose the password for the hidden OS partition. You can reveal the password for the outer volume within the hidden OS partition (the existence of the hidden OS remains secret).\n\nFinally, on the system partition of the currently running OS, you will install a new OS, so-called decoy OS, and encrypt it. It must not contain sensitive data and will be there for anyone forcing you to reveal your pre-boot authentication password. In total, there will be three passwords. Two of them can be disclosed (for the decoy OS and outer volume). If you use the third one, the hidden OS will start.</entry>
@@ -1180,11 +1174,10 @@
<entry lang="en" key="CD_BURNER_NOT_PRESENT_CONNECTED_NOW">A CD/DVD burner is connected to my computer now. Continue and write the Rescue Disk.</entry>
<entry lang="en" key="CD_BURNER_NOT_PRESENT_WILL_STORE_ISO_INFO">Please follow these steps:\n\n1) Connect a removable drive, such as a USB flash drive, to your computer now.\n\n2) Copy the VeraCrypt Rescue Disk image file (%s) to the removable drive.\n\nIn case you need to use the VeraCrypt Rescue Disk in the future, you will be able to connect your removable drive (containing the VeraCrypt Rescue Disk image) to a computer with a CD/DVD burner and create a bootable VeraCrypt Rescue Disk by burning the image to a CD or DVD. IMPORTANT: Note that the VeraCrypt Rescue Disk image file must be written to the CD/DVD as an ISO disk image (not as an individual file).</entry>
<entry lang="en" key="RESCUE_DISK_RECORDING_TITLE">Rescue Disk Recording</entry>
- <!--changed-->
<entry lang="en" key="AES_BOX_HELP">AES is secure according to NIST</entry>
<entry lang="en" key="BACKUP_RESCUE_DISK_TITLE">Backup Rescue Disk</entry>
<entry lang="en" key="RESCUE_DISK_CREATED_TITLE">Rescue Disk Created</entry>
- <entry lang="en" key="SYS_ENCRYPTION_PRETEST_TITLE">System Encryption Pretest</entry>
+ <entry lang="en" key="SYS_ENCRYPTION_PRETEST_TITLE">System Encryption Test</entry>
<entry lang="en" key="RESCUE_DISK_DISK_VERIFIED_TITLE">Rescue Disk Verified</entry>
<entry lang="en" key="RESCUE_DISK_VERIFIED_INFO">\nThe VeraCrypt Rescue Disk has been successfully verified. Please remove it from the drive now and store it in a safe place.\n\nClick Next to continue.</entry>
<entry lang="en" key="REMOVE_RESCUE_DISK_FROM_DRIVE">WARNING: During the next steps, the VeraCrypt Rescue Disk must not be in the drive. Otherwise, it will not be possible to complete the steps correctly.\n\nPlease remove it from the drive now and store it in a safe place. Then click OK.</entry>
@@ -1193,12 +1186,10 @@
<entry lang="en" key="SYS_ENCRYPTION_PRETEST_INFO2_PORTION_2">What to Do If Windows Cannot Start\n------------------------------------------------\n\nNote: These instructions are valid only if you have not started encrypting.\n\n- If Windows does not start after you enter the correct password (or if you repeatedly enter the correct password but VeraCrypt says that the password is incorrect), do not panic. Restart (power off and on) the computer, and in the VeraCrypt Boot Loader screen, press the Esc key on your keyboard (and if you have multiple systems, choose which to start). Then Windows should start (provided that it is not encrypted) and VeraCrypt will automatically ask whether you want to uninstall the pre-boot authentication component. Note that the previous steps do NOT work if the system partition/drive is encrypted (nobody can start Windows or access encrypted data on the drive without the correct password even if he or she follows the previous steps).\n\n</entry>
<entry lang="en" key="SYS_ENCRYPTION_PRETEST_INFO2_PORTION_3">- If the previous steps do not help or if the VeraCrypt Boot Loader screen does not appear (before Windows starts), insert the VeraCrypt Rescue Disk into your CD/DVD drive and restart your computer. If the VeraCrypt Rescue Disk screen does not appear (or if you do not see the 'Repair Options' item in the 'Keyboard Controls' section of the VeraCrypt Rescue Disk screen), it is possible that your BIOS is configured to attempt to boot from hard drives before CD/DVD drives. If that is the case, restart your computer, press F2 or Delete (as soon as you see a BIOS start-up screen), and wait until a BIOS configuration screen appears. If no BIOS configuration screen appears, restart (reset) the computer again and start pressing F2 or Delete repeatedly as soon as you restart (reset) the computer. When a BIOS configuration screen appears, configure your BIOS to boot from the CD/DVD drive first (for information on how to do so, please refer to the documentation for your BIOS/motherboard or contact your computer vendor's technical support team for assistance). Then restart your computer. The VeraCrypt Rescue Disk screen should appear now. In the VeraCrypt Rescue Disk screen, select 'Repair Options' by pressing F8 on your keyboard. From the 'Repair Options' menu, select 'Restore original system loader'. Then remove the Rescue Disk from your CD/DVD drive and restart your computer. Windows should start normally (provided that it is not encrypted).\n\n</entry>
<entry lang="en" key="SYS_ENCRYPTION_PRETEST_INFO2_PORTION_4">Note that the previous steps do NOT work if the system partition/drive is encrypted (nobody can start Windows or access encrypted data on the drive without the correct password even if he or she follows the previous steps).\n\n\nNote that even if you lose your VeraCrypt Rescue Disk and an attacker finds it, he or she will NOT be able to decrypt the system partition or drive without the correct password.</entry>
- <entry lang="en" key="SYS_ENCRYPTION_PRETEST_RESULT_TITLE">Pretest Completed</entry>
- <entry lang="en" key="SYS_ENCRYPTION_PRETEST_RESULT_INFO">The pretest has been successfully completed.\n\nWARNING: Please note that if power supply is suddenly interrupted while encrypting existing data in place, or when the operating system crashes due to a software error or hardware malfunction while VeraCrypt is encrypting existing data in place, portions of the data will be corrupted or lost. Therefore, before you start encrypting, please make sure that you have backup copies of the files you want to encrypt. If you do not, please back up the files now (you can click Cancel, back up the files, then run VeraCrypt again anytime, and select 'System' &gt; 'Resume Interrupted Process' to start encrypting).\n\nWhen ready, click Encrypt to start encrypting.</entry>
-
- <entry lang="en" key="SYSENC_ENCRYPTION_PAGE_INFO"></entry>
- <!--<entry lang="en" key="SYSENC_ENCRYPTION_PAGE_INFO">You can click Pause or Defer anytime to interrupt the process of encryption or decryption, exit this wizard, restart or shut down your computer, and then resume the process, which will continue from the point it was stopped. To prevent slowdown when the system or applications write or read data from the system drive, VeraCrypt automatically waits until the data is written or read (see Status above) and then automatically continues encrypting or decrypting.</entry>-->
-
+ <entry lang="en" key="SYS_ENCRYPTION_PRETEST_RESULT_TITLE">Pretest Successfully Completed</entry>
+ <entry lang="en" key="SYS_ENCRYPTION_PRETEST_RESULT_INFO">If the encryption is interrupted you can resume it restarting VeraCrypt and selecting 'System' > 'Resume Interrupted Process'\n\nPlease make sure, that your device does not run out of power during the encryption process.</entry>
+ <entry lang="en" key="SYSENC_ENCRYPTION_PAGE_INFO">Make sure that your device does not run out of power.\nIf the encryption is interrupted you can resume it restarting VeraCrypt and selecting 'System' > 'Resume Interrupted Process'.</entry>
+ <entry lang="en" key="SYSENC_DECRYPTION_PAGE_INFO">Make sure that your device does not run out of power.\nIf the decryption is interrupted you can resume it restarting VeraCrypt and selecting 'System' > 'Resume Interrupted Process'.</entry>
<entry lang="en" key="NONSYS_INPLACE_ENC_ENCRYPTION_PAGE_INFO">\n\nYou can click Pause or Defer anytime to interrupt the process of encryption, exit this wizard, restart or shut down your computer, and then resume the process, which will continue from the point it was stopped. Note that the volume cannot be mounted until it has been fully encrypted.</entry>
<entry lang="en" key="NONSYS_INPLACE_DEC_DECRYPTION_PAGE_INFO">\n\nYou can click Pause or Defer anytime to interrupt the process of decryption, exit this wizard, restart or shut down the computer, and then resume the process, which will continue from the point where it was stopped. Note that the volume cannot be mounted until it has been fully decrypted.</entry>
<entry lang="en" key="SYSENC_HIDDEN_OS_INITIAL_INFO_TITLE">Hidden System Started</entry>
@@ -1320,8 +1311,7 @@
<entry lang="en" key="HOST_DEVICE_REMOVAL_DISMOUNT_WARN_TITLE">Warning: VeraCrypt volume auto-dismounted</entry>
<entry lang="en" key="HOST_DEVICE_REMOVAL_DISMOUNT_WARN">Before you physically remove or turn off a device containing a mounted volume, you should always dismount the volume in VeraCrypt first.\n\nUnexpected spontaneous dismount is usually caused by an intermittently failing cable, drive (enclosure), etc.</entry>
<entry lang="en" key="UNSUPPORTED_TRUECRYPT_FORMAT">This volume was created with TrueCrypt %x.%x but VeraCrypt supports only TrueCrypt volumes created with TrueCrypt 6.x/7.x series</entry>
- <entry lang="en" key="TEST">Next ></entry>
- <!-- changed -->
+ <entry lang="en" key="TEST">Start pretest</entry>
<entry lang="en" key="KEYFILE">Keyfile</entry>
<entry lang="en" key="VKEY_08">Backspace</entry>
<entry lang="en" key="VKEY_09">Tab</entry>
@@ -1414,11 +1404,8 @@
<entry lang="en" key="TIME">Time</entry>
<entry lang="en" key="ITERATIONS">Iterations</entry>
<entry lang="en" key="PRE-BOOT">Pre-Boot</entry>
-
-
- <entry lang="en" key="RESCUE_DISK_EFI_INFO">Before you can encrypt the partition, you must create a VeraCrypt Rescue Disk (VRD), which serves the following purposes:\n\n- If the VeraCrypt Boot Loader, master key, or other critical data gets damaged, the VRD allows you to restore it (note, however, that you will still have to enter the correct password then).\n\n- If Windows gets damaged and cannot start, the VRD allows you to permanently decrypt the partition before Windows starts.\n\n- The VRD will contain a backup of the present EFI boot loader and will allow you to restore it if necessary.\n\nThe VeraCrypt Rescue Disk ZIP image will be created in the location specified below.</entry>
+ <entry lang="en" key="RESCUE_DISK_EFI_INFO">\n\nIf Windows gets damaged and cannot start, the VeraCrypt Rescue Disk allows you to permanently decrypt the partition. Note, however, that you will still have to enter the correct password then!\n\n\nWARNING: If you have already created a VeraCrypt Rescue Disk in the past, it cannot be reused for this encryption! Every time you use this encryption tool, you must create and securely store a new VeraCrypt Rescue Disk for it even if you use the same password.</entry>
<entry lang="en" key="RESCUE_DISK_EFI_EXTRACT_INFO">The Rescue Disk ZIP image has been created and stored in this file:\n%s\n\nNow you need to extract it to a USB stick that is formatted as FAT/FAT32.\n\n%lsAfter you create the Rescue Disk, click Next to verify that it has been correctly created.</entry>
-
<entry lang="en" key="RESCUE_DISK_EFI_EXTRACT_INFO_NO_CHECK">The Rescue Disk ZIP image has been created and stored in this file:\n%s\n\nNow you should either extract the image to a USB stick that is formatted as FAT/FAT32 or move it to a safe location for later use.\n\n\n\n%lsClick Next to continue.</entry>
<entry lang="en" key="RESCUE_DISK_EFI_EXTRACT_INFO_NOTE">IMPORTANT: Note that the zip file must be extracted directly to the root of the USB stick. For example, if the drive letter of the USB stick is E: then extracting the zip file should create a folder E:\\EFI on the USB stick.\n\n</entry>
<entry lang="en" key="RESCUE_DISK_EFI_CHECK_FAILED">Cannot verify that the Rescue Disk has been correctly extracted.\n\nIf you have extracted the Rescue Disk, please eject and reinsert the USB stick; then click Next to try again. If this does not help, please try another USB stick and/or another ZIP software.\n\nIf you have not extracted the Rescue Disk yet, please do so, and then click Next.\n\nIf you attempted to verify a VeraCrypt Rescue Disk created before you started this wizard, please note that such Rescue Disk cannot be used, because it was created for a different master key. You need to extract the newly generated Rescue Disk ZIP image.</entry>
@@ -1442,7 +1429,7 @@
<entry lang="en" key="PASSWORD_MAXLENGTH_REACHED">Password already reached its maximum length of %d characters.\nNo additional character is allowed.</entry>
<entry lang="en" key="IDC_SELECT_LANGUAGE_LABEL">Select the language to use during the installation:</entry>
<entry lang="en" key="VOLUME_TOO_LARGE_FOR_HOST">ERROR: The size of the file container is larger than the available free space on disk.</entry>
- <entry lang="en" key="IDC_ALLOW_WINDOWS_DEFRAG">Allow Windows Disk Defragmenter to defragment non-system partition/drive</entry>
+ <entry lang="en" key="IDC_ALLOW_WINDOWS_DEFRAG">Allow Windows Disk Defragmenter to defragment non-system partition/drive</entry>
<entry lang="en" key="CONFIRM_ALLOW_WINDOWS_DEFRAG">WARNING: Defragmenting non-system partitions/drives may leak metadata about their content or cause issues with hidden volumes they may contain.\n\nContinue?</entry>
<entry lang="en" key="VIRTUAL_DEVICE">Virtual Device</entry>
<entry lang="en" key="MOUNTED_VOLUME_NOT_ASSOCIATED">The selected mounted volume is not associated with its drive letter in Windows and so it can not be opened in Windows Explorer.</entry>
@@ -1583,19 +1570,15 @@
<entry lang="en" key="UNKNOWN_OPTION">Unknown option</entry>
<entry lang="en" key="VOLUME_LOCATION">Volume Location</entry>
<entry lang="en" key="VOLUME_HOST_IN_USE">WARNING: The host file/device {0} is already in use!\n\nIgnoring this can cause undesired results including system instability. All applications that might be using the host file/device should be closed before mounting the volume.\n\nContinue mounting?</entry>
- <!--new strings-->
- <!-- changed -->
- <entry lang="en" key="RESCUE_DISK_EFI_EXTRACT_INFO_NO_CHECK_NEW">The Rescue Disk has been created and stored in this location:\n\n%s\n\nIt is very important that you backup this file, in case that your Windows is damaged and does not start after being encrypted. You have to store it to an external device (e.g. USB stick), in your cloud or in your email account.\n\nTogether with the Rescue Disk, you can find the following two textfiles with instructions on how to use the Rescue Disk:\n- VeraCrypt Pretest.txt \n- VeraCrypt Rescue.txt \n\nIf you want to receive the Rescue Disk via email, please provide your email address: </entry>
- <entry lang="en" key="RESCUE_DISK_CHECKLIST_A">Store your password in a safe location. Be aware that there is no possibility to recover your data without the password. That is why VeraCrypt is considered to be secure.</entry>
- <entry lang="en" key="RESCUE_DISK_CHECKLIST_B">Make sure that you stored the rescue disk on an external medium. If you have not yet, do it NOW before proceeding! It is located here: \n\n%s\n</entry>
+ <entry lang="en" key="RESCUE_DISK_CHECKLIST_A">Store your password in a safe location. You can not recover your data without your password.\nThat is why VeraCrypt is considered to be secure.</entry>
+ <entry lang="en" key="RESCUE_DISK_CHECKLIST_B">Make sure that the rescue file is stored on an external medium. This could be a flash drive, an external hard drive or even a cloud storage.\nYour rescue file is located here:</entry>
<entry lang="en" key="RESCUE_DISK_CHECKLIST_C">Before you start encrypting your system, it is always a good idea to backup your personal data on an external drive for the unlikely case that the encryption process fails.</entry>
- <entry lang="en" key="RESCUE_DISK_NEW">\n\nIf Windows gets damaged and cannot start, the VeraCrypt Rescue Disk allows you to permanently decrypt the partition. Note, however, that you will still have to enter the correct password then!\n\n\nWARNING: If you have already created a VeraCrypt Rescue Disk in the past, it cannot be reused for this encryption! Every time you use this encryption tool, you must create and securely store a new VeraCrypt Rescue Disk for it even if you use the same password.</entry>
<entry lang="en" key="RESCUE_DISK_INFO_2">The VeraCrypt Rescue Disk ZIP image will be created by clicking the Next button in location specified below.</entry>
<entry lang="en" key="REMEMBER_PASSWORD"> I remember my Password</entry>
- <entry lang="en" key="STORE_RESCUE_DISK"> I securely stored the Rescue Disk</entry>
+ <entry lang="en" key="STORE_RESCUE_DISK"> I stored my rescue file</entry>
<entry lang="en" key="BACKUP_DATA"> I considered doing a backup of my personal Data</entry>
<entry lang="en" key="CHECKLIST_TITLE">Checklist - Before clicking 'Next'</entry>
- <entry lang="en" key="SYS_ENCRYPTION_PRETEST_INFO">Some tests have to be done now to verify that everything works correctly.\n\nFor this test, your computer has to be restarted. Then you will have to enter your password in the VeraCrypt Boot Loader screen that will appear before Windows starts. After Windows starts, VeraCrypt is started automatically and you will be informed about the result of this pretest.\n\n\n</entry>
+ <entry lang="en" key="SYS_ENCRYPTION_PRETEST_INFO">Some tests have to be done now to verify that everything works correctly.\n\nFor this test, your computer has to be restarted. Then you will have to enter your password in the VeraCrypt Boot Loader screen that will appear before Windows starts. After Windows starts, VeraCrypt is started automatically and you will be informed about the result of this pretest.\n\n\nThe following device will be modified: Drive %c:</entry>
<entry lang="en" key="ADVANCED_FEATURES">Advanced features</entry>
<entry lang="en" key="VERY_WEAK_PASSWORD">very weak</entry>
<entry lang="en" key="WEAK_PASSWORD">weak</entry>
@@ -1603,11 +1586,33 @@
<entry lang="en" key="STRONG_PASSWORD">strong</entry>
<entry lang="en" key="VERY_STRONG_PASSWORD">very strong</entry>
<entry lang="en" key="IDT_PASSWORD_STRENGTH">Password strength:</entry>
- <entry lang="en" key="IDT_PASSWORD_HELP">Please choose a password that is indicated as 'very strong' but at least 'medium'. \n\nKeep in mind that if you forget your password, there is no possibility to get access to your encrypted data.</entry>
- <entry lang="en" key="AES_HELP_NEW">AES is secure according to NIST.</entry>
- <entry lang="en" key="SHA512_HELP">SHA-512 is secure according to NIST.</entry>
+ <entry lang="en" key="PASSWORD_HELP_SYSENC">You might consider to write the password down somewhere safe. </entry>
+ <entry lang="en" key="AES_HELP_NEW">AES is secure accoring to the National Institute of Standards and Technology (NIST) and the privacy and security research community.</entry>
+ <entry lang="en" key="SHA512_HELP">SHA-512 is secure accoring to the National Institute of Standards and Technology (NIST) and the privacy and security research community.</entry>
<entry lang="en" key="CHOOSE_PASSWORD_TITLE">Choose Password</entry>
-
+ <entry lang="en" key="TRANSLATED_PWD_NOT_WRITTEN">Warning: Error occured while writing translated password! Please try again. If this error happens again, change keyboard layout to US keyboard layout manually.</entry>
+ <entry lang="en" key="ERROR_TRANSLATE_PWD">Warning: Error occured while translating password!\nPlease type password again and try. If this error happens again, switch keyboard layout to US keyboard layout manually.</entry>
+ <entry lang="en" key="ERROR_KEYB_LAYOUT_NOT_LOADED">Your system does not support the standard US-Keyboard layout. Please make sure the layout is available. For further help, please visit: https://support.microsoft.com/en-us/windows/manage-the-input-and-display-language-settings-in-windows-10-12a10cb4-8626-9b77-0ccb-5013e0c7c7a2 </entry>
+ <entry lang="en" key="ERROR_PASTE_ACTION">Pasting text is disabled. Please type your password.</entry>
+ <entry lang="en" key="WARNING_PASSWORD_NOT_IDENTICAL">Passwords are not identical! Please type identic passwords in both fields!</entry>
+ <entry lang="en" key="SYSENC_INFO">This assistant will help you encrypt your drive (%c:)</entry>
+ <entry lang="en" key="SYSENC_INFO_2">A windows password can easily be circumvented by bad actors with physical access to your device. Drive encryption helps to secure your data from beeing accessed by bad actors. VeraCrypt Drive Encryption will keep them out by protecting your data with an additional password. </entry>
+ <entry lang="en" key="ADV_FEATURES_INTRO_TOOLTIP">Activate hidden OS here.</entry>
+ <entry lang="en" key="ADV_FEATURES_NOTE">Most experts agree that the following preselected options are secure. Only change them if you know what you are doing. </entry>
+ <entry lang="en" key="PIM_INFO">A Personal Iterations Multiplier (PIM) allows you to set the number of password hash iterations. This provides more flexibility for adjusting the desired security level while also controling the performance of the mount/boot operation.</entry>
+ <entry lang="en" key="WIPE_INFO">Overrides your data before the encryption. This prevents possible data recovery. Wipe is not needed under normal circumstances.</entry>
+ <entry lang="en" key="PRETEST_INFO">Before encrypting VeraCrypt will verify that everything is working correctly.\n\nVeraCrypt will run some tests, restart your computer and you have to enter you password before windows starts.</entry>
+ <entry lang="en" key="PRETEST_CANCEL">If you click cancel now, no changes will be made your system.</entry>
+ <entry lang="en" key="ERROR_GETTING_PATH">Error occured while getting path to executable file.</entry>
+ <entry lang="en" key="ERROR_GETTING_PWD">Error occured while getting the password. Please try again.</entry>
+ <entry lang="en" key="ERROR_GETTING_KEYB_STATE">Error occured while getting the keyboard state.</entry>
+ <entry lang="en" key="ERR_NO_TRANSLATION">There is no translation for that key you just pressed!</entry>
+ <entry lang="en" key="DEAD_KEY_SUPPORT">Dead keys will not reproduce dead char in this case because your password need to be translated to US keyboard layout so you can type your password in pre-boot environment.</entry>
+ <entry lang="en" key="PRETEST_CHECKBOX"> I made sure that my device will not run out of power during the encryption process.</entry>
+ <entry lang="en" key="OPEN_PATH_CHECKLIST_PAGE">Open path</entry>
+ <entry lang="en" key="RESCUE_DISK_PATH">Rescue Disk Path</entry>
+ <entry lang="en" key="PRETEST_BACK_BUTTON">If you want to cancel the encryption wizard, please click on cancel. In this case no changes will be made to your computer.</entry>
+ <entry lang="en" key="WIPE_WARNING">Wiping can take a long time (Up to hours). Wiping is not recommended if you have an SSD Drive.</entry>
</localization>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="VeraCrypt">
diff --git a/src/Common/Password.c b/src/Common/Password.c
index f280de33..8c94fc06 100644
--- a/src/Common/Password.c
+++ b/src/Common/Password.c
@@ -50,12 +50,12 @@ void VerifyPasswordAndUpdate (HWND hwndDlg, HWND hButton, HWND hPassword,
utf8Len1 = WideCharToMultiByte (CP_UTF8, 0, szTmp1, -1, szTmp1Utf8, MAX_PASSWORD + 1, NULL, NULL);
utf8Len2 = WideCharToMultiByte (CP_UTF8, 0, szTmp2, -1, szTmp2Utf8, MAX_PASSWORD + 1, NULL, NULL);
- if (wcscmp (szTmp1, szTmp2) != 0){
+ if (wcscmp (szTmp1, szTmp2) != 0)
+ {
bEnable = FALSE;
- if(k>0){
- if(j>=k)
- Warning ("WARNING_PASSWORD_NOT_IDENTICAL", hwndDlg);
- }
+ if(k > 0 && j == k)
+ Warning ("WARNING_PASSWORD_NOT_IDENTICAL", hwndDlg);
+
}
else if (utf8Len1 <= 0)
bEnable = FALSE;
@@ -150,11 +150,6 @@ BOOL CheckPasswordLength (HWND hwndDlg, unsigned __int32 passwordLength, int pim
Error (bootPimCondition? "BOOT_PIM_REQUIRE_LONG_PASSWORD": "PIM_REQUIRE_LONG_PASSWORD", hwndDlg);
return FALSE;
}
-
-#ifndef _DEBUG
- if (!bSkipPasswordWarning && (MessageBoxW (hwndDlg, GetString ("PASSWORD_LENGTH_WARNING"), lpszTitle, MB_YESNO|MB_ICONWARNING|MB_DEFBUTTON2) != IDYES))
- return FALSE;
-#endif
}
#ifndef _DEBUG
else if (bCustomPimSmall)
@@ -568,4 +563,3 @@ error:
return nStatus;
}
-
diff --git a/src/Format/Format.rc b/src/Format/Format.rc
index 4e7aebe8..6001c41c 100644
--- a/src/Format/Format.rc
+++ b/src/Format/Format.rc
@@ -89,7 +89,7 @@ BEGIN
PUSHBUTTON "",IDC_PREV,243,234,60,14
DEFPUSHBUTTON "",IDC_NEXT,305,234,60,14
PUSHBUTTON "Cancel",IDCANCEL,382,234,60,14
- LTEXT "",IDC_BOX_TITLE,160,10,283,40
+ LTEXT "",IDC_BOX_TITLE,160,10,283,17
GROUPBOX "",IDC_STATIC,4,0,440,230
CONTROL 116,IDC_BITMAP_WIZARD,"Static",SS_BITMAP | SS_SUNKEN,10,18,137,200
LTEXT "",IDC_POS_BOX,160,24,281,193
@@ -99,10 +99,10 @@ IDD_CIPHER_PAGE_DLG DIALOGEX 0, 0, 276, 193
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
- COMBOBOX IDC_COMBO_BOX_HASH_ALGO,7,169,95,126,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
COMBOBOX IDC_COMBO_BOX,7,23,172,126,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
PUSHBUTTON "&Test",IDC_CIPHER_TEST,191,22,81,14
PUSHBUTTON "&Benchmark",IDC_BENCHMARK,191,122,81,14
+ COMBOBOX IDC_COMBO_BOX_HASH_ALGO,7,169,95,126,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
LTEXT "",IDC_BOX_HELP,7,40,266,78
GROUPBOX "Encryption Algorithm",IDT_ENCRYPTION_ALGO,0,10,273,131
GROUPBOX "Hash Algorithm",IDT_HASH_ALGO,0,156,273,35
@@ -116,15 +116,19 @@ FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
EDITTEXT IDC_PASSWORD,69,3,202,14,ES_PASSWORD | ES_AUTOHSCROLL
EDITTEXT IDC_VERIFY,69,20,202,14,ES_PASSWORD | ES_AUTOHSCROLL
- LTEXT "Password strength: ", IDT_PASSWORD_STRENGTH, 71, 55, 70, 20
- LTEXT "", PASSWORDMETER, 140, 55, 50, 20
- CONTROL "&Display password",IDC_SHOW_PASSWORD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,71,43,108,11,WS_EX_TRANSPARENT
+ LTEXT "Password strength: ", IDT_PASSWORD_STRENGTH, 71, 54, 70, 10
+ LTEXT "", PASSWORD_METER, 140, 55, 50, 20
+ CONTROL "&Display password",IDC_SHOW_PASSWORD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,71,41,108,11,WS_EX_TRANSPARENT
RTEXT "Password:", IDT_PASSWORD, 1, 6, 40, 8
RTEXT "&Confirm:", IDT_CONFIRM, 1, 23, 40, 8
- LTEXT "Please choose a password that is indicated as 'very strong' but at least 'medium'. \n\nKeep in mind that if you forget your password, there is no possibility to get access to your encrypted data.", IDT_PASSWORD_HELP, 1, 93, 270, 60
- PUSHBUTTON "Advanced features", IDC_ADVANCE, 203, 156, 68, 14
+ LTEXT "", IDC_BOX_HELP, 1, 95, 270, 120
+ PUSHBUTTON "Advanced features", IDC_ADVANCE, 203, 156, 68, 14, NOT WS_VISIBLE
CONTROL "",IDC_SYS_POOL_CONTENTS,"Static",SS_LEFTNOWORDWRAP | WS_GROUP | NOT WS_VISIBLE,33,17,209,63,WS_EX_TRANSPARENT
- CONTROL "", IDC_ENTROPY_BAR, "msctls_progress32", WS_BORDER | NOT WS_VISIBLE, 11, 140, 202, 6
+ CONTROL "", IDC_ENTROPY_BAR, "msctls_progress32", WS_BORDER | NOT WS_VISIBLE, 11, 140, 202, 6
+ CONTROL "U&se keyfiles",IDC_KEYFILES_ENABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,71,64,103,10
+ PUSHBUTTON "&Keyfiles...",IDC_KEY_FILES,192,65,71,14,WS_DISABLED
+ CONTROL "Use P&IM",IDC_PIM_ENABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,71,76,114,10
+
END
IDD_SIZE_PAGE_DLG DIALOGEX 0, 0, 276, 193
@@ -205,6 +209,7 @@ STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
LTEXT "",IDC_BOX_HELP,0,15,267,155
+ CONTROL "", IDC_CHECKBOX_PRETEST, "Button", BS_AUTOCHECKBOX | BS_MULTILINE | NOT WS_VISIBLE, 0, 150, 267, 50
END
IDD_HIDVOL_HOST_FILL_PAGE_DLG DIALOGEX 0, 0, 276, 193
@@ -269,12 +274,12 @@ IDD_SYSENC_RESCUE_DISK_CREATION_DLG DIALOGEX 0, 0, 276, 193
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
- EDITTEXT IDC_RESCUE_DISK_ISO_PATH, 0, 159, 180, 13, ES_AUTOHSCROLL
+ EDITTEXT IDC_RESCUE_DISK_ISO_PATH, 0, 159, 180, 13, ES_AUTOHSCROLL
PUSHBUTTON "Bro&wse...",IDC_BROWSE,185,159,70,14
LTEXT "",IDT_RESCUE_DISK_INFO,0,1,266,137
LTEXT "",IDT_RESCUE_DISK_INFO_2,0,135,266,20
CONTROL "Skip Rescue Disk verification",IDC_SKIP_RESCUE_VERIFICATION,
- "Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,0,166,273,10
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,0,178,273,10
END
IDD_SYSENC_COLLECTING_RANDOM_DATA_DLG DIALOGEX 0, 0, 276, 193
@@ -299,30 +304,30 @@ BEGIN
LTEXT "Select this option if there are two or more operating systems installed on this computer.\n\nFor example:\n- Windows XP and Windows XP\n- Windows XP and Windows Vista\n- Windows and Mac OS X\n- Windows and Linux\n- Windows, Linux and Mac OS X",IDT_MULTI_BOOT,16,89,253,90
END
-
IDD_SYSENC_RESCUE_DISK_BURN_PAGE_DLG DIALOGEX 0, 0, 276, 193
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
LTEXT "",IDT_RESCUE_DISK_BURN_INFO,0,15,275,170
- //EDITTEXT IDC_EMAIL, 0, 150, 150, 14, ES_AUTOHSCROLL//
- //PUSHBUTTON "Send", IDC_SENDMAILBUTTON, 160, 150, 30, 16,
END
IDD_SYSENC_WIPE_MODE_PAGE_DLG DIALOGEX 0, 0, 276, 193
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
- CONTROL "A", IDC_CHECKLIST_A, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 0, 13, 10, 10
+ CONTROL "A", IDC_CHECKLIST_A, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 0, 13, 10, 10
CONTROL "B", IDC_CHECKLIST_B, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 0, 60, 10, 10
- CONTROL "C", IDC_CHECKLIST_C, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 0, 120, 10, 10
+ CONTROL "C", IDC_CHECKLIST_C, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 0, 135, 10, 10
LTEXT " I remember my Password", IDC_REMEMBER_PASSWORD, 11, 13, 212, 10
LTEXT " I securely stored the Rescue Disk", IDC_STORE_RESCUE_DISK, 11, 60, 217, 10
- LTEXT " I considered doing a backup of my personal Data", IDC_BACKUP_DATA, 11, 120, 226, 10
+ LTEXT " I considered doing a backup of my personal Data", IDC_BACKUP_DATA, 11, 135, 226, 10
LTEXT "", IDT_REMEMBER_PASSWORD, 16, 26, 205, 32
- LTEXT "", IDT_STORE_RESCUE_DISK, 16, 73, 205, 43
- LTEXT "", IDT_BACKUP_DATA, 16, 131, 205, 72
- LTEXT "", IDT_WIPE_MODE_INFO, 0, 19, 225, 128, NOT WS_VISIBLE
+ LTEXT "", IDT_STORE_RESCUE_DISK, 16, 73, 205, 60
+ PUSHBUTTON "",IDC_BROWSE,16,109,60,14
+ LTEXT "", IDT_BACKUP_DATA, 16, 146, 205, 72
+ COMBOBOX IDC_WIPE_MODE,88,0,138,90,CBS_DROPDOWNLIST | WS_TABSTOP
+ RTEXT "Wipe mode:", IDT_WIPE_MODE,0,2,83,8,0,WS_EX_RIGHT
+ LTEXT "", IDT_WIPE_MODE_INFO,0,19,269,167
END
IDD_INPLACE_ENCRYPTION_PAGE_DLG DIALOGEX 0, 0, 276, 193
@@ -340,7 +345,7 @@ BEGIN
RTEXT "Done",IDT_DONE,5,27,22,8
RTEXT "Status",IDT_STATUS,73,27,33,8
RTEXT "Left",IDT_LEFT,172,27,35,8
- LTEXT "",IDC_BOX_HELP,1,77,266,95
+ LTEXT "",IDC_BOX_HELP,1,100,266,90
GROUPBOX "",IDC_STATIC,0,3,268,41
GROUPBOX "Options",IDT_FORMAT_OPTIONS,0,50,268,29
END
@@ -377,14 +382,12 @@ BEGIN
LTEXT "Progress:",IDT_PROGRESS,2,124,172,8
END
-
IDD_SYSENC_TYPE_PAGE_DLG DIALOGEX 0, 0, 276, 193
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
- LTEXT "This configuration tool will guide you to create a drive (C:) system encryption.", IDT_FILE_CONTAINER, 5, 20, 250, 16
- LTEXT "After the configuration, the computer has to be restarted and VeraCrypt will start automatically. But no changes will be made on your system before you press 'Encrypt' at the last page after the restart.", -1, 5, 50, 250, 60
- LTEXT "",ADVANCED_NOTE, 5, 120, 250, 33,
+ LTEXT "", IDC_BOX_HELP, 5, 20, 250, 16
+ LTEXT "", IDT_SYSENC_INFO_2, 5, 50, 250, 60
PUSHBUTTON "Advanced features", IDC_ADVANCE_INTRO, 190, 160, 68, 14
CONTROL "", IDC_INFORMATION_TIP, "Static", SS_ICON | SS_NOTIFY, 262,163,10,5
END
@@ -406,7 +409,6 @@ BEGIN
PUSHBUTTON "Cancel", IDCANCEL, 180, 213, 50, 14
PUSHBUTTON "&Help",IDHELP,15,213,50,14
END
-
IDD_SYSENC_HIDDEN_OS_REQ_CHECK_PAGE_DLG DIALOGEX 0, 0, 276, 193
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
FONT 8, "MS Shell Dlg", 0, 0, 0x0
@@ -484,30 +486,29 @@ BEGIN
CONTROL "Display PIM",IDC_SHOW_PIM,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,74,17,196,10
END
-IDD_ADVANCE DIALOGEX 75, -39, 245, 333
+IDD_ADVANCE DIALOGEX 75, -62, 245, 362
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Advanced Algorithm Options"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
- DEFPUSHBUTTON "OK", IDOK, 129, 313, 50, 14
- PUSHBUTTON "Cancel", IDCANCEL, 180, 313, 50, 14
- COMBOBOX IDC_COMBO_BOX_HASH_ALGO, 21, 53, 137, 126, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
- LTEXT "", IDC_SHA512_HELP, 21, 72, 205, 40
- COMBOBOX IDC_COMBO_BOX, 21, 120, 137, 126, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
- LTEXT "", IDC_BOX_HELP, 21, 137, 205, 40
- PUSHBUTTON "&Test", IDC_CIPHER_TEST, 163, 120, 59, 14
- PUSHBUTTON "&Benchmark", IDC_BENCHMARK, 163, 150, 59, 14, BS_PUSHBUTTON | WS_TABSTOP | WS_VISIBLE
- GROUPBOX "Encryption Algorithm", IDT_ENCRYPTION_ALGO, 14, 107, 217, 65
- GROUPBOX "Hash Algorithm", IDT_HASH_ALGO, 14, 40, 217, 55
- GROUPBOX "PIM", -1, 14, 180, 217, 59
- CONTROL "Use P&IM", IDC_PIM_ENABLE, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 19, 189, 97, 10
- LTEXT "A PIM is an additional secret to the password. It can be used to influence the decryption speed.", -1, 21, 205, 203, 25
-
- GROUPBOX "Wipe Mode", IDT_WIPE_MODE, 14, 245, 217, 60
- COMBOBOX IDC_WIPE_MODE, 21, 260, 127, 90, CBS_DROPDOWNLIST | WS_TABSTOP
- LTEXT "The wipe mode is used to override your data before the encryption prenventing possible data recovery.", -1, 21, 278, 200, 20,
- LTEXT "IMPORTANT: Only advanced users should make modifications on this page.", -1, 21, 11, 217, 19,
-
+ DEFPUSHBUTTON "OK", IDOK, 129, 345, 50, 14
+ PUSHBUTTON "Cancel", IDCANCEL, 180, 345, 50, 14
+ COMBOBOX IDC_COMBO_BOX_HASH_ALGO, 21, 47, 137, 130, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+ LTEXT "", IDC_SHA512_HELP, 21, 65, 205, 40
+ COMBOBOX IDC_COMBO_BOX, 21, 113, 137, 126, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+ LTEXT "", IDC_BOX_HELP, 21, 131, 205, 40
+ PUSHBUTTON "&Verify", IDC_CIPHER_TEST, 40, 181, 59, 14
+ PUSHBUTTON "&Benchmark", IDC_BENCHMARK, 140, 181, 59, 14, BS_PUSHBUTTON | WS_TABSTOP | WS_VISIBLE
+ GROUPBOX "Encryption Algorithm", IDT_ENCRYPTION_ALGO, 14, 100, 217, 60
+ GROUPBOX "Hash Algorithm", IDT_HASH_ALGO, 14, 35, 217, 60
+ GROUPBOX "Test Algorithms", IDT_TEST_ALGO, 14, 168, 217, 35
+ GROUPBOX "PIM", -1, 14, 206, 217, 59
+ CONTROL "Modify P&IM", IDC_PIM_ENABLE, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 19, 217, 97, 10
+ LTEXT "", IDT_PIM_INFO, 21, 231, 203, 25
+ GROUPBOX "Wipe Mode", IDT_WIPE_MODE, 14, 270, 217, 71
+ COMBOBOX IDC_WIPE_MODE, 21, 284, 127, 90, CBS_DROPDOWNLIST | WS_TABSTOP
+ LTEXT "", IDT_WIPE_INFO, 21, 303, 200, 32
+ LTEXT "", IDT_IMPORTANT_NOTE, 18, 10, 217, 19
END
#ifdef APSTUDIO_INVOKED
@@ -813,4 +814,3 @@ END
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED
-
diff --git a/src/Format/Resource.h b/src/Format/Resource.h
index 4f0af995..d031a7dd 100644
--- a/src/Format/Resource.h
+++ b/src/Format/Resource.h
@@ -118,7 +118,6 @@
#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
@@ -145,43 +144,40 @@
#define IDC_SHOW_PIM 1106
#define IDC_TB 1107
#define IDC_SKIP_RESCUE_VERIFICATION 1108
-#define SPARSE_FILE 1109
-#define IDC_ADVANCE_INTRO 1110 //Advanced Button in the intro page
-#define IDC_ADVANCE_PW 1111
-#define IDC_HIDE_PW 1112 //Path to hide bmp
-#define IDC_HIDE_CFM 1113
-#define HIDDEN_EYE_BUTTON 1114 //Hide Button in password page
-#define IDD_ADVANCE 1115 //Advanced password page identifier
-#define IDC_ADVANCE 1116 //Advanced Button in the password page
-#define PASSWORDMETER 1117
-#define IDC_EMAIL 1118
-#define IDC_SENDMAILBUTTON 1119
-#define IDC_REMEMBER_PASSWORD 1120
-#define IDC_STORE_RESCUE_DISK 1121
-#define IDC_BACKUP_DATA 1122
-#define IDT_REMEMBER_PASSWORD 1123
-#define IDT_STORE_RESCUE_DISK 1124
-#define IDT_BACKUP_DATA 1125
-#define IDC_CHECKLIST_A 1126
-#define IDC_CHECKLIST_B 1127
-#define IDC_CHECKLIST_C 1128
-#define ADVANCED_NOTE 1129
-#define IDD_ADVANCE_MBR 1130
-#define IDC_INFORMATION_TIP 1131
-#define IDC_SHA512_HELP 1132
-#define IDT_PASSWORD_STRENGTH 1133
-#define IDT_PASSWORD_HELP 1134
-#define IDT_RESCUE_DISK_INFO_2 1135
+#define SPARSE_FILE 1109
+#define IDC_ADVANCE_INTRO 1110
+#define IDD_ADVANCE 1111
+#define IDC_ADVANCE 1112
+#define PASSWORD_METER 1113
+#define IDC_REMEMBER_PASSWORD 1114
+#define IDC_STORE_RESCUE_DISK 1115
+#define IDC_BACKUP_DATA 1116
+#define IDT_REMEMBER_PASSWORD 1117
+#define IDT_STORE_RESCUE_DISK 1118
+#define IDT_BACKUP_DATA 1119
+#define IDC_CHECKLIST_A 1120
+#define IDC_CHECKLIST_B 1121
+#define IDC_CHECKLIST_C 1122
+#define IDD_ADVANCE_MBR 1123
+#define IDC_INFORMATION_TIP 1124
+#define IDC_SHA512_HELP 1125
+#define IDT_PASSWORD_STRENGTH 1126
+#define IDT_RESCUE_DISK_INFO_2 1127
+#define IDT_SYSENC_INFO_2 1128
+#define IDT_IMPORTANT_NOTE 1129
+#define IDT_PIM_INFO 1130
+#define IDT_WIPE_INFO 1131
+#define IDT_TEST_ALGO 1132
+#define IDC_CHECKBOX_PRETEST 1133
-
// Next default values for new objects
-//
+//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NO_MFC 1
#define _APS_NEXT_RESOURCE_VALUE 134
#define _APS_NEXT_COMMAND_VALUE 40001
-#define _APS_NEXT_CONTROL_VALUE 1109
+#define _APS_NEXT_CONTROL_VALUE 1110
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
diff --git a/src/Format/Tcformat.c b/src/Format/Tcformat.c
index 842646f7..1492060c 100644
--- a/src/Format/Tcformat.c
+++ b/src/Format/Tcformat.c
@@ -132,7 +132,7 @@ enum sys_encryption_cmd_line_switches
SYSENC_COMMAND_CREATE_HIDDEN_OS,
SYSENC_COMMAND_CREATE_HIDDEN_OS_ELEV
};
-
+
enum password_status
{
very_weak = 0,
@@ -163,19 +163,7 @@ BootEncryptionStatus BootEncStatus;
HWND hCurPage = NULL; /* Handle to current wizard page */
int nCurPageNo = -1; /* The current wizard page */
int nLastPageNo = -1;
-
-int iIconX=0;
-int iIconY=0;
-HWND hDlgItemTooltip = NULL;
-HANDLE hIconTooltip = NULL;
-
-volatile int WizardMode = WIZARD_MODE_SYS_DEVICE; /* IMPORTANT: Never change this value directly -- always use ChangeWizardMode() instead. */
-char tmp_password[127];
-int pw_strength;
-bool passwordAcceptable = false;
-char mailAdressRcv[128];
-bool emailExists = false;
-
+volatile int WizardMode = DEFAULT_VOL_CREATION_WIZARD_MODE; /* IMPORTANT: Never change this value directly -- always use ChangeWizardMode() instead. */
volatile BOOL bHiddenOS = FALSE; /* If TRUE, we are performing or (or supposed to perform) actions relating to an operating system installed in a hidden volume (i.e., encrypting a decoy OS partition or creating the outer/hidden volume for the hidden OS). To determine or set the phase of the process, call ChangeHiddenOSCreationPhase() and DetermineHiddenOSCreationPhase()) */
BOOL bDirectSysEncMode = FALSE;
BOOL bDirectSysEncModeCommand = SYSENC_COMMAND_NONE;
@@ -186,14 +174,20 @@ BOOL DirectNonSysInplaceDecResumeMode = FALSE;
BOOL DirectPromptNonSysInplaceEncResumeMode = FALSE;
BOOL DirectCreationMode = FALSE;
-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) */
+int iIconX=0;
+int iIconY=0;
+HWND hDlgItemTooltip = NULL;
+HANDLE hIconTooltip = NULL;
+char tempPassword[MAX_PASSWORD + 1];
+int iPasswordStrength;
+
+volatile BOOL bInPlaceEncNonSys = TRUE; /* 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;
-
-BOOL bDeviceTransformModeChoiceMade = TRUE; /* TRUE if the user has at least once manually selected the 'in-place' or 'format' option (on the 'device transform mode' page). */
+BOOL bDeviceTransformModeChoiceMade = FALSE; /* TRUE if the user has at least once manually selected the 'in-place' or 'format' option (on the 'device transform mode' page). */
int nNeedToStoreFilesOver4GB = 0; /* Whether the user wants to be able to store files larger than 4GB on the volume: -1 = Undecided or error, 0 = No, 1 = Yes */
int nVolumeEA = 1; /* Default encryption algorithm */
BOOL bSystemEncryptionInProgress = FALSE; /* TRUE when encrypting/decrypting the system partition/drive (FALSE when paused). */
@@ -203,12 +197,10 @@ volatile BOOL bSysEncDriveAnalysisInProgress = FALSE;
volatile BOOL bSysEncDriveAnalysisTimeOutOccurred = FALSE;
int SysEncDetectHiddenSectors = -1; /* Whether the user wants us to detect and encrypt the Host Protect Area (if any): -1 = Undecided or error, 0 = No, 1 = Yes */
int SysEncDriveAnalysisStart;
-BOOL bDontVerifyRescueDisk = TRUE; // TODO, for now always skip the 'Verification'
+BOOL bDontVerifyRescueDisk = FALSE;
BOOL bFirstSysEncResumeDone = FALSE;
BOOL bDontCheckFileContainerSize = FALSE; /* If true, we don't check if the given size of file container is smaller than the available size on the hosting disk */
-
int nMultiBoot = 0; /* The number of operating systems installed on the computer, according to the user. 0: undetermined, 1: one, 2: two or more */
-
volatile BOOL bHiddenVol = FALSE; /* If true, we are (or will be) creating a hidden volume. */
volatile BOOL bHiddenVolHost = FALSE; /* If true, we are (or will be) creating the host volume (called "outer") for a hidden volume. */
volatile BOOL bHiddenVolDirect = FALSE; /* If true, the wizard omits creating a host volume in the course of the process of hidden volume creation. */
@@ -248,6 +240,7 @@ volatile HWND hPasswordInputField = NULL; /* Password input field */
volatile HWND hVerifyPasswordInputField = NULL; /* Verify-password input field */
HBITMAP hbmWizardBitmapRescaled = NULL;
+
wchar_t OrigKeyboardLayout [8+1] = L"00000409";
BOOL bKeyboardLayoutChanged = FALSE; /* TRUE if the keyboard layout was changed to the standard US keyboard layout (from any other layout). */
BOOL bKeybLayoutAltKeyWarningShown = FALSE; /* TRUE if the user has been informed that it is not possible to type characters by pressing keys while the right Alt key is held down. */
@@ -264,6 +257,7 @@ Password volumePassword; /* User password */
Password outerVolumePassword; /* Outer volume user password */
char szVerify[MAX_PASSWORD + 1]; /* Tmp password buffer */
char szRawPassword[MAX_PASSWORD + 1]; /* Password before keyfile was applied to it */
+BOOL bNextButtonClicked = FALSE;
int volumePim = 0;
int outerVolumePim = 0;
@@ -314,8 +308,7 @@ wchar_t outRandPoolDispBuffer [RANDPOOL_DISPLAY_SIZE];
BOOL bDisplayPoolContents = TRUE;
volatile BOOL bSparseFileSwitch = FALSE;
-volatile BOOL quickFormat = FALSE; /* WARNING: Meaning of this variable depends on bSparseFileSwitch. If bSparseFileSwitch is TRUE, this variable
- represents the sparse file flag. */
+volatile BOOL quickFormat = FALSE;
volatile BOOL fastCreateFile = FALSE;
volatile BOOL dynamicFormat = FALSE; /* this variable represents the sparse file flag. */
volatile int fileSystem = FILESYS_NONE;
@@ -329,10 +322,11 @@ LONGLONG nAvailableFreeSpace = -1;
BOOL bIsSparseFilesSupportedByHost = FALSE;
vector <HostDevice> DeferredNonSysInPlaceEncDevices;
-
-BOOL CHECKLIST_A;
-BOOL CHECKLIST_B;
-BOOL CHECKLIST_C;
+
+BOOL bChecklistA;
+BOOL bChecklistB;
+BOOL bChecklistC;
+BOOL bCheckboxPretest;
int iMaxPasswordLength = MAX_PASSWORD;
@@ -1452,10 +1446,10 @@ void ComboSelChangeEA (HWND hwndDlg)
else
{
wchar_t name[100];
-
+
nIndex = (int) SendMessage (GetDlgItem (hwndDlg, IDC_COMBO_BOX), CB_GETITEMDATA, nIndex, 0);
EAGetName (name, nIndex, 0);
-
+
SetWindowTextW (GetDlgItem (hwndDlg, IDC_BOX_HELP), GetString ("AES_HELP_NEW"));
}
}
@@ -1720,15 +1714,11 @@ static void UpdateSysEncControls (void)
{
return;
}
-
+
EnableWindow (GetDlgItem (hCurPage, IDC_WIPE_MODE),
!locBootEncStatus.SetupInProgress
&& SystemEncryptionStatus == SYSENC_STATUS_ENCRYPTING);
- // TODO: try to make the pause button visible without having to hover over it
- SetWindowTextW (GetDlgItem (hCurPage, IDC_PAUSE),
- GetString ("IDC_PAUSE"));
-
SetWindowTextW (GetDlgItem (hCurPage, IDC_PAUSE),
GetString (locBootEncStatus.SetupInProgress ? "IDC_PAUSE" : "RESUME"));
@@ -2610,11 +2600,9 @@ static void __cdecl volTransformThreadFunction (void *hwndDlgArg)
volParams->headerFlags = (CreatingHiddenSysVol() ? TC_HEADER_FLAG_ENCRYPTED_SYSTEM : 0);
volParams->fileSystem = fileSystem;
volParams->clusterSize = clusterSize;
- //volParams->sparseFileSwitch = dynamicFormat; //1.24
- volParams->sparseFileSwitch = bSparseFileSwitch;
-
+ volParams->sparseFileSwitch = dynamicFormat;
volParams->quickFormat = quickFormat;
- volParams->fastCreateFile = fastCreateFile;
+ volParams->fastCreateFile = fastCreateFile;
volParams->sectorSize = GetFormatSectorSize();
volParams->realClusterSize = &realClusterSize;
volParams->password = &volumePassword;
@@ -2802,7 +2790,7 @@ static void __cdecl volTransformThreadFunction (void *hwndDlgArg)
{
Info("FORMAT_FINISHED_INFO", hwndDlg);
- if (bSparseFileSwitch && quickFormat) //u 1.24. if(dynamicFormat)
+ if (dynamicFormat)
Warning("SPARSE_FILE_SIZE_NOTE", hwndDlg);
}
}
@@ -2900,7 +2888,6 @@ static void LoadPage (HWND hwndDlg, int nPageNo)
case PASSWORD_PAGE:
{
wchar_t tmp[MAX_PASSWORD+1];
- char *passTmp[MAX_PASSWORD+1];
// Attempt to wipe passwords stored in the input field buffers. This is performed here (and
// not in the IDC_PREV or IDC_NEXT sections) in order to prevent certain race conditions
@@ -2909,7 +2896,6 @@ static void LoadPage (HWND hwndDlg, int nPageNo)
tmp [MAX_PASSWORD] = 0;
SetWindowText (hPasswordInputField, tmp);
SetWindowText (hVerifyPasswordInputField, tmp);
-
}
break;
}
@@ -3369,6 +3355,7 @@ BOOL GetFileVolSize (HWND hwndDlg, unsigned __int64 *size)
return TRUE;
}
+
BOOL QueryFreeSpace (HWND hwndDlg, HWND hwndTextBox, BOOL display, LONGLONG *pFreeSpaceValue, BOOL* pbIsSparceFilesSupported)
{
if (pFreeSpaceValue)
@@ -3737,51 +3724,81 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
UpdateWizardModeControls (hwndDlg, WizardMode);
break;
- case SYSENC_TYPE_PAGE:
+ case SYSENC_TYPE_PAGE:
+ {
+
bHiddenVolHost = bHiddenVol = bHiddenOS;
- SetWindowTextW(GetDlgItem(GetParent(hwndDlg), IDC_BOX_TITLE), GetString("PAGE_1_TITLE"));
+ wchar_t finalMsg[8024] = {0};
- SetWindowTextW (GetDlgItem (hwndDlg, IDC_BOX_HELP), GetString ("SYSENC_HIDDEN_TYPE_HELP"));
- SetWindowTextW (GetDlgItem (hwndDlg, IDC_BOX_HELP_SYSENC_NORMAL), GetString ("SYSENC_NORMAL_TYPE_HELP"));
+ try
+ {
+ StringCbPrintfW (finalMsg, sizeof(finalMsg),
+ GetString ("SYSENC_TYPE_PAGE_TITLE"),
+ GetSystemDriveLetter ());
+ }
+ catch (Exception &e)
+ {
+ e.Show (hwndDlg);
+ EndMainDlg (MainDlg);
+ return 0;
+ }
- if(bSystemIsGPT)
+ SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDC_BOX_TITLE), finalMsg);
+
+ wmemset (finalMsg, 0, sizeof (finalMsg));
+ try
+ {
+ StringCbPrintfW (finalMsg, sizeof(finalMsg),
+ GetString ("SYSENC_INFO"),
+ GetSystemDriveLetter ());
+ }
+ catch (Exception &e)
+ {
+ e.Show (hwndDlg);
+ EndMainDlg (MainDlg);
+ return 0;
+ }
+
+ SetWindowTextW (GetDlgItem (hwndDlg, IDC_BOX_HELP), finalMsg);
+ SetWindowTextW (GetDlgItem (hwndDlg, IDT_SYSENC_INFO_2), GetString ("SYSENC_INFO_2"));
+
+ if (bSystemIsGPT)
{
ShowWindow (GetDlgItem(hwndDlg, IDC_ADVANCE_INTRO), SW_HIDE);
ShowWindow (GetDlgItem(hwndDlg, IDC_INFORMATION_TIP), SW_HIDE);
}
else
{
- EnableWindow(GetDlgItem(hwndDlg, IDC_ADVANCE_INTRO), TRUE);
- iIconX = GetSystemMetrics(SM_CXSMICON);
- iIconY = GetSystemMetrics(SM_CYSMICON);
+ EnableWindow (GetDlgItem(hwndDlg, IDC_ADVANCE_INTRO), TRUE);
+ iIconX = GetSystemMetrics (SM_CXSMICON);
+ iIconY = GetSystemMetrics (SM_CYSMICON);
- hIconTooltip = LoadImage(NULL, MAKEINTRESOURCE(104), IMAGE_ICON, iIconX, iIconY, LR_DEFAULTCOLOR);
- SendDlgItemMessage(hwndDlg, IDC_INFORMATION_TIP, STM_SETICON, (WPARAM) hIconTooltip, 0);
+ hIconTooltip = LoadImage (NULL, MAKEINTRESOURCE (104), IMAGE_ICON, iIconX, iIconY, LR_DEFAULTCOLOR);
+ SendDlgItemMessage (hwndDlg, IDC_INFORMATION_TIP, STM_SETICON, (WPARAM) hIconTooltip, 0);
- hDlgItemTooltip = GetDlgItem(hwndDlg, IDC_INFORMATION_TIP);
- if(hDlgItemTooltip)
+ hDlgItemTooltip = GetDlgItem (hwndDlg, IDC_INFORMATION_TIP);
+ if (hDlgItemTooltip)
{
- // TODO Add string for tooltip here
- CreateToolTip(hwndDlg, hDlgItemTooltip, L"TESTING");
+ CreateToolTip (hwndDlg, hDlgItemTooltip, GetString ("ADV_FEATURES_INTRO_TOOLTIP"));
}
else
{
- MessageBox(0, TEXT("Cannot find dialog item"), 0, 0);
+ MessageBox (0, TEXT("Cannot find dialog item"), 0, 0);
}
}
- EnableWindow (GetDlgItem (GetParent (hwndDlg), IDC_NEXT), TRUE);
- EnableWindow(GetDlgItem(GetParent(hwndDlg), IDC_PREV), FALSE);
+
+ EnableWindow (GetDlgItem (GetParent (hwndDlg), IDC_NEXT), TRUE);
+ EnableWindow (GetDlgItem (GetParent (hwndDlg), IDC_PREV), !bDirectSysEncMode);
SetWindowTextW (GetDlgItem (MainDlg, IDC_NEXT), GetString ("NEXT"));
SetWindowTextW (GetDlgItem (MainDlg, IDC_PREV), GetString ("PREV"));
SetWindowTextW (GetDlgItem (MainDlg, IDCANCEL), GetString ("CANCEL"));
-
+
// Start loading the password dictonary into memory ("need" is just a random word for initializing the process)
CheckWord("need");
-
break;
-
+ }
case SYSENC_HIDDEN_OS_REQ_CHECK_PAGE:
SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDC_BOX_TITLE), GetString ("SYSENC_HIDDEN_OS_REQ_CHECK_PAGE_TITLE"));
@@ -3816,7 +3833,6 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
EnableWindow (GetDlgItem (GetParent (hwndDlg), IDC_PREV), TRUE);
break;
-
case SYSENC_PRE_DRIVE_ANALYSIS_PAGE:
Init2RadButtonPageYesNo (SysEncDetectHiddenSectors);
@@ -3884,12 +3900,11 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDCANCEL), GetString ("CANCEL"));
RefreshMultiBootControls (hwndDlg);
-
EnableWindow (GetDlgItem (GetParent (hwndDlg), IDC_NEXT), nMultiBoot > 0);
EnableWindow (GetDlgItem (GetParent (hwndDlg), IDC_PREV), TRUE);
EnableWindow (GetDlgItem (GetParent (hwndDlg), IDCANCEL), TRUE);
break;
-
+
case SYSENC_MULTI_BOOT_SYS_EQ_BOOT_PAGE:
@@ -4130,65 +4145,66 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
}
break;
- case CIPHER_PAGE:
- int ea, hid;
- wchar_t buf[100];
-
- // Encryption algorithms
+ case CIPHER_PAGE:
+ {
+ int ea, hid;
+ wchar_t buf[100];
- SendMessage (GetDlgItem (hwndDlg, IDC_COMBO_BOX), CB_RESETCONTENT, 0, 0);
+ // Encryption algorithms
- if (bHiddenVol)
- SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDC_BOX_TITLE), GetString (bHiddenVolHost ? "CIPHER_HIDVOL_HOST_TITLE" : "CIPHER_HIDVOL_TITLE"));
- else
- SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDC_BOX_TITLE), GetString ("CIPHER_TITLE"));
+ SendMessage (GetDlgItem (hwndDlg, IDC_COMBO_BOX), CB_RESETCONTENT, 0, 0);
- for (ea = EAGetFirst (); ea != 0; ea = EAGetNext (ea))
- {
- if (EAIsFormatEnabled (ea) && (!SysEncInEffect () || bSystemIsGPT || EAIsMbrSysEncEnabled (ea)))
- AddComboPair (GetDlgItem (hwndDlg, IDC_COMBO_BOX), EAGetName (buf, ea, 1), ea);
- }
+ if (bHiddenVol)
+ SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDC_BOX_TITLE), GetString (bHiddenVolHost ? "CIPHER_HIDVOL_HOST_TITLE" : "CIPHER_HIDVOL_TITLE"));
+ else
+ SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDC_BOX_TITLE), GetString ("CIPHER_TITLE"));
- SelectAlgo (GetDlgItem (hwndDlg, IDC_COMBO_BOX), &nVolumeEA);
- ComboSelChangeEA (hwndDlg);
- SetFocus (GetDlgItem (hwndDlg, IDC_COMBO_BOX));
+ for (ea = EAGetFirst (); ea != 0; ea = EAGetNext (ea))
+ {
+ if (EAIsFormatEnabled (ea) && (!SysEncInEffect () || bSystemIsGPT || EAIsMbrSysEncEnabled (ea)))
+ AddComboPair (GetDlgItem (hwndDlg, IDC_COMBO_BOX), EAGetName (buf, ea, 1), ea);
+ }
- ToHyperlink (hwndDlg, IDC_LINK_MORE_INFO_ABOUT_CIPHER);
+ SelectAlgo (GetDlgItem (hwndDlg, IDC_COMBO_BOX), &nVolumeEA);
+ ComboSelChangeEA (hwndDlg);
+ SetFocus (GetDlgItem (hwndDlg, IDC_COMBO_BOX));
- // Hash algorithms
+ ToHyperlink (hwndDlg, IDC_LINK_MORE_INFO_ABOUT_CIPHER);
- if (SysEncInEffect ())
- {
- hash_algo = bSystemIsGPT? SHA512 : DEFAULT_HASH_ALGORITHM_BOOT;
- RandSetHashFunction (hash_algo);
+ // Hash algorithms
- for (hid = FIRST_PRF_ID; hid <= LAST_PRF_ID; hid++)
+ if (SysEncInEffect ())
{
- // For now, we keep RIPEMD160 for system encryption
- if (((hid == RIPEMD160) || !HashIsDeprecated (hid)) && (bSystemIsGPT || HashForSystemEncryption (hid)))
- AddComboPair (GetDlgItem (hwndDlg, IDC_COMBO_BOX_HASH_ALGO), HashGetName(hid), hid);
+ hash_algo = bSystemIsGPT? SHA512 : DEFAULT_HASH_ALGORITHM_BOOT;
+ RandSetHashFunction (hash_algo);
+
+ for (hid = FIRST_PRF_ID; hid <= LAST_PRF_ID; hid++)
+ {
+ // For now, we keep RIPEMD160 for system encryption
+ if (((hid == RIPEMD160) || !HashIsDeprecated (hid)) && (bSystemIsGPT || HashForSystemEncryption (hid)))
+ AddComboPair (GetDlgItem (hwndDlg, IDC_COMBO_BOX_HASH_ALGO), HashGetName(hid), hid);
+ }
}
- }
- else
- {
- hash_algo = RandGetHashFunction();
- for (hid = FIRST_PRF_ID; hid <= LAST_PRF_ID; hid++)
+ else
{
- if (!HashIsDeprecated (hid))
- AddComboPair (GetDlgItem (hwndDlg, IDC_COMBO_BOX_HASH_ALGO), HashGetName(hid), hid);
+ hash_algo = RandGetHashFunction();
+ for (hid = FIRST_PRF_ID; hid <= LAST_PRF_ID; hid++)
+ {
+ if (!HashIsDeprecated (hid))
+ AddComboPair (GetDlgItem (hwndDlg, IDC_COMBO_BOX_HASH_ALGO), HashGetName(hid), hid);
+ }
}
- }
- SelectAlgo (GetDlgItem (hwndDlg, IDC_COMBO_BOX_HASH_ALGO), &hash_algo);
+ SelectAlgo (GetDlgItem (hwndDlg, IDC_COMBO_BOX_HASH_ALGO), &hash_algo);
- ToHyperlink (hwndDlg, IDC_LINK_HASH_INFO);
+ ToHyperlink (hwndDlg, IDC_LINK_HASH_INFO);
- // Wizard buttons
- SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDC_NEXT), GetString ("NEXT"));
- SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDC_PREV), GetString ("PREV"));
- EnableWindow (GetDlgItem (GetParent (hwndDlg), IDC_PREV), TRUE);
- EnableWindow (GetDlgItem (GetParent (hwndDlg), IDC_NEXT), TRUE);
-
+ // Wizard buttons
+ SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDC_NEXT), GetString ("NEXT"));
+ SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDC_PREV), GetString ("PREV"));
+ EnableWindow (GetDlgItem (GetParent (hwndDlg), IDC_PREV), TRUE);
+ EnableWindow (GetDlgItem (GetParent (hwndDlg), IDC_NEXT), TRUE);
+ }
break;
case SIZE_PAGE:
@@ -4342,7 +4358,9 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
break;
case PASSWORD_PAGE:
- {
+ {
+ wchar_t str[1000];
+
EnableWindow(GetDlgItem(hwndDlg, IDC_VERIFY), FALSE);
hPasswordInputField = GetDlgItem (hwndDlg, IDC_PASSWORD);
@@ -4356,35 +4374,69 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
ToBootPwdField (hwndDlg, IDC_PASSWORD);
ToBootPwdField (hwndDlg, IDC_VERIFY);
- StringCbPrintfW (OrigKeyboardLayout, sizeof(OrigKeyboardLayout), L"%08X", (DWORD) GetKeyboardLayout (NULL) & 0xFFFF);
+ bKeyboardLayoutChanged = FALSE;
- if ((DWORD) GetKeyboardLayout (NULL) != 0x00000409 && (DWORD) GetKeyboardLayout (NULL) != 0x04090409)
+ if (CheckIsIMESupported ())
{
- DWORD keybLayout = (DWORD) LoadKeyboardLayout (L"00000409", KLF_ACTIVATE);
-
- if (keybLayout != 0x00000409 && keybLayout != 0x04090409)
+ // East Asian languages are not translated to US keyboard layout so we need to change keyboard layout
+ if ((DWORD) GetKeyboardLayout (NULL) != 0x00000409 && (DWORD) GetKeyboardLayout (NULL) != 0x04090409)
{
- Error ("CANT_CHANGE_KEYB_LAYOUT_FOR_SYS_ENCRYPTION", MainDlg);
- EndMainDlg (MainDlg);
- return 1;
+ DWORD keybLayout = (DWORD) LoadKeyboardLayout (L"00000409", KLF_ACTIVATE);
+
+ if (keybLayout != 0x00000409 && keybLayout != 0x04090409)
+ {
+ Error ("CANT_CHANGE_KEYB_LAYOUT_FOR_SYS_ENCRYPTION", MainDlg);
+ EndMainDlg (MainDlg);
+ return 1;
+ }
+ bKeyboardLayoutChanged = TRUE;
}
- bKeyboardLayoutChanged = TRUE;
}
-
-
+
if (SetTimer (MainDlg, TIMER_ID_KEYB_LAYOUT_GUARD, TIMER_INTERVAL_KEYB_LAYOUT_GUARD, NULL) == 0)
{
Error ("CANNOT_SET_TIMER", MainDlg);
EndMainDlg (MainDlg);
return 1;
}
+
+ ShowWindow(GetDlgItem(hwndDlg, IDC_KEYFILES_ENABLE), SW_HIDE);
+ ShowWindow(GetDlgItem(hwndDlg, IDC_KEY_FILES), SW_HIDE);
+ ShowWindow(GetDlgItem(hwndDlg, IDC_PIM_ENABLE), SW_HIDE);
+
+ ShowWindow(GetDlgItem(hwndDlg, IDC_ADVANCE), SW_SHOW);
+ }
+ else
+ {
+ SetCheckBox (hwndDlg, IDC_PIM_ENABLE, PimEnable);
+
+ SetCheckBox (hwndDlg, IDC_KEYFILES_ENABLE, KeyFilesEnable && !SysEncInEffect());
+ EnableWindow (GetDlgItem (hwndDlg, IDC_KEY_FILES), KeyFilesEnable && !SysEncInEffect());
+ EnableWindow (GetDlgItem (hwndDlg, IDC_KEYFILES_ENABLE), !SysEncInEffect());
+
+ SetPassword (hwndDlg, IDC_PASSWORD, szRawPassword);
+ SetPassword (hwndDlg, IDC_VERIFY, szVerify);
+ }
+
+ if (bHiddenVolHost)
+ {
+ StringCbCopyW (str, sizeof(str), GetString (bHiddenOS ? "PASSWORD_SYSENC_OUTERVOL_HELP" : "PASSWORD_HIDDENVOL_HOST_HELP"));
+ }
+ else if (bHiddenVol)
+ {
+ StringCbPrintfW (str, sizeof str, L"%s%s",
+ GetString (bHiddenOS ? "PASSWORD_HIDDEN_OS_HELP" : "PASSWORD_HIDDENVOL_HELP"),
+ GetString ("PASSWORD_HELP"));
+ }
+ else
+ {
+ StringCbCopyW (str, sizeof(str), GetString ("PASSWORD_HELP_SYSENC"));
}
- SetPassword (hwndDlg, IDC_PASSWORD, szRawPassword);
- SetPassword (hwndDlg, IDC_VERIFY, szVerify);
-
SetFocus (GetDlgItem (hwndDlg, IDC_PASSWORD));
+ SetWindowTextW (GetDlgItem (hwndDlg, IDC_BOX_HELP), str);
+
if (CreatingHiddenSysVol())
SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDC_BOX_TITLE), GetString ("PASSWORD_HIDDEN_OS_TITLE"));
else if (bHiddenVol)
@@ -4393,7 +4445,7 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDC_BOX_TITLE), GetString ("CHOOSE_PASSWORD_TITLE"));
else
SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDC_BOX_TITLE), GetString ("PASSWORD_TITLE"));
-
+
SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDC_NEXT), GetString ("NEXT"));
SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDC_PREV), GetString ("PREV"));
@@ -4405,41 +4457,42 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
NULL,
NULL,
KeyFilesEnable && FirstKeyFile!=NULL && !SysEncInEffect());
-
volumePassword.Length = (unsigned __int32) strlen ((char *) volumePassword.Text);
-
- /* Random pool parameter */
+
+ if(SysEncInEffect ())
+ {
+ /* Random pool parameter is here because random page is removed */
- mouseEntropyGathered = 0xFFFFFFFF;
- mouseEventsInitialCount = 0;
- bUseMask = FALSE;
+ mouseEntropyGathered = 0xFFFFFFFF;
+ mouseEventsInitialCount = 0;
+ bUseMask = FALSE;
- {
- HCRYPTPROV hRngProv;
- if (CryptAcquireContext (&hRngProv, NULL, MS_ENHANCED_PROV, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT | CRYPT_SILENT))
{
- if (CryptGenRandom (hRngProv, sizeof (maskRandPool), maskRandPool))
- bUseMask = TRUE;
- CryptReleaseContext (hRngProv, 0);
+ HCRYPTPROV hRngProv;
+ if (CryptAcquireContext (&hRngProv, NULL, MS_ENHANCED_PROV, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT | CRYPT_SILENT))
+ {
+ if (CryptGenRandom (hRngProv, sizeof (maskRandPool), maskRandPool))
+ bUseMask = TRUE;
+ CryptReleaseContext (hRngProv, 0);
+ }
}
- }
- SetTimer(GetParent(hwndDlg), TIMER_ID_RANDVIEW, TIMER_INTERVAL_RANDVIEW, NULL);
+ SetTimer(GetParent(hwndDlg), TIMER_ID_RANDVIEW, TIMER_INTERVAL_RANDVIEW, NULL);
- hRandPoolSys = GetDlgItem(hwndDlg, IDC_SYS_POOL_CONTENTS);
- hEntropyBar = GetDlgItem(hwndDlg, IDC_ENTROPY_BAR);
- SendMessage(hEntropyBar, PBM_SETRANGE32, 0, maxEntropyLevel);
- SendMessage(hEntropyBar, PBM_SETSTEP, 1, 0);
- SendMessage(GetDlgItem(hwndDlg, IDC_SYS_POOL_CONTENTS), WM_SETFONT, (WPARAM)hFixedDigitFont, (LPARAM)TRUE);
-
+ hRandPoolSys = GetDlgItem(hwndDlg, IDC_SYS_POOL_CONTENTS);
+ hEntropyBar = GetDlgItem(hwndDlg, IDC_ENTROPY_BAR);
+ SendMessage(hEntropyBar, PBM_SETRANGE32, 0, maxEntropyLevel);
+ SendMessage(hEntropyBar, PBM_SETSTEP, 1, 0);
+ SendMessage(GetDlgItem(hwndDlg, IDC_SYS_POOL_CONTENTS), WM_SETFONT, (WPARAM)hFixedDigitFont, (LPARAM)TRUE);
- /* set default values */
+ /* set default values */
- hash_algo = bSystemIsGPT ? SHA512 : DEFAULT_HASH_ALGORITHM_BOOT;
- RandSetHashFunction(hash_algo);
+ hash_algo = bSystemIsGPT ? SHA512 : DEFAULT_HASH_ALGORITHM_BOOT;
+ RandSetHashFunction(hash_algo);
- nWipeMode = TC_WIPE_1_RAND;
+ nWipeMode = TC_WIPE_NONE;
}
+ }
break;
case PIM_PAGE:
@@ -4567,7 +4620,7 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDC_BOX_TITLE), GetString ("RESCUE_DISK"));
SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDC_NEXT), GetString ("NEXT"));
SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDC_PREV), GetString ("PREV"));
- SetWindowTextW(GetDlgItem(hwndDlg, IDT_RESCUE_DISK_INFO), GetString("RESCUE_DISK_NEW"));
+ SetWindowTextW (GetDlgItem (hwndDlg, IDT_RESCUE_DISK_INFO), bSystemIsGPT? GetString ("RESCUE_DISK_EFI_INFO"): GetString ("RESCUE_DISK_INFO"));
SetWindowTextW(GetDlgItem(hwndDlg, IDT_RESCUE_DISK_INFO_2), GetString("RESCUE_DISK_INFO_2"));
SetCheckBox (hwndDlg, IDC_SKIP_RESCUE_VERIFICATION, bDontVerifyRescueDisk);
@@ -4599,15 +4652,12 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
}
SetWindowTextW (GetDlgItem (hwndDlg, IDT_RESCUE_DISK_BURN_INFO), szTmp);
-
EnableWindow (GetDlgItem (GetParent (hwndDlg), IDC_NEXT), TRUE);
-
+
/* The 'Back' button is enabled but user can't go back, instead warning is provided */
EnableWindow(GetDlgItem(GetParent(hwndDlg), IDC_PREV), TRUE);
- ShowWindow(GetDlgItem(hwndDlg, IDC_DOWNLOAD_CD_BURN_SOFTWARE), SW_HIDE);
- }
-
+ }
break;
case SYSENC_RESCUE_DISK_VERIFIED_PAGE:
@@ -4629,41 +4679,79 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
break;
case SYSENC_WIPE_MODE_PAGE:
- case NONSYS_INPLACE_ENC_WIPE_MODE_PAGE:// Checklist page
-
- wchar_t szTmp[8192];
+ case NONSYS_INPLACE_ENC_WIPE_MODE_PAGE:
+ {
+ if (SysEncInEffect ())
+ {
+ /* Wipe mode page is now checklist page */
+ ShowWindow (GetDlgItem (hwndDlg, IDC_WIPE_MODE), SW_HIDE);
+ ShowWindow (GetDlgItem (hwndDlg, IDT_WIPE_MODE), SW_HIDE);
+ ShowWindow (GetDlgItem (hwndDlg, IDT_WIPE_MODE_INFO), SW_HIDE);
- SetWindowTextW (GetDlgItem (hwndDlg, IDC_REMEMBER_PASSWORD), GetString ("REMEMBER_PASSWORD"));
- SetWindowTextW (GetDlgItem (hwndDlg, IDC_STORE_RESCUE_DISK), GetString ("STORE_RESCUE_DISK"));
- SetWindowTextW (GetDlgItem (hwndDlg, IDC_BACKUP_DATA), GetString ("BACKUP_DATA"));
+ SetWindowTextW (GetDlgItem (hwndDlg, IDC_REMEMBER_PASSWORD), GetString ("REMEMBER_PASSWORD"));
+ SetWindowTextW (GetDlgItem (hwndDlg, IDC_STORE_RESCUE_DISK), GetString ("STORE_RESCUE_DISK"));
+ SetWindowTextW (GetDlgItem (hwndDlg, IDC_BACKUP_DATA), GetString ("BACKUP_DATA"));
- SendMessage(GetDlgItem(hwndDlg, IDC_REMEMBER_PASSWORD), WM_SETFONT, (WPARAM)hUserBoldFont, (LPARAM)TRUE);
- SendMessage(GetDlgItem(hwndDlg, IDC_STORE_RESCUE_DISK), WM_SETFONT, (WPARAM)hUserBoldFont, (LPARAM)TRUE);
- SendMessage(GetDlgItem(hwndDlg, IDC_BACKUP_DATA), WM_SETFONT, (WPARAM)hUserBoldFont, (LPARAM)TRUE);
-
- CHECKLIST_A = FALSE;
- CHECKLIST_B = FALSE;
- CHECKLIST_C = FALSE;
+ SendMessage(GetDlgItem(hwndDlg, IDC_REMEMBER_PASSWORD), WM_SETFONT, (WPARAM)hUserBoldFont, (LPARAM)TRUE);
+ SendMessage(GetDlgItem(hwndDlg, IDC_STORE_RESCUE_DISK), WM_SETFONT, (WPARAM)hUserBoldFont, (LPARAM)TRUE);
+ SendMessage(GetDlgItem(hwndDlg, IDC_BACKUP_DATA), WM_SETFONT, (WPARAM)hUserBoldFont, (LPARAM)TRUE);
+
+ bChecklistA = FALSE;
+ bChecklistB = FALSE;
+ bChecklistC = FALSE;
- SetWindowTextW(GetDlgItem(GetParent(hwndDlg), IDC_BOX_TITLE), GetString("CHECKLIST_TITLE"));
+ SetWindowTextW(GetDlgItem(GetParent(hwndDlg), IDC_BOX_TITLE), GetString("CHECKLIST_TITLE"));
- StringCbPrintfW(szTmp, sizeof szTmp,
- GetString("RESCUE_DISK_CHECKLIST_B"),
- szRescueDiskISO, "");
- SetDlgItemText(hwndDlg, IDT_STORE_RESCUE_DISK, szTmp);
- SetWindowTextW (GetDlgItem (hwndDlg, IDT_REMEMBER_PASSWORD), GetString ("RESCUE_DISK_CHECKLIST_A"));
- SetWindowTextW (GetDlgItem (hwndDlg, IDT_BACKUP_DATA), GetString ("RESCUE_DISK_CHECKLIST_C"));
+ SetDlgItemText(hwndDlg, IDC_BROWSE, GetString ("OPEN_PATH_CHECKLIST_PAGE"));
+ SetWindowTextW (GetDlgItem (hwndDlg, IDT_STORE_RESCUE_DISK), GetString ("RESCUE_DISK_CHECKLIST_B"));
+ SetWindowTextW (GetDlgItem (hwndDlg, IDT_REMEMBER_PASSWORD), GetString ("RESCUE_DISK_CHECKLIST_A"));
+ SetWindowTextW (GetDlgItem (hwndDlg, IDT_BACKUP_DATA), GetString ("RESCUE_DISK_CHECKLIST_C"));
- EnableWindow(GetDlgItem(hwndDlg, IDC_REMEMBER_PASSWORD), TRUE);
- EnableWindow(GetDlgItem(hwndDlg, IDC_STORE_RESCUE_DISK), TRUE);
- EnableWindow(GetDlgItem(hwndDlg, IDC_BACKUP_DATA), TRUE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_REMEMBER_PASSWORD), TRUE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_STORE_RESCUE_DISK), TRUE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_BACKUP_DATA), TRUE);
- SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDC_NEXT), GetString ("NEXT"));
+ SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDC_NEXT), GetString ("NEXT"));
- SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDC_PREV), GetString ("PREV"));
- EnableWindow (GetDlgItem (GetParent (hwndDlg), IDC_PREV), TRUE);
- EnableWindow (GetDlgItem (GetParent (hwndDlg), IDC_NEXT), FALSE);
-
+ SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDC_PREV), GetString ("PREV"));
+ EnableWindow (GetDlgItem (GetParent (hwndDlg), IDC_PREV), TRUE);
+ EnableWindow (GetDlgItem (GetParent (hwndDlg), IDC_NEXT), FALSE);
+ }
+ else
+ {
+ /* Hide elements from Checklist page and show Wipe mode page */
+ ShowWindow (GetDlgItem (hwndDlg, IDC_CHECKLIST_A), SW_HIDE);
+ ShowWindow (GetDlgItem (hwndDlg, IDC_CHECKLIST_B), SW_HIDE);
+ ShowWindow (GetDlgItem (hwndDlg, IDC_CHECKLIST_C), SW_HIDE);
+ ShowWindow (GetDlgItem (hwndDlg, IDC_STORE_RESCUE_DISK), SW_HIDE);
+ ShowWindow (GetDlgItem (hwndDlg, IDC_REMEMBER_PASSWORD), SW_HIDE);
+ ShowWindow (GetDlgItem (hwndDlg, IDC_BACKUP_DATA), SW_HIDE);
+ ShowWindow (GetDlgItem (hwndDlg, IDT_REMEMBER_PASSWORD), SW_HIDE);
+ ShowWindow (GetDlgItem (hwndDlg, IDT_STORE_RESCUE_DISK), SW_HIDE);
+ ShowWindow (GetDlgItem (hwndDlg, IDT_BACKUP_DATA), SW_HIDE);
+ ShowWindow (GetDlgItem (hwndDlg, IDC_BROWSE), SW_HIDE);
+ ShowWindow (GetDlgItem (hwndDlg, IDC_RESCUE_DISK_ISO_PATH), SW_HIDE);
+
+ if (nWipeMode == TC_WIPE_1_RAND)
+ nWipeMode = TC_WIPE_NONE;
+
+ SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDC_BOX_TITLE), GetString ("WIPE_MODE_TITLE"));
+ SetWindowTextW (GetDlgItem (hwndDlg, IDT_WIPE_MODE_INFO), GetString ("INPLACE_ENC_WIPE_MODE_INFO"));
+
+ PopulateWipeModeCombo (GetDlgItem (hwndDlg, IDC_WIPE_MODE),
+ SystemEncryptionStatus == SYSENC_STATUS_DECRYPTING && !bInPlaceEncNonSys,
+ TRUE,
+ FALSE);
+
+ SelectAlgo (GetDlgItem (hwndDlg, IDC_WIPE_MODE), (int *) &nWipeMode);
+
+ SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDC_NEXT), GetString ("NEXT"));
+
+ SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDC_PREV), GetString ("PREV"));
+ EnableWindow (GetDlgItem (GetParent (hwndDlg), IDC_PREV), TRUE);
+ EnableWindow (GetDlgItem (GetParent (hwndDlg), IDC_NEXT), TRUE);
+ }
+ }
break;
case SYSENC_PRETEST_INFO_PAGE:
@@ -4685,7 +4773,7 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
{
StringCbPrintfW (finalMsg, sizeof(finalMsg),
GetString ("SYS_ENCRYPTION_PRETEST_INFO"),
- BootEncObj->GetSystemDriveConfiguration().DriveNumber);
+ GetSystemDriveLetter ());
}
catch (Exception &e)
{
@@ -4709,14 +4797,30 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDC_BOX_TITLE), GetString ("SYS_ENCRYPTION_PRETEST_RESULT_TITLE"));
SetWindowTextW (GetDlgItem (hwndDlg, IDC_BOX_HELP), GetString ("SYS_ENCRYPTION_PRETEST_RESULT_INFO"));
+ ShowWindow (GetDlgItem (hwndDlg, IDC_CHECKBOX_PRETEST), SW_SHOW);
+ SetWindowTextW (GetDlgItem (hwndDlg, IDC_CHECKBOX_PRETEST), GetString ("PRETEST_CHECKBOX"));
+
+ bCheckboxPretest = FALSE;
+
SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDC_NEXT), GetString ("ENCRYPT"));
SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDC_PREV), GetString ("PREV"));
SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDCANCEL), GetString ("DEFER"));
- EnableWindow (GetDlgItem (GetParent (hwndDlg), IDC_NEXT), TRUE);
- EnableWindow (GetDlgItem (GetParent (hwndDlg), IDC_PREV), FALSE);
+ EnableWindow (GetDlgItem (GetParent (hwndDlg), IDC_NEXT), FALSE);
+ EnableWindow (GetDlgItem (GetParent (hwndDlg), IDC_PREV), TRUE);
EnableWindow (GetDlgItem (GetParent (hwndDlg), IDCANCEL), TRUE);
+ HWND hTooltip;
+ hTooltip = GetDlgItem (GetParent (hwndDlg), IDC_PREV);
+ if (hTooltip)
+ {
+ CreateToolTip (hwndDlg, hTooltip, GetString ("PRETEST_BACK_BUTTON"));
+ }
+ else
+ {
+ MessageBox (0, TEXT ("Cannot find dialog item for tooltip!"), 0, 0);
+ }
+
break;
case SYSENC_ENCRYPTION_PAGE:
@@ -4738,7 +4842,9 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDC_BOX_TITLE),
GetString (SystemEncryptionStatus != SYSENC_STATUS_DECRYPTING ? "ENCRYPTION" : "DECRYPTION"));
-
+
+ SetWindowTextW (GetDlgItem (hwndDlg, IDC_BOX_HELP),
+ GetString (SystemEncryptionStatus != SYSENC_STATUS_DECRYPTING ? "SYSENC_ENCRYPTION_PAGE_INFO" : "SYSENC_DECRYPTION_PAGE_INFO"));
SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDCANCEL), GetString ("DEFER"));
@@ -4747,11 +4853,6 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDC_NEXT),
GetString (SystemEncryptionStatus != SYSENC_STATUS_DECRYPTING ? "ENCRYPT" : "DECRYPT"));
- //TODO current: 'Pause' button is not vidible until hover over it
- SetWindowTextW (GetDlgItem (hwndDlg, IDC_PAUSE),
- GetString ( "IDC_PAUSE"));
- EnableWindow (GetDlgItem (hwndDlg, IDC_PAUSE), TRUE);
-
SetWindowTextW (GetDlgItem (hwndDlg, IDC_PAUSE),
GetString (bSystemEncryptionInProgress ? "IDC_PAUSE" : "RESUME"));
@@ -4761,14 +4862,13 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
EnableWindow (GetDlgItem (GetParent (hwndDlg), IDCANCEL), TRUE);
EnableWindow (GetDlgItem (GetParent (hwndDlg), IDHELP), TRUE);
-
if (SystemEncryptionStatus == SYSENC_STATUS_DECRYPTING)
{
nWipeMode = TC_WIPE_NONE;
EnableWindow (GetDlgItem (hwndDlg, IDC_WIPE_MODE), FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDT_WIPE_MODE), FALSE);
PopulateWipeModeCombo (GetDlgItem (hwndDlg, IDC_WIPE_MODE), TRUE, TRUE, FALSE);
- SelectAlgo (GetDlgItem (hwndDlg, IDC_WIPE_MODE), (int *) &nWipeMode);
+ SelectAlgo (GetDlgItem (hwndDlg, IDC_WIPE_MODE), (int *) &nWipeMode);
}
else
{
@@ -4776,13 +4876,14 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
PopulateWipeModeCombo (GetDlgItem (hwndDlg, IDC_WIPE_MODE), FALSE, TRUE, FALSE);
SelectAlgo (GetDlgItem (hwndDlg, IDC_WIPE_MODE), (int *) &nWipeMode);
}
-
- if (nWipeMode == TC_WIPE_NONE || nWipeMode == TC_WIPE_1_RAND)
+
+ if (nWipeMode == TC_WIPE_NONE)
{
ShowWindow (GetDlgItem(hwndDlg, IDC_WIPE_MODE), SW_HIDE);
ShowWindow (GetDlgItem(hwndDlg, IDT_FORMAT_OPTIONS), SW_HIDE);
ShowWindow (GetDlgItem(hwndDlg, IDT_WIPE_MODE), SW_HIDE);
}
+
PostMessage (hwndDlg, TC_APPMSG_PERFORM_POST_SYSENC_WMINIT_TASKS, 0, 0);
}
else
@@ -4842,7 +4943,7 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
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);
@@ -4854,15 +4955,8 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
EnableWindow (GetDlgItem (hwndDlg, IDC_WIPE_MODE), TRUE);
PopulateWipeModeCombo (GetDlgItem (hwndDlg, IDC_WIPE_MODE), FALSE, TRUE, FALSE);
SelectAlgo (GetDlgItem (hwndDlg, IDC_WIPE_MODE), (int *) &nWipeMode);
-
- }
-
- if (nWipeMode == TC_WIPE_NONE || nWipeMode == TC_WIPE_1_RAND)
- {
- ShowWindow (GetDlgItem(hwndDlg, IDC_WIPE_MODE), SW_HIDE);
- ShowWindow (GetDlgItem(hwndDlg, IDT_FORMAT_OPTIONS), SW_HIDE);
- ShowWindow (GetDlgItem(hwndDlg, IDT_WIPE_MODE), SW_HIDE);
}
+
break;
case NONSYS_INPLACE_ENC_TRANSFORM_FINISHED_PAGE:
@@ -4991,7 +5085,6 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
{
dynamicFormat = FALSE;
bSparseFileSwitch = FALSE;
-
SetCheckBox (hwndDlg, SPARSE_FILE, FALSE);
EnableWindow (GetDlgItem (hwndDlg, SPARSE_FILE), FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDC_QUICKFORMAT), TRUE);
@@ -5000,7 +5093,7 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
{
wchar_t root[TC_MAX_PATH];
DWORD fileSystemFlags = 0;
-
+
/* Check if the host file system supports sparse files */
if (GetVolumePathName (szFileName, root, array_capacity (root)))
@@ -5015,7 +5108,6 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
dynamicFormat = FALSE;
SetCheckBox (hwndDlg, SPARSE_FILE, FALSE);
}
-
EnableWindow (GetDlgItem (hwndDlg, SPARSE_FILE), bSparseFileSwitch);
EnableWindow (GetDlgItem (hwndDlg, IDC_QUICKFORMAT), TRUE);
}
@@ -5246,6 +5338,7 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
break;
case DEVICE_WIPE_PAGE:
+
if (bHiddenOS && IsHiddenOSRunning())
{
// Decoy system partition wipe
@@ -5280,7 +5373,7 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
case WM_CTLCOLORSTATIC:
{
- if ((HWND)lParam == GetDlgItem (hwndDlg, PASSWORDMETER) && pw_strength == 1)
+ if ((HWND)lParam == GetDlgItem (hwndDlg, PASSWORD_METER) && iPasswordStrength == 1)
{
// we're about to draw the static
// set the text colour in (HDC)lParam
@@ -5288,7 +5381,8 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
SetTextColor ((HDC)wParam, RGB(255, 0, 0)); // password weak red
return (BOOL)GetSysColorBrush(COLOR_MENU);
}
- if ((HWND)lParam == GetDlgItem (hwndDlg, PASSWORDMETER) && pw_strength == 2)
+
+ if ((HWND)lParam == GetDlgItem (hwndDlg, PASSWORD_METER) && iPasswordStrength == 2)
{
// we're about to draw the static
// set the text colour in (HDC)lParam
@@ -5297,28 +5391,28 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
return (BOOL) GetSysColorBrush (COLOR_MENU);
}
- if ((HWND)lParam == GetDlgItem (hwndDlg, PASSWORDMETER) && pw_strength == 3)
+ if ((HWND)lParam == GetDlgItem (hwndDlg, PASSWORD_METER) && iPasswordStrength == 3)
{
SetBkMode ((HDC)wParam, TRANSPARENT);
SetTextColor ((HDC)wParam, RGB (218, 218, 0)); // password strong yellow
return (BOOL) GetSysColorBrush (COLOR_MENU);
}
- if ((HWND)lParam == GetDlgItem (hwndDlg, PASSWORDMETER) && pw_strength == 4)
+ if ((HWND)lParam == GetDlgItem (hwndDlg, PASSWORD_METER) && iPasswordStrength == 4)
{
SetBkMode((HDC)wParam, TRANSPARENT);
SetTextColor((HDC)wParam, RGB(50, 205, 50)); // password very strong green
return (BOOL) GetSysColorBrush (COLOR_MENU);
}
-
- if (PimValueChangedWarning && ((HWND)lParam == GetDlgItem (hwndDlg, IDC_PIM_HELP)) )
+
+ if (PimValueChangedWarning && ((HWND)lParam == GetDlgItem(hwndDlg, IDC_PIM_HELP)) )
{
// we're about to draw the static
// set the text colour in (HDC)lParam
- SetBkMode ((HDC)wParam,TRANSPARENT);
- SetTextColor ((HDC)wParam, RGB (255,0,0));
+ SetBkMode((HDC)wParam,TRANSPARENT);
+ SetTextColor((HDC)wParam, RGB(255,0,0));
// NOTE: per documentation as pointed out by selbie, GetSolidBrush would leak a GDI handle.
- return (BOOL) GetSysColorBrush (COLOR_MENU);
+ return (BOOL)GetSysColorBrush(COLOR_MENU);
}
}
return 0;
@@ -5372,6 +5466,7 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
return 1;
}
}
+
if (lw == IDC_ADVANCE_INTRO && nCurPageNo == SYSENC_TYPE_PAGE)
{
DialogBoxParamW(hInst,
@@ -5379,7 +5474,15 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
(DLGPROC)AdvanceDlgProcIntro, NULL);
return 1;
}
-
+
+ if (lw == IDC_ADVANCE && nCurPageNo == PASSWORD_PAGE)
+ {
+ DialogBoxParamW(hInst,
+ MAKEINTRESOURCEW(IDD_ADVANCE), hwndDlg,
+ (DLGPROC)AdvanceDlgProc, NULL);
+ return 1;
+ }
+
if (nCurPageNo == SYSENC_HIDDEN_OS_REQ_CHECK_PAGE && lw == IDC_HIDDEN_SYSENC_INFO_LINK)
{
Applink ("hiddensysenc");
@@ -5432,14 +5535,6 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
break;
}
- if (lw == IDC_ADVANCE && nCurPageNo == PASSWORD_PAGE)
- {
- DialogBoxParamW(hInst,
- MAKEINTRESOURCEW(IDD_ADVANCE), hwndDlg,
- (DLGPROC)AdvanceDlgProc, NULL);
- return 1;
- }
-
if (nCurPageNo == FILESYS_PAGE && (lw == IDC_CHOICE1 || lw == IDC_CHOICE2))
{
if (bWarnOuterVolSuitableFileSys && lw == IDC_CHOICE1 && bHiddenVolHost)
@@ -5703,7 +5798,6 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
bValidEntry = FALSE;
}
}
-
EnableWindow (GetDlgItem (GetParent (hwndDlg), IDC_NEXT),
bValidEntry);
@@ -5739,48 +5833,55 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
if (hw == EN_CHANGE && nCurPageNo == PASSWORD_PAGE)
{
- VerifyPasswordAndUpdate (hwndDlg, GetDlgItem (GetParent (hwndDlg), IDC_NEXT),
- GetDlgItem(hCurPage, IDC_PASSWORD),
- GetDlgItem(hCurPage, IDC_VERIFY),
- volumePassword.Text,
- szVerify,
- KeyFilesEnable && FirstKeyFile != NULL && !SysEncInEffect());
-
+ // If 'Next' button was clicked (and keyboard layout is not US), don't verify
+ if (!bNextButtonClicked)
+ {
+ VerifyPasswordAndUpdate (hwndDlg, GetDlgItem (GetParent (hwndDlg), IDC_NEXT),
+ GetDlgItem(hCurPage, IDC_PASSWORD),
+ GetDlgItem(hCurPage, IDC_VERIFY),
+ NULL,
+ NULL,
+ KeyFilesEnable && FirstKeyFile != NULL && !SysEncInEffect());
+
+ bNextButtonClicked = FALSE;
+ }
+
volumePassword.Length = (unsigned __int32) strlen ((char *) volumePassword.Text);
- SendMessage(GetDlgItem(hwndDlg, PASSWORDMETER), WM_SETFONT, (WPARAM)hUserBoldFont, (LPARAM)TRUE);
+ SendMessage (GetDlgItem (hwndDlg, PASSWORD_METER), WM_SETFONT, (WPARAM)hUserBoldFont, (LPARAM)TRUE);
- memset(&tmp_password[0], 0, sizeof(tmp_password));
- for (unsigned int i = 0; i < volumePassword.Length; i++)
- {
- tmp_password[i] = volumePassword.Text[i];
- }
+ memset (&tempPassword[0], 0, sizeof (tempPassword));
+
+ if (GetPassword (hCurPage, IDC_PASSWORD, tempPassword, iMaxPasswordLength + 1, FALSE, TRUE))
+ iPasswordStrength = PrintStrongness (tempPassword, strlen (tempPassword));
+ else
+ Error ("ERROR_GETTING_PWD", hwndDlg);
- pw_strength = printStrongNess(tmp_password, volumePassword.Length);
+ burn (tempPassword, sizeof (tempPassword));
- if (pw_strength == very_strong)
+ if (iPasswordStrength == very_strong)
{
- SetWindowTextW(GetDlgItem (hwndDlg, PASSWORDMETER), GetString ("VERY_STRONG_PASSWORD"));
- EnableWindow(GetDlgItem (hwndDlg, IDC_VERIFY), TRUE);
+ SetWindowTextW (GetDlgItem (hwndDlg, PASSWORD_METER), GetString ("VERY_STRONG_PASSWORD"));
+ EnableWindow (GetDlgItem (hwndDlg, IDC_VERIFY), TRUE);
}
- else if (pw_strength == strong)
+ else if (iPasswordStrength == strong)
{
- SetWindowTextW(GetDlgItem (hwndDlg, PASSWORDMETER), GetString ("STRONG_PASSWORD"));
- EnableWindow(GetDlgItem (hwndDlg, IDC_VERIFY), TRUE);
+ SetWindowTextW (GetDlgItem (hwndDlg, PASSWORD_METER), GetString ("STRONG_PASSWORD"));
+ EnableWindow (GetDlgItem (hwndDlg, IDC_VERIFY), TRUE);
}
- else if (pw_strength == medium)
+ else if (iPasswordStrength == medium)
{
- EnableWindow(GetDlgItem (hwndDlg, IDC_VERIFY), TRUE);
- SetWindowTextW(GetDlgItem (hwndDlg, PASSWORDMETER), GetString ("MEDIUM_PASSWORD"));
+ EnableWindow (GetDlgItem (hwndDlg, IDC_VERIFY), TRUE);
+ SetWindowTextW (GetDlgItem (hwndDlg, PASSWORD_METER), GetString ("MEDIUM_PASSWORD"));
}
- else if (pw_strength == weak)
+ else if (iPasswordStrength == weak)
{
- EnableWindow(GetDlgItem (hwndDlg, IDC_VERIFY), FALSE);
- SetWindowTextW(GetDlgItem (hwndDlg, PASSWORDMETER), GetString ("WEAK_PASSWORD"));
+ EnableWindow (GetDlgItem (hwndDlg, IDC_VERIFY), FALSE);
+ SetWindowTextW (GetDlgItem (hwndDlg, PASSWORD_METER), GetString ("WEAK_PASSWORD"));
}
else
{
- SetWindowTextW(GetDlgItem(hwndDlg, PASSWORDMETER), GetString ("VERY_WEAK_PASSWORD"));
+ SetWindowTextW (GetDlgItem (hwndDlg, PASSWORD_METER), GetString ("VERY_WEAK_PASSWORD"));
}
return 1;
}
@@ -5809,25 +5910,37 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
HandleShowPasswordFieldAction (hwndDlg, IDC_SHOW_PASSWORD, IDC_PASSWORD, IDC_VERIFY);
return 1;
}
-
-
+
if (lw == IDC_SHOW_PIM && nCurPageNo == PIM_PAGE)
{
HandleShowPasswordFieldAction (hwndDlg, IDC_SHOW_PIM, IDC_PIM, 0);
return 1;
}
-
+
if (lw == IDC_CHECKLIST_A)
{
- CHECKLIST_A = GetCheckBox(hwndDlg, IDC_CHECKLIST_A);
- CHECKLIST_B = GetCheckBox(hwndDlg, IDC_CHECKLIST_B);
-
+ bChecklistA = GetCheckBox (hwndDlg, IDC_CHECKLIST_A);
+ bChecklistB = GetCheckBox (hwndDlg, IDC_CHECKLIST_B);
+ bChecklistC = GetCheckBox (hwndDlg, IDC_CHECKLIST_C);
}
if (lw == IDC_CHECKLIST_B)
{
- CHECKLIST_B = GetCheckBox(hwndDlg, IDC_CHECKLIST_B);
- CHECKLIST_A = GetCheckBox(hwndDlg, IDC_CHECKLIST_A);
+ bChecklistA = GetCheckBox (hwndDlg, IDC_CHECKLIST_A);
+ bChecklistB = GetCheckBox (hwndDlg, IDC_CHECKLIST_B);
+ bChecklistC = GetCheckBox (hwndDlg, IDC_CHECKLIST_C);
+ }
+
+ if (lw == IDC_CHECKLIST_C)
+ {
+ bChecklistA = GetCheckBox (hwndDlg, IDC_CHECKLIST_A);
+ bChecklistB = GetCheckBox (hwndDlg, IDC_CHECKLIST_B);
+ bChecklistC = GetCheckBox (hwndDlg, IDC_CHECKLIST_C);
+ }
+
+ if (lw == IDC_CHECKBOX_PRETEST)
+ {
+ bCheckboxPretest = GetCheckBox (hwndDlg, IDC_CHECKBOX_PRETEST);
}
if (lw == IDC_PIM_ENABLE)
@@ -6067,7 +6180,7 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
return 1;
}
-
+
if (lw == IDC_QUICKFORMAT)
{
if (IsButtonChecked (GetDlgItem (hCurPage, IDC_QUICKFORMAT)))
@@ -6082,7 +6195,7 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
}
return 1;
}
-
+
if (lw == SPARSE_FILE && IsButtonChecked (GetDlgItem (hCurPage, SPARSE_FILE)))
{
if (AskWarnYesNo("CONFIRM_SPARSE_FILE", MainDlg) == IDNO)
@@ -6117,6 +6230,7 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
SetWindowText (GetDlgItem (hCurPage, IDC_DISK_KEY), showKeys ? L"" : L"******************************** ");
return 1;
}
+
if (lw == IDC_DISPLAY_POOL_CONTENTS
&& (nCurPageNo == SYSENC_COLLECTING_RANDOM_DATA_PAGE || nCurPageNo == NONSYS_INPLACE_ENC_RAND_DATA_PAGE))
{
@@ -6157,30 +6271,50 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
return 1;
}
}
-
- if (nCurPageNo == SYSENC_RESCUE_DISK_BURN_PAGE && lw == IDC_DOWNLOAD_CD_BURN_SOFTWARE)
- {
- if (IsWindowsIsoBurnerAvailable())
- LaunchWindowsIsoBurner (hwndDlg, szRescueDiskISO);
- else
- Applink ("isoburning");
- return 1;
- }
-
/* The password and rescue checkbox have to be clicked in order to enable the next button */
- if ((nCurPageNo == SYSENC_WIPE_MODE_PAGE || nCurPageNo == NONSYS_INPLACE_ENC_WIPE_MODE_PAGE) && (lw == IDC_CHECKLIST_A || lw == IDC_CHECKLIST_B))
+ if ((nCurPageNo == SYSENC_WIPE_MODE_PAGE || nCurPageNo == NONSYS_INPLACE_ENC_WIPE_MODE_PAGE) &&
+ (lw == IDC_CHECKLIST_A || lw == IDC_CHECKLIST_B || lw == IDC_CHECKLIST_C))
{
- if (CHECKLIST_A && CHECKLIST_B)
+ if (SysEncInEffect ())
{
- EnableWindow(GetDlgItem(GetParent(hwndDlg), IDC_NEXT), TRUE);
+ if (bChecklistA && bChecklistB && bChecklistC)
+ EnableWindow (GetDlgItem (GetParent (hwndDlg), IDC_NEXT), TRUE);
+ else
+ EnableWindow (GetDlgItem (GetParent (hwndDlg), IDC_NEXT), FALSE);
}
- else
+ }
+
+ if (lw == IDC_BROWSE && (nCurPageNo == SYSENC_WIPE_MODE_PAGE || nCurPageNo == NONSYS_INPLACE_ENC_WIPE_MODE_PAGE))
+ {
+ wchar_t tmpszRescueDiskISO [TC_MAX_PATH+1];
+
+ StringCbCopyW (tmpszRescueDiskISO, sizeof(tmpszRescueDiskISO), szRescueDiskISO);
+
+ //detects the last '\' in order to remove the name of the zip file and save file name
+ for (int i = wcslen(tmpszRescueDiskISO); i > 1; i--)
{
- EnableWindow(GetDlgItem(GetParent(hwndDlg), IDC_NEXT), FALSE);
+ if (tmpszRescueDiskISO[i] == '\\')
+ {
+ for (int j = i + 1; i < wcslen(tmpszRescueDiskISO); i++)
+ tmpszRescueDiskISO[j] = '\0';
+ break;
+ }
}
+
+ if(!BrowseFile (hwndDlg, "RESCUE_DISK_PATH", tmpszRescueDiskISO))
+ return 1;
+
+ return 1;
}
-
+ if (nCurPageNo == SYSENC_PRETEST_RESULT_PAGE && lw == IDC_CHECKBOX_PRETEST)
+ {
+ if (bCheckboxPretest)
+ EnableWindow (GetDlgItem (GetParent (hwndDlg), IDC_NEXT), TRUE);
+ else
+ EnableWindow (GetDlgItem (GetParent (hwndDlg), IDC_NEXT), FALSE);
+ }
+
if ((nCurPageNo == SYSENC_WIPE_MODE_PAGE
|| nCurPageNo == NONSYS_INPLACE_ENC_WIPE_MODE_PAGE
|| nCurPageNo == DEVICE_WIPE_MODE_PAGE)
@@ -6216,21 +6350,7 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
}
return 0;
- /*case WM_CHAR:
- if(nCurPageNo == PASSWORD_PAGE)
- {
- OnKeyPress(wParam);
- }*/
- /*case WM_INPUT:
- if(nCurPageNo == PASSWORD_PAGE)
- {
- UINT virtualKey;
- UINT scanCode = (lParam >> 16) & 0xFF;
- // UINT scanCode = (lparam >> 16) & 0x7f) | ((lparam & (1 << 24)) != 0 ? 0x80 : 0;
- virtualKey = MapVirtualKeyExW(scanCode, MAPVK_VSC_TO_VK_EX, OrigEnUSKeyboardLayout);
-
- } */
- }// closes the first switch (uMsg)
+ }
return 0;
}
@@ -6297,7 +6417,7 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
}
try
- {//variable is set if it is gpt instead of mbr
+ {
bSystemIsGPT = BootEncObj->GetSystemDriveConfiguration().SystemPartition.IsGPT;
}
catch (...)
@@ -6485,6 +6605,7 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
{
AbortProcess ("VOLUME_TOO_LARGE_FOR_WINXP");
}
+
if (volumePassword.Length > 0)
{
// Check password length (check also done for outer volume which is not the case in TrueCrypt).
@@ -6506,9 +6627,8 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
SHGetFolderPath (NULL, CSIDL_MYDOCUMENTS, NULL, 0, szRescueDiskISO);
- // Zip rescue for both GPT and MBR
StringCbCatW (szRescueDiskISO, sizeof(szRescueDiskISO), L"\\VeraCrypt Rescue Disk.zip");
-
+
if (IsOSAtLeast (WIN_VISTA))
{
// Availability of in-place encryption (which is pre-selected by default whenever
@@ -6597,7 +6717,7 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
case TIMER_ID_SYSENC_PROGRESS:
{
// Manage system encryption/decryption and update related GUI
-
+
try
{
BootEncStatus = BootEncObj->GetStatus();
@@ -6777,82 +6897,39 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
case TIMER_ID_KEYB_LAYOUT_GUARD:
if (SysEncInEffect ())
{
- DWORD keybLayout = (DWORD) GetKeyboardLayout (NULL);
- bKeyboardLayoutChanged = FALSE;
-
- /* Watch the keyboard layout */
-
- if (keybLayout != 0x00000409 && keybLayout != 0x04090409)
+ if (CheckIsIMESupported ())
{
- // Keyboard layout is not standard US
-
- WipePasswordsAndKeyfiles (true);
-
- SetPassword (hCurPage, IDC_PASSWORD, szRawPassword);
- SetPassword (hCurPage, IDC_VERIFY, szVerify);
-
- keybLayout = (DWORD) LoadKeyboardLayout (L"00000409", KLF_ACTIVATE);
+ DWORD keybLayout = (DWORD) GetKeyboardLayout (NULL);
+ // East Asian languages are not translated to US keyboard layout so we need to change keyboard layout
if (keybLayout != 0x00000409 && keybLayout != 0x04090409)
{
- KillTimer (hwndDlg, TIMER_ID_KEYB_LAYOUT_GUARD);
- Error ("CANT_CHANGE_KEYB_LAYOUT_FOR_SYS_ENCRYPTION", MainDlg);
- EndMainDlg (MainDlg);
- return 1;
- }
+ WipePasswordsAndKeyfiles (true);
- bKeyboardLayoutChanged = TRUE;
+ SetPassword (hCurPage, IDC_PASSWORD, szRawPassword);
+ SetPassword (hCurPage, IDC_VERIFY, szVerify);
- wchar_t szTmp [4096];
- StringCbCopyW (szTmp, sizeof(szTmp), GetString ("KEYB_LAYOUT_CHANGE_PREVENTED"));
- StringCbCatW (szTmp, sizeof(szTmp), L"\n\n");
- StringCbCatW (szTmp, sizeof(szTmp), GetString ("KEYB_LAYOUT_SYS_ENC_EXPLANATION"));
- MessageBoxW (MainDlg, szTmp, lpszTitle, MB_ICONWARNING | MB_SETFOREGROUND | MB_TOPMOST);
- }
- /*if (keybLayout != 0x00000409 && keybLayout != 0x04090409)
- {
- // Keyboard layout is not standard US
+ keybLayout = (DWORD) LoadKeyboardLayout (L"00000409", KLF_ACTIVATE);
-
- bKeyboardLayoutChanged = FALSE;
- /*switch (uMsg){
- case WM_INPUT:
- if(nCurPageNo == PASSWORD_PAGE)
- {
- wchar_t c [4096]={0};
-
- UINT virtualKey;
- UINT scanCode = (lParam >> 16) & 0xFF;
- // UINT scanCode = (lparam >> 16) & 0x7f) | ((lparam & (1 << 24)) != 0 ? 0x80 : 0;
- virtualKey = MapVirtualKeyExW(scanCode, MAPVK_VSC_TO_VK_EX, OrigEnUSKeyboardLayout);
- c[i] = MapVirtualKeyExW(scanCode, MAPVK_VK_TO_CHAR, OrigEnUSKeyboardLayout);
- i++;
-
- MessageBoxW (MainDlg, c, lpszTitle, MB_ICONINFORMATION | MB_SETFOREGROUND | MB_TOPMOST);
-
- }
-
- }
- }*/
-
- /* Watch the right Alt key (which is used to enter various characters on non-US keyboards) */
+ if (keybLayout != 0x00000409 && keybLayout != 0x04090409)
+ {
+ KillTimer (hwndDlg, TIMER_ID_KEYB_LAYOUT_GUARD);
+ Error ("CANT_CHANGE_KEYB_LAYOUT_FOR_SYS_ENCRYPTION", MainDlg);
+ EndMainDlg (MainDlg);
+ return 1;
+ }
- if (!bKeybLayoutAltKeyWarningShown)
- {
- if (GetAsyncKeyState (VK_RMENU) < 0)
- {
- bKeybLayoutAltKeyWarningShown = TRUE;
+ bKeyboardLayoutChanged = TRUE;
wchar_t szTmp [4096];
- StringCbCopyW (szTmp, sizeof(szTmp), GetString ("ALT_KEY_CHARS_NOT_FOR_SYS_ENCRYPTION"));
+ StringCbCopyW (szTmp, sizeof(szTmp), GetString ("KEYB_LAYOUT_CHANGE_PREVENTED"));
StringCbCatW (szTmp, sizeof(szTmp), L"\n\n");
StringCbCatW (szTmp, sizeof(szTmp), GetString ("KEYB_LAYOUT_SYS_ENC_EXPLANATION"));
- MessageBoxW (MainDlg, szTmp, lpszTitle, MB_ICONINFORMATION | MB_SETFOREGROUND | MB_TOPMOST);
+ MessageBoxW (MainDlg, szTmp, lpszTitle, MB_ICONWARNING | MB_SETFOREGROUND | MB_TOPMOST);
}
}
}
return 1;
-
case TIMER_ID_SYSENC_DRIVE_ANALYSIS_PROGRESS:
if (bSysEncDriveAnalysisInProgress)
@@ -7103,11 +7180,7 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
return 1;
}
else
- return 1; // Disallow close
- bVolTransformThreadCancel = TRUE;
-
- EndMainDlg (hwndDlg);
- return 1;
+ return 1; // Disallow close
}
else if ((nCurPageNo == SYSENC_ENCRYPTION_PAGE || nCurPageNo == SYSENC_PRETEST_RESULT_PAGE)
&& SystemEncryptionStatus != SYSENC_STATUS_NONE
@@ -7176,7 +7249,7 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
case WM_COMMAND:
if (lw == IDHELP)
- {
+ {
if (nCurPageNo == SYSENC_RESCUE_DISK_CREATION_PAGE ||
nCurPageNo == SYSENC_RESCUE_DISK_BURN_PAGE ||
nCurPageNo == SYSENC_RESCUE_DISK_VERIFIED_PAGE)
@@ -7259,7 +7332,7 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
}
if (!bHiddenOS)
- nNewPageNo = SYSENC_SPAN_PAGE - 1; // Skip irrelevant pages
+ nNewPageNo = PASSWORD_PAGE - 1; // Skip irrelevant pages
}
else if (nCurPageNo == SYSENC_HIDDEN_OS_REQ_CHECK_PAGE)
{
@@ -7803,6 +7876,34 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
else if (nCurPageNo == PASSWORD_PAGE)
{
+ if (SysEncInEffect ())
+ {
+ wchar_t tmpPwd[MAX_PASSWORD + 1];
+ GetWindowText (GetDlgItem (hCurPage, IDC_PASSWORD), tmpPwd, iMaxPasswordLength + 1);
+
+ if (wcscmp (tmpPwd, GetTranslatedPassword ()) != 0)
+ {
+ if (wcslen (GetTranslatedPassword ()) == wcslen (tmpPwd))
+ {
+ bNextButtonClicked = TRUE;
+ BOOL bWritePwd = SetWindowTextW (GetDlgItem (hCurPage, IDC_PASSWORD), GetTranslatedPassword ());
+ BOOL bWriteVerifyPwd = SetWindowTextW (GetDlgItem (hCurPage, IDC_VERIFY), GetTranslatedPassword ());
+ if (!bWritePwd || !bWriteVerifyPwd)
+ {
+ Error ("TRANSLATED_PWD_NOT_WRITTEN", hwndDlg);
+ return 1;
+ }
+ }
+ else
+ {
+ Error ("ERROR_TRANSLATE_PWD", hwndDlg);
+ return 1;
+ }
+
+ burn (tmpPwd, sizeof (tmpPwd));
+ WipeTranslatedPassword ();
+ }
+ }
VerifyPasswordAndUpdate (hwndDlg, GetDlgItem (MainDlg, IDC_NEXT),
GetDlgItem (hCurPage, IDC_PASSWORD),
GetDlgItem (hCurPage, IDC_VERIFY),
@@ -7879,11 +7980,6 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
}
}
- if (SysEncInEffect ())
- {
- nNewPageNo = SYSENC_COLLECTING_RANDOM_DATA_PAGE - 1; // Skip irrelevant pages
- }
-
if (bInPlaceEncNonSys)
{
nNewPageNo = NONSYS_INPLACE_ENC_RAND_DATA_PAGE - 1; // Skip irrelevant pages
@@ -7896,6 +7992,7 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
}
}
+
wchar_t tmp[RANDPOOL_DISPLAY_SIZE + 1];
if (!bInPlaceEncNonSys)
{
@@ -7918,6 +8015,15 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
tmp[ARRAYSIZE(tmp) - 1] = 0;
SetWindowText(hRandPoolSys, tmp);
NormalCursor();
+
+ if (SysEncInEffect ())
+ {
+ if (PimEnable)
+ nNewPageNo = PIM_PAGE - 1;
+ else
+ nNewPageNo = SYSENC_RESCUE_DISK_CREATION_PAGE - 1; // Skip irrelevant pages
+
+ }
}
else if (nCurPageNo == PIM_PAGE)
@@ -7953,18 +8059,12 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
return 1;
}
// Check password length (check also done for outer volume which is not the case in TrueCrypt).
- else if (!CheckPasswordLength (hwndDlg, volumePassword.Length, volumePim, SysEncInEffect(), SysEncInEffect()? hash_algo : 0, TRUE, FALSE))
+ else if (!CheckPasswordLength (hwndDlg, volumePassword.Length, volumePim, SysEncInEffect(), SysEncInEffect()? hash_algo : 0, FALSE, FALSE))
{
return 1;
}
}
- if (SysEncInEffect ())
- {
-
- nNewPageNo = SYSENC_COLLECTING_RANDOM_DATA_PAGE - 1; // Skip irrelevant pages
- }
-
if (bInPlaceEncNonSys)
{
nNewPageNo = NONSYS_INPLACE_ENC_RAND_DATA_PAGE - 1; // Skip irrelevant pages
@@ -7975,13 +8075,18 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
{
nNewPageNo = FORMAT_PAGE - 1; // Skip irrelevant pages
}
+
+ if (SysEncInEffect ())
+ {
+ nNewPageNo = SYSENC_RESCUE_DISK_CREATION_PAGE - 1; // Skip irrelevant pages
+ }
}
else if (nCurPageNo == HIDDEN_VOL_HOST_PASSWORD_PAGE
|| nCurPageNo == NONSYS_INPLACE_ENC_RESUME_PASSWORD_PAGE)
{
WaitCursor ();
-
+
if (!GetPassword (hCurPage, IDC_PASSWORD_DIRECT, (char*) volumePassword.Text, iMaxPasswordLength + 1, FALSE, TRUE))
{
NormalCursor ();
@@ -8349,6 +8454,8 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
GetWindowText (GetDlgItem (hCurPage, IDC_RESCUE_DISK_ISO_PATH), szRescueDiskISO, ARRAYSIZE (szRescueDiskISO));
+ bDontVerifyRescueDisk = GetCheckBox (hCurPage, IDC_SKIP_RESCUE_VERIFICATION);
+
try
{
WaitCursor();
@@ -8379,6 +8486,7 @@ retryCDDriveCheck:
wchar_t msg[8192];
StringCchPrintfW (msg, array_capacity (msg), GetString ("CD_BURNER_NOT_PRESENT_WILL_STORE_ISO_INFO"), szRescueDiskISO);
WarningDirect (msg, hwndDlg);
+
Warning ("RESCUE_DISK_BURN_NO_CHECK_WARN", hwndDlg);
bDontVerifyRescueDisk = TRUE;
nNewPageNo = SYSENC_RESCUE_DISK_VERIFIED_PAGE;
@@ -8447,14 +8555,14 @@ retryCDDriveCheck:
nNewPageNo = SYSENC_RESCUE_DISK_VERIFIED_PAGE; // Skip irrelevant pages
}
}
- // TODO current: skip the warning that wipe mode will take longer
- /*else if (nCurPageNo == SYSENC_WIPE_MODE_PAGE
+
+ else if (nCurPageNo == SYSENC_WIPE_MODE_PAGE
|| nCurPageNo == NONSYS_INPLACE_ENC_WIPE_MODE_PAGE)
{
if (nWipeMode > 0
&& AskWarnYesNo ("WIPE_MODE_WARN", hwndDlg) == IDNO)
return 1;
- }*/
+ }
else if (nCurPageNo == SYSENC_PRETEST_INFO_PAGE)
{
@@ -8597,7 +8705,7 @@ retryCDDriveCheck:
// Cancel
return 1;
}
-
+
NonSysInplaceEncResume ();
return 1;
}
@@ -8854,7 +8962,6 @@ retryCDDriveCheck:
SetWindowTextW (GetDlgItem (MainDlg, IDCANCEL), GetString ("CANCEL"));
bHiddenVolFinished = FALSE;
-
WipePasswordsAndKeyfiles (true);
return 1;
@@ -8985,58 +9092,8 @@ retryCDDriveCheck:
}
return 1;
}
- switch (nCurPageNo)
- {
- case INTRO_PAGE: // TODO is never called, instead AfterWMInitTasks is called
- nNewPageNo = PASSWORD_PAGE;
- LoadPage(hwndDlg, nNewPageNo);
- break;
- case SYSENC_TYPE_PAGE:
- if(bHiddenOS)
- nNewPageNo = SYSENC_SPAN_PAGE;
- else
- nNewPageNo = PASSWORD_PAGE;
- SwitchWizardToSysEncMode();
- LoadPage(hwndDlg, nNewPageNo);
- break;
-
- case SYSENC_SPAN_PAGE:
- nNewPageNo = SYSENC_MULTI_BOOT_MODE_PAGE;
- LoadPage(hwndDlg, nNewPageNo);
- break;
-
- case SYSENC_MULTI_BOOT_MODE_PAGE:
- nNewPageNo = PASSWORD_PAGE;
- LoadPage(hwndDlg, nNewPageNo);
- break;
-
- case PASSWORD_PAGE:
- if (PimEnable)
- {
- nNewPageNo = PIM_PAGE;
- }
- else
- {
- nNewPageNo = SYSENC_RESCUE_DISK_CREATION_PAGE;
- }
-
- LoadPage(hwndDlg, nNewPageNo);
- break;
-
- case PIM_PAGE:
- nNewPageNo = SYSENC_RESCUE_DISK_CREATION_PAGE;
-
- LoadPage(hwndDlg, nNewPageNo);
- break;
-
- case SYSENC_COLLECTING_RANDOM_DATA_PAGE:
- LoadPage(hwndDlg, nNewPageNo + 2);
- break;
-
- default:
- LoadPage(hwndDlg, nNewPageNo + 1);
- }
+ LoadPage (hwndDlg, nNewPageNo + 1);
ovf_end:
return 1;
}
@@ -9045,14 +9102,29 @@ ovf_end:
if (nCurPageNo == SYSENC_SPAN_PAGE)
{
// Skip irrelevant pages when going back
-
- nNewPageNo = SYSENC_TYPE_PAGE + 1;
+ if (!bHiddenOS)
+ nNewPageNo = SYSENC_TYPE_PAGE + 1;
}
+
+ if (nCurPageNo == SYSENC_RESCUE_DISK_CREATION_PAGE)
+ {
+ if (SysEncInEffect ())
+ {
+ nNewPageNo = (PimEnable? PIM_PAGE : PASSWORD_PAGE) + 1;
+ }
+ }
+
if (nCurPageNo == SYSENC_RESCUE_DISK_BURN_PAGE)
{
+ nNewPageNo = SYSENC_RESCUE_DISK_BURN_PAGE + 1; // Stay on the same page
Warning("RESCUE_DISK_BACK_BUTTON", hwndDlg);
}
+ if (nCurPageNo == SYSENC_PRETEST_RESULT_PAGE)
+ {
+ nNewPageNo = SYSENC_PRETEST_RESULT_PAGE + 1; // Stay on the same page
+ }
+
if (nCurPageNo == SYSENC_MULTI_BOOT_MODE_PAGE)
{
// Skip the drive analysis page(s) or other irrelevant pages when going back
@@ -9178,7 +9250,10 @@ ovf_end:
if (SysEncInEffect ())
{
- nNewPageNo = CIPHER_PAGE + 1; // Skip irrelevant pages
+ if (!bHiddenOS)
+ nNewPageNo = SYSENC_TYPE_PAGE + 1; // Skip irrelevant pages
+ else
+ nNewPageNo = CIPHER_PAGE + 1; // Skip irrelevant pages
KillTimer (hwndDlg, TIMER_ID_KEYB_LAYOUT_GUARD);
@@ -9193,7 +9268,6 @@ ovf_end:
}
else if (bInPlaceEncNonSys)
nNewPageNo = CIPHER_PAGE + 1;
-
}
else if (nCurPageNo == PIM_PAGE)
@@ -9273,38 +9347,8 @@ ovf_end:
nNewPageNo = (PimEnable? PIM_PAGE : PASSWORD_PAGE) + 1;
}
}
- switch (nCurPageNo)
- {
- case SYSENC_MULTI_BOOT_MODE_PAGE:
- nNewPageNo = SYSENC_SPAN_PAGE;
- LoadPage(hwndDlg, nNewPageNo);
- break;
- case PASSWORD_PAGE:
- nNewPageNo = SYSENC_TYPE_PAGE;
- LoadPage(hwndDlg, nNewPageNo);
- break;
- case PIM_PAGE:
- nNewPageNo = PASSWORD_PAGE;
- LoadPage(hwndDlg, nNewPageNo);
- break;
- case SYSENC_RESCUE_DISK_CREATION_PAGE:
- if (PimEnable)
- {
- nNewPageNo = PIM_PAGE;
- }
- else
- {
- nNewPageNo = PASSWORD_PAGE;
- }
- LoadPage(hwndDlg, nNewPageNo);
- break;
- case SYSENC_RESCUE_DISK_BURN_PAGE:
- nNewPageNo = SYSENC_RESCUE_DISK_BURN_PAGE; // Stay on the same page
- LoadPage(hwndDlg, nNewPageNo);
- break;
- default:
- LoadPage(hwndDlg, nNewPageNo - 1);
- }
+
+ LoadPage (hwndDlg, nNewPageNo - 1);
return 1;
}
@@ -10077,6 +10121,7 @@ int AnalyzeHiddenVolumeHost (HWND hwndDlg, int *driveNo, __int64 hiddenVolHostSi
else
{
// Unsupported file system
+
Error ("HIDDEN_VOL_HOST_UNSUPPORTED_FILESYS", hwndDlg);
return 0;
}
@@ -10794,7 +10839,7 @@ static void AfterWMInitTasks (HWND hwndDlg)
return;
}
- LoadPage(hwndDlg, SYSENC_TYPE_PAGE);
+ LoadPage (hwndDlg, INTRO_PAGE);
}
}
@@ -10904,8 +10949,9 @@ static DWORD GetFormatSectorSize ()
return geometry.Geometry.BytesPerSector;
}
+
/* This function is called when advanced dialog in intro page is open */
-BOOL CALLBACK AdvanceDlgProcIntro(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+BOOL CALLBACK AdvanceDlgProcIntro (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
WORD lw = LOWORD(wParam);
@@ -10919,10 +10965,8 @@ BOOL CALLBACK AdvanceDlgProcIntro(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
SendMessage (GetDlgItem (hwndDlg, IDC_SYSENC_NORMAL), WM_SETFONT, (WPARAM) hUserBoldFont, (LPARAM) TRUE);
CheckButton (GetDlgItem (hwndDlg, bHiddenOS ? IDC_SYSENC_HIDDEN : IDC_SYSENC_NORMAL));
-
- //SetFocus(GetDlgItem(hwndDlg, IDOK));
- return 0;
+ return 1;
case WM_COMMAND:
{
if (lw == IDCANCEL)
@@ -10973,7 +11017,7 @@ BOOL CALLBACK AdvanceDlgProcIntro(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
}
/* AES, HASH, Pim and Wipe mode can be selected here */
-BOOL CALLBACK AdvanceDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+BOOL CALLBACK AdvanceDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
WORD lw = LOWORD(wParam);
WORD hw = HIWORD(wParam);
@@ -10990,6 +11034,10 @@ BOOL CALLBACK AdvanceDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
{
case WM_INITDIALOG:
{
+ SetWindowTextW ( GetDlgItem (hwndDlg, IDT_IMPORTANT_NOTE), GetString ("ADV_FEATURES_NOTE"));
+ SetWindowTextW ( GetDlgItem (hwndDlg, IDT_PIM_INFO), GetString ("PIM_INFO"));
+ SetWindowTextW ( GetDlgItem (hwndDlg, IDT_WIPE_INFO), GetString ("WIPE_INFO"));
+
/* Encryption algorithms */
SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_BOX), CB_RESETCONTENT, 0, 0);
@@ -11173,7 +11221,7 @@ BOOL CALLBACK AdvanceDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
SelectAlgo(GetDlgItem(hwndDlg, IDC_WIPE_MODE), (int *)&nWipeMode);
SetFocus(GetDlgItem(GetParent(hwndDlg), IDOK));
}
- return 0;
+ return 1;
case WM_COMMAND:
if (lw == IDCANCEL)
{
@@ -11248,6 +11296,7 @@ BOOL CALLBACK AdvanceDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
if (lw == IDC_WIPE_MODE && hw == CBN_SELCHANGE)
{
+ Warning ("WIPE_WARNING", hwndDlg);
return 1;
}
@@ -11279,6 +11328,7 @@ BOOL CALLBACK AdvanceDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
if (lw == IDC_PIM_ENABLE)
{
+ PimEnable = GetCheckBox (hwndDlg, IDC_PIM_ENABLE);
if (!PimEnable)
volumePim = 0;
return 1;
@@ -11286,51 +11336,56 @@ BOOL CALLBACK AdvanceDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
}
return 0;
}
+
void
-AddComboPairW(HWND hComboBox, const wchar_t *lpszItem, int value)
+AddComboPairW (HWND hComboBox, const wchar_t *lpszItem, int value)
{
LPARAM nIndex;
nIndex = SendMessageW(hComboBox, CB_ADDSTRING, 0, (LPARAM)lpszItem);
nIndex = SendMessage(hComboBox, CB_SETITEMDATA, nIndex, (LPARAM)value);
}
+
/* Acording to NIST, only a blacklist check and at least 8 character should be compulsary, no special character check... */
-int printStrongNess(char input[], unsigned int length)
+int PrintStrongness (char input[], unsigned int length)
{
unsigned int n = length;
- int return_val = 0;
- if (n < 8)
+ int iReturnValue = 0;
+ if (n < 10)
{
- return return_val = weak;
+ burn (input, sizeof(input));
+ return iReturnValue = weak;
}
else if (CheckWord(input))
{
- return return_val = weak;
+ burn (input, sizeof(input));
+ return iReturnValue = weak;
}
//Tetermine the strength of the passsord
if ((n >= 13))
{
- return_val = very_strong;
+ iReturnValue = very_strong;
}
//if 3 out of 4 paramters are true
else if (n >= 10)
{
- return_val = strong;
+ iReturnValue = strong;
}
//if 2 out of 4 values are true
else if (n >= 8)
{
- return_val = medium;
+ iReturnValue = medium;
}
else
{
- return_val = weak;
+ iReturnValue = weak;
}
- return return_val;
+ burn (input, sizeof(input));
+ return iReturnValue;
}
/* Check if password is in list
Credits go Martin York from https://codereview.stackexchange.com/questions/52702/how-to-search-for-a-word-in-a-sorted-text-file-efficiently */
-BOOL CheckWord(char* search)
+BOOL CheckWord (char* search)
{
bool isWordInDict(std::string const& word);
@@ -11345,15 +11400,19 @@ BOOL CheckWord(char* search)
wchar_t destFileName[TC_MAX_PATH] = L"password1000000.txt";
wchar_t *destPathName;
- GetModuleFileName (NULL, path, ARRAYSIZE (path));
+ if (GetModuleFileName (NULL, path, ARRAYSIZE (path)) == 0)
+ {
+ Error ("ERROR_GETTING_PATH", MainDlg);
+ }
wcsncpy(tmp, path, wcslen(path));
+
//detects the last '\' in order to remove the name of the exe file. Afterwards add .txt file in the path
for (int i = wcslen(path); i > 1; i--)
{
if (tmp[i] == '\\')
{
- for(unsigned int j = i + 1; j < wcslen(szRescueDiskISO); j++)
+ for(unsigned int j = i + 1; j < wcslen(path); j++)
{
tmp[j] = '\0';
}
@@ -11361,27 +11420,18 @@ BOOL CheckWord(char* search)
}
}
destPathName = wcscat(tmp, destFileName);
-
+
std::ifstream fin(destPathName);
std::copy(std::istream_iterator<std::string>(fin), std::istream_iterator<std::string>(),
std::inserter(*this, end()));
}
};
- static const MyDict dict;
+ static const MyDict dict;
MyDict::const_iterator find = dict.find(search);
-
+
return find != dict.end();
}
}
-void OnKeyPress(WPARAM key)
-{
- switch (key)
- {
- // Space key toggles between running and paused
- case VK_SPACE:
- break;
- }
-}
/* Credits go to Barmak Shemirani from https://stackoverflow.com/questions/31407492/c-tooltip-function-for-checkbox */
void CreateToolTip(HWND hWndParent, HWND hControlItem, PTSTR pszText)
@@ -11406,7 +11456,6 @@ void CreateToolTip(HWND hWndParent, HWND hControlItem, PTSTR pszText)
GetClientRect(hWndParent, &toolInfo.rect);
if (!SendMessage(hwndTip, TTM_ADDTOOL, 0, (LPARAM)&toolInfo))
{
- //OutputDebugString(L"TTM_ADDTOOL failed\nWrong project manifest!");
MessageBox(0, TEXT("TTM_ADDTOOL failed\nWrong project manifest!"), 0, 0);
}
-} \ No newline at end of file
+}
diff --git a/src/Format/Tcformat.h b/src/Format/Tcformat.h
index acbe6210..a8237521 100644
--- a/src/Format/Tcformat.h
+++ b/src/Format/Tcformat.h
@@ -32,7 +32,7 @@ enum timer_ids
static void localcleanup ( void );
static void LoadSettings ( HWND hwndDlg );
-static void SaveSettings ( HWND hwndDlg );
+void SaveSettings ( HWND hwndDlg );
static void EndMainDlg ( HWND hwndDlg );
void ComboSelChangeEA ( HWND hwndDlg );
static void VerifySizeAndUpdate ( HWND hwndDlg , BOOL bUpdate );
@@ -42,7 +42,7 @@ static void LoadPage ( HWND hwndDlg , int nPageNo );
__int64 PrintFreeSpace ( HWND hwndTextBox , wchar_t *lpszDrive , PLARGE_INTEGER lDiskFree );
void DisplaySizingErrorText ( HWND hwndTextBox );
void EnableDisableFileNext ( HWND hComboBox , HWND hMainButton );
-BOOL QueryFreeSpace ( HWND hwndDlg , HWND hwndTextBox , BOOL display );
+BOOL QueryFreeSpace (HWND hwndDlg, HWND hwndTextBox, BOOL display, LONGLONG *pFreeSpaceValue, BOOL* pbIsSparseFilesSupported);
static BOOL FinalPreTransformPrompts (void);
void UpdateLastDialogId (void);
void HandleOldAssignedDriveLetter (void);
@@ -107,18 +107,11 @@ extern volatile int NonSysInplaceEncStatus;
BOOL CALLBACK AdvanceDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
BOOL CALLBACK FinishDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
void AddComboPairW (HWND hComboBox, const wchar_t *lpszItem, int value);
-int printStrongNess(char input [], unsigned int length);
-int sendMail(char mailAdressRcv[]);
-void copy_txt_files_pretest();
-void copy_txt_files_Rescue_Disk_Info();
-void copy_txt_mail_file();
-BOOL CheckWord( char* search);
-BOOL CALLBACK AdvanceDlgProcIntro(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
-void OnKeyPress(WPARAM key);
-void CreateToolTip(HWND hWndParent, HWND hControlItem, PTSTR pszText);
-
+int PrintStrongness (char* input, unsigned int length);
+BOOL CheckWord (char search[]);
+BOOL CALLBACK AdvanceDlgProcIntro (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
+void CreateToolTip (HWND hWndParent, HWND hControlItem, PTSTR pszText);
#ifdef __cplusplus
}
#endif
-