VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Boot/Windows/BootCommon.h2
-rw-r--r--src/Boot/Windows/BootMain.cpp24
-rw-r--r--src/Boot/Windows/Makefile4
-rw-r--r--src/Common/Common.rc35
-rw-r--r--src/Common/Dlgcode.c50
-rw-r--r--src/Common/Dlgcode.h1
-rw-r--r--src/ExpandVolume/ExpandVolume.rc2
-rw-r--r--src/Mount/Mount.c11
-rw-r--r--src/Mount/Mount.rc2
9 files changed, 92 insertions, 39 deletions
diff --git a/src/Boot/Windows/BootCommon.h b/src/Boot/Windows/BootCommon.h
index 48682fd6..f81b94ea 100644
--- a/src/Boot/Windows/BootCommon.h
+++ b/src/Boot/Windows/BootCommon.h
@@ -17,7 +17,7 @@
#include "BootDefs.h"
// The user will be advised to upgrade the rescue disk if upgrading from the following or any previous version
-#define TC_RESCUE_DISK_UPGRADE_NOTICE_MAX_VERSION 0x0113
+#define TC_RESCUE_DISK_UPGRADE_NOTICE_MAX_VERSION 0x0116
#define TC_BOOT_LOADER_AREA_SIZE (TC_BOOT_LOADER_AREA_SECTOR_COUNT * TC_SECTOR_SIZE_BIOS)
diff --git a/src/Boot/Windows/BootMain.cpp b/src/Boot/Windows/BootMain.cpp
index 7101139d..f66fd36b 100644
--- a/src/Boot/Windows/BootMain.cpp
+++ b/src/Boot/Windows/BootMain.cpp
@@ -168,10 +168,19 @@ static byte AskPassword (Password &password, int& pim)
switch (scanCode)
{
case TC_BIOS_KEY_ENTER:
+ password.Length = pos;
+ if (hidePassword)
+ {
+ while (pos < MAX_PASSWORD)
+ {
+ PrintChar ('*');
+ pos++;
+ }
+ }
+
ClearBiosKeystrokeBuffer();
PrintEndl();
-
- password.Length = pos;
+
break;
case TC_BIOS_KEY_BACKSPACE:
@@ -228,9 +237,18 @@ static byte AskPassword (Password &password, int& pim)
switch (scanCode)
{
case TC_BIOS_KEY_ENTER:
+ if (hidePassword)
+ {
+ while (pos < MAX_PIM)
+ {
+ PrintChar ('*');
+ pos++;
+ }
+ }
+
ClearBiosKeystrokeBuffer();
PrintEndl();
-
+
return TC_BIOS_KEY_ENTER;
case TC_BIOS_KEY_BACKSPACE:
diff --git a/src/Boot/Windows/Makefile b/src/Boot/Windows/Makefile
index 3ce069c7..9ae55272 100644
--- a/src/Boot/Windows/Makefile
+++ b/src/Boot/Windows/Makefile
@@ -193,8 +193,8 @@ $(LIBS)
$(LD) $(LFLAGS) @$(PROJ).crf
del $(PROJ).crf $(PROJ).crf2
-# Compress the Rescue Disk botloader for Cascades and SHA2 since it is too big (size > 31232 bytes)
-!if DEFINED(RESCUE_DISK) && !DEFINED (SINGLE_CIPHER) && "$(SINGLE_PRF)" == "SHA2"
+# Compress the Rescue Disk botloader for Cascades and Serpent since it is too big (size > 31232 bytes)
+!if DEFINED(RESCUE_DISK) && (!DEFINED (SINGLE_CIPHER) || ("$(SINGLE_CIPHER)" == "SERPENT"))
upx $(PROJ).$(TARGETEXT)
!endif
gzip.exe -c -n --best $(PROJ).$(TARGETEXT) >$(PROJ).$(TARGETEXT).gz
diff --git a/src/Common/Common.rc b/src/Common/Common.rc
index 233abd7a..be7e171c 100644
--- a/src/Common/Common.rc
+++ b/src/Common/Common.rc
@@ -204,28 +204,28 @@ BEGIN
CONTROL "",IDC_INFO_BOX_TEXT,"RichEdit20A",ES_MULTILINE | ES_READONLY | ES_NUMBER | WS_BORDER | WS_VSCROLL | WS_TABSTOP,5,6,361,188
END
-IDD_KEYFILE_GENERATOR DIALOGEX 0, 0, 308, 325
+IDD_KEYFILE_GENERATOR DIALOGEX 0, 0, 357, 325
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "VeraCrypt - Keyfile Generator"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
- DEFPUSHBUTTON "Close",IDCLOSE,237,10,59,14
- COMBOBOX IDC_PRF_ID,79,49,91,90,CBS_DROPDOWNLIST | WS_TABSTOP
- PUSHBUTTON "Generate and Save Keyfile...",IDC_GENERATE_AND_SAVE_KEYFILE,92,302,141,14
- LTEXT "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 keyfile.",IDT_KEYFILE_GENERATOR_NOTE,11,5,213,33
- CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,1,40,307,1,WS_EX_STATICEDGE
- RTEXT "Mixing PRF:",IDT_PRF,6,51,67,10,SS_CENTERIMAGE
- GROUPBOX "Current Pool Content",IDT_POOL_CONTENTS,6,70,296,170
- CONTROL "",IDC_POOL_CONTENTS,"Static",SS_LEFTNOWORDWRAP | WS_GROUP,16,83,282,148,WS_EX_TRANSPARENT
- CONTROL "Display pool content",IDC_DISPLAY_POOL_CONTENTS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,191,51,111,10
- LTEXT "Number of keyfiles:",IDT_NUMBER_KEYFILES,9,247,75,8
- EDITTEXT IDC_NUMBER_KEYFILES,92,244,51,14,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER
- LTEXT "Keyfiles base name:",IDT_KEYFILES_BASE_NAME,9,287,75,8
- EDITTEXT IDC_KEYFILES_BASE_NAME,92,284,141,14,ES_AUTOHSCROLL
- LTEXT "Keyfiles size (in Bytes):",IDT_KEYFILES_SIZE,9,266,75,8
- EDITTEXT IDC_KEYFILES_SIZE,92,264,51,14,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER
+ DEFPUSHBUTTON "Close",IDCLOSE,291,10,59,14
+ COMBOBOX IDC_PRF_ID,97,49,91,90,CBS_DROPDOWNLIST | WS_TABSTOP
+ CONTROL "Display pool content",IDC_DISPLAY_POOL_CONTENTS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,209,51,141,10
+ EDITTEXT IDC_NUMBER_KEYFILES,124,244,51,14,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER
+ EDITTEXT IDC_KEYFILES_SIZE,124,264,51,14,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER
CONTROL "Random size ( 64 <-> 1048576 )",IDC_KEYFILES_RANDOM_SIZE,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,149,266,140,10
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,181,266,174,10
+ EDITTEXT IDC_KEYFILES_BASE_NAME,124,284,141,14,ES_AUTOHSCROLL
+ PUSHBUTTON "Generate and Save Keyfile...",IDC_GENERATE_AND_SAVE_KEYFILE,124,302,141,14
+ LTEXT "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 keyfile.",IDT_KEYFILE_GENERATOR_NOTE,11,5,271,33
+ CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,1,40,356,1,WS_EX_STATICEDGE
+ RTEXT "Mixing PRF:",IDT_PRF,7,51,85,10,SS_CENTERIMAGE
+ GROUPBOX "Current Pool Content",IDT_POOL_CONTENTS,6,70,344,170
+ CONTROL "",IDC_POOL_CONTENTS,"Static",SS_LEFTNOWORDWRAP | WS_GROUP,16,83,323,148,WS_EX_TRANSPARENT
+ RTEXT "Number of keyfiles:",IDT_NUMBER_KEYFILES,9,247,110,8
+ RTEXT "Keyfiles base name:",IDT_KEYFILES_BASE_NAME,9,287,110,8
+ RTEXT "Keyfiles size (in Bytes):",IDT_KEYFILES_SIZE,9,266,110,8
END
IDD_MULTI_CHOICE_DLG DIALOGEX 0, 0, 167, 322
@@ -402,7 +402,6 @@ BEGIN
IDD_KEYFILE_GENERATOR, DIALOG
BEGIN
LEFTMARGIN, 7
- RIGHTMARGIN, 299
TOPMARGIN, 7
BOTTOMMARGIN, 321
END
diff --git a/src/Common/Dlgcode.c b/src/Common/Dlgcode.c
index a295d5b5..65801bea 100644
--- a/src/Common/Dlgcode.c
+++ b/src/Common/Dlgcode.c
@@ -6592,6 +6592,43 @@ BOOL CALLBACK WaitDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
}
}
+
+void BringToForeground(HWND hWnd)
+{
+ if(!::IsWindow(hWnd)) return;
+
+ DWORD lockTimeOut = 0;
+ HWND hCurrWnd = ::GetForegroundWindow();
+ DWORD dwThisTID = ::GetCurrentThreadId(),
+ dwCurrTID = ::GetWindowThreadProcessId(hCurrWnd,0);
+
+ if(dwThisTID != dwCurrTID)
+ {
+ ::AttachThreadInput(dwThisTID, dwCurrTID, TRUE);
+
+ ::SystemParametersInfo(SPI_GETFOREGROUNDLOCKTIMEOUT,0,&lockTimeOut,0);
+ ::SystemParametersInfo(SPI_SETFOREGROUNDLOCKTIMEOUT,0,0,SPIF_SENDWININICHANGE | SPIF_UPDATEINIFILE);
+
+ ::AllowSetForegroundWindow(ASFW_ANY);
+ }
+
+ ::SetForegroundWindow(hWnd);
+
+ if(dwThisTID != dwCurrTID)
+ {
+ ::SystemParametersInfo(SPI_SETFOREGROUNDLOCKTIMEOUT,0,(PVOID)lockTimeOut,SPIF_SENDWININICHANGE | SPIF_UPDATEINIFILE);
+ ::AttachThreadInput(dwThisTID, dwCurrTID, FALSE);
+ }
+
+#ifdef TCMOUNT
+ if (hWnd == MainDlg)
+ {
+ SetFocus (hWnd);
+ ::SendMessage(hWnd, WM_NEXTDLGCTL, (WPARAM) GetDlgItem (hWnd, IDC_DRIVELIST), 1L);
+ }
+#endif
+}
+
void ShowWaitDialog(HWND hwnd, BOOL bUseHwndAsParent, WaitThreadProc callback, void* pArg)
{
HWND hParent = (hwnd && bUseHwndAsParent)? hwnd : GetDesktopWindow();
@@ -6605,24 +6642,23 @@ void ShowWaitDialog(HWND hwnd, BOOL bUseHwndAsParent, WaitThreadProc callback, v
}
else
{
+ BOOL bIsForeground = FALSE;
WaitDialogDisplaying = TRUE;
if (hwnd)
+ {
+ if (GetForegroundWindow () == hwnd)
+ bIsForeground = TRUE;
EnableWindow (hwnd, FALSE);
+ }
else
EnableWindow (MainDlg, FALSE);
- finally_do_arg (HWND, hwnd, { if (finally_arg) EnableWindow(finally_arg, TRUE); else EnableWindow (MainDlg, TRUE);});
+ finally_do_arg2 (HWND, hwnd, BOOL, bIsForeground, { if (finally_arg) {EnableWindow(finally_arg, TRUE); if (finally_arg2) BringToForeground (finally_arg);} else EnableWindow (MainDlg, TRUE);});
DialogBoxParamW (hInst,
MAKEINTRESOURCEW (IDD_STATIC_MODAL_WAIT_DLG), hParent,
(DLGPROC) WaitDlgProc, (LPARAM) &threadParam);
WaitDialogDisplaying = FALSE;
-
- if (hwnd && IsWindowVisible(hwnd) && !bUseHwndAsParent)
- {
- SetForegroundWindow(hwnd);
- BringWindowToTop(hwnd);
- }
}
}
diff --git a/src/Common/Dlgcode.h b/src/Common/Dlgcode.h
index 5d8d7e29..a7f4affd 100644
--- a/src/Common/Dlgcode.h
+++ b/src/Common/Dlgcode.h
@@ -568,6 +568,7 @@ inline std::wstring AppendSrcPos (const wchar_t* msg, const char* srcPos)
// Display a wait dialog while calling the provided callback with the given parameter
typedef void (CALLBACK* WaitThreadProc)(void* pArg, HWND hWaitDlg);
+void BringToForeground(HWND hWnd);
void ShowWaitDialog(HWND hwnd, BOOL bUseHwndAsParent, WaitThreadProc callback, void* pArg);
#endif // __cplusplus
diff --git a/src/ExpandVolume/ExpandVolume.rc b/src/ExpandVolume/ExpandVolume.rc
index 62ce5b8f..f9832e0a 100644
--- a/src/ExpandVolume/ExpandVolume.rc
+++ b/src/ExpandVolume/ExpandVolume.rc
@@ -36,6 +36,7 @@ BEGIN
CONTROL "&KB",IDC_KB,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,169,105,38,10
CONTROL "&MB",IDC_MB,"Button",BS_AUTORADIOBUTTON,209,105,38,10
CONTROL "&GB",IDC_GB,"Button",BS_AUTORADIOBUTTON,248,105,38,10
+ CONTROL "&TB",IDC_TB,"Button",BS_AUTORADIOBUTTON,288,105,38,10
CONTROL "Fill new space with random data",IDC_INIT_NEWSPACE,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,30,127,118,10
DEFPUSHBUTTON "Continue",IDOK,15,238,84,18
@@ -51,7 +52,6 @@ BEGIN
CONTROL "",IDC_EXPAND_VOLUME_NAME,"Static",SS_SIMPLE | WS_GROUP,80,18,275,8,WS_EX_TRANSPARENT
RTEXT "File system: ",IDT_FILE_SYS,31,30,42,8
CONTROL "",IDC_EXPAND_FILE_SYSTEM,"Static",SS_SIMPLE | WS_GROUP,80,30,275,8,WS_EX_TRANSPARENT
- CONTROL "&TB",IDC_TB,"Button",BS_AUTORADIOBUTTON,288,105,38,10
END
IDD_MOUNT_DLG DIALOGEX 0, 0, 376, 271
diff --git a/src/Mount/Mount.c b/src/Mount/Mount.c
index 30be6f0d..cd82c08e 100644
--- a/src/Mount/Mount.c
+++ b/src/Mount/Mount.c
@@ -2754,7 +2754,7 @@ BOOL CALLBACK PasswordDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPa
SetCheckBox (hwndDlg, IDC_KEYFILES_ENABLE, FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDC_KEYFILES_ENABLE), FALSE);
- EnableWindow (GetDlgItem (hwndDlg, IDC_KEYFILES), FALSE);
+ EnableWindow (GetDlgItem (hwndDlg, IDC_KEY_FILES), FALSE);
SetPim (hwndDlg, IDC_PIM, *pim);
@@ -4598,9 +4598,10 @@ static BOOL Dismount (HWND hwndDlg, int nDosDriveNo)
void __cdecl mountThreadFunction (void *hwndDlgArg)
{
HWND hwndDlg =(HWND) hwndDlgArg;
+ BOOL bIsForeground = (GetForegroundWindow () == hwndDlg)? TRUE : FALSE;
// Disable parent dialog during processing to avoid user interaction
EnableWindow(hwndDlg, FALSE);
- finally_do_arg (HWND, hwndDlg, { EnableWindow(finally_arg, TRUE); });
+ finally_do_arg2 (HWND, hwndDlg, BOOL, bIsForeground, { EnableWindow(finally_arg, TRUE); if (finally_arg2) BringToForeground (finally_arg); bPrebootPasswordDlgMode = FALSE;});
Mount (hwndDlg, 0, 0, -1);
}
@@ -7243,9 +7244,7 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
bPrebootPasswordDlgMode = TRUE;
if (CheckMountList (hwndDlg, FALSE))
- _beginthread(mountThreadFunction, 0, hwndDlg);
-
- bPrebootPasswordDlgMode = FALSE;
+ _beginthread(mountThreadFunction, 0, hwndDlg);
}
break;
}
@@ -9104,7 +9103,7 @@ void CALLBACK mountFavoriteVolumeCallbackFunction (void *pArg, HWND hwnd)
void __cdecl mountFavoriteVolumeThreadFunction (void *pArg)
{
- ShowWaitDialog (NULL, FALSE, mountFavoriteVolumeCallbackFunction, pArg);
+ ShowWaitDialog (MainDlg, FALSE, mountFavoriteVolumeCallbackFunction, pArg);
}
static void SaveDefaultKeyFilesParam (HWND hwnd)
diff --git a/src/Mount/Mount.rc b/src/Mount/Mount.rc
index 674fe41e..17c1b916 100644
--- a/src/Mount/Mount.rc
+++ b/src/Mount/Mount.rc
@@ -355,7 +355,7 @@ BEGIN
LTEXT "Volume PIM:",IDT_PIM,18,133,65,8
CONTROL "Display PIM",IDC_SHOW_PIM,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,159,150,10
CONTROL "Use favorite label as Explorer drive label",IDC_FAVORITE_USE_LABEL_IN_EXPLORER,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,202,203,10
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,202,349,10
END
IDD_DEFAULT_MOUNT_PARAMETERS DIALOGEX 0, 0, 167, 65