VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Format
diff options
context:
space:
mode:
Diffstat (limited to 'src/Format')
-rw-r--r--src/Format/Format.rc176
-rw-r--r--src/Format/InPlace.c14
-rw-r--r--src/Format/InPlace.h2
-rw-r--r--src/Format/Resource.h10
-rw-r--r--src/Format/Tcformat.c57
-rw-r--r--src/Format/Tcformat.h2
6 files changed, 153 insertions, 108 deletions
diff --git a/src/Format/Format.rc b/src/Format/Format.rc
index 51564a64..c4e50fdd 100644
--- a/src/Format/Format.rc
+++ b/src/Format/Format.rc
@@ -78,25 +78,25 @@ IDR_FORMAT_TLB TYPELIB "Format.tlb"
//
// Dialog
//
-IDD_VOL_CREATION_WIZARD_DLG DIALOGEX 0, 0, 400, 209
+IDD_VOL_CREATION_WIZARD_DLG DIALOGEX 0, 0, 400, 229
STYLE DS_SETFONT | DS_SETFOREGROUND | DS_FIXEDSYS | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "VeraCrypt Volume Creation Wizard"
CLASS "VeraCryptCustomDlg"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
- PUSHBUTTON "&Help",IDHELP,176,189,50,14
- PUSHBUTTON "",IDC_PREV,235,189,50,14
- DEFPUSHBUTTON "",IDC_NEXT,285,189,50,14
- PUSHBUTTON "Cancel",IDCANCEL,343,189,50,14
+ PUSHBUTTON "&Help",IDHELP,176,209,50,14
+ PUSHBUTTON "",IDC_PREV,235,209,50,14
+ DEFPUSHBUTTON "",IDC_NEXT,285,209,50,14
+ PUSHBUTTON "Cancel",IDCANCEL,343,209,50,14
LTEXT "",IDC_BOX_TITLE,160,8,233,17
- GROUPBOX "",IDC_STATIC,4,0,392,183
+ GROUPBOX "",IDC_STATIC,4,0,392,203
CONTROL 116,IDC_BITMAP_WIZARD,"Static",SS_BITMAP | SS_SUNKEN,10,9,137,169
- LTEXT "",IDC_POS_BOX,160,24,231,152
+ LTEXT "",IDC_POS_BOX,160,24,231,172
END
-IDD_CIPHER_PAGE_DLG DIALOGEX 0, 0, 226, 152
+IDD_CIPHER_PAGE_DLG DIALOGEX 0, 0, 226, 172
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
COMBOBOX IDC_COMBO_BOX,7,23,137,126,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
@@ -109,23 +109,26 @@ BEGIN
LTEXT "More information",IDC_LINK_MORE_INFO_ABOUT_CIPHER,7,82,135,10,SS_NOTIFY
LTEXT "Information on hash algorithms",IDC_LINK_HASH_INFO,97,124,115,8,SS_NOTIFY
END
-IDD_PASSWORD_PAGE_DLG DIALOGEX 0, 0, 226, 152
+IDD_PASSWORD_PAGE_DLG DIALOGEX 0, 0, 226, 172
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
EDITTEXT IDC_PASSWORD,53,3,163,14,ES_PASSWORD | ES_AUTOHSCROLL
EDITTEXT IDC_VERIFY,53,19,163,14,ES_PASSWORD | ES_AUTOHSCROLL
- CONTROL "&Display password",IDC_SHOW_PASSWORD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,53,45,95,11,WS_EX_TRANSPARENT
- CONTROL "U&se keyfiles",IDC_KEYFILES_ENABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,53,35,95,10
- PUSHBUTTON "&Keyfiles...",IDC_KEY_FILES,152,36,64,14,WS_DISABLED
+ EDITTEXT IDC_PIN,53,35,42,14,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER
+ CONTROL "&Display password",IDC_SHOW_PASSWORD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,53,65,95,11,WS_EX_TRANSPARENT
+ CONTROL "U&se keyfiles",IDC_KEYFILES_ENABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,53,55,95,10
+ PUSHBUTTON "&Keyfiles...",IDC_KEY_FILES,152,56,64,14,WS_DISABLED
RTEXT "Password:",IDT_PASSWORD,1,6,50,8
RTEXT "&Confirm:",IDT_CONFIRM,1,23,50,8
- LTEXT "",IDC_BOX_HELP,0,59,225,89
+ LTEXT "",IDC_BOX_HELP,0,79,225,89
+ RTEXT "Volume Pin:",IDT_PIN,1,38,50,8
+ LTEXT "(Empty or 0 for default iterations)",IDC_PIN_HELP,97,38,126,8
END
-IDD_SIZE_PAGE_DLG DIALOGEX 0, 0, 226, 152
+IDD_SIZE_PAGE_DLG DIALOGEX 0, 0, 226, 172
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
EDITTEXT IDC_SIZEBOX,0,22,71,14,ES_AUTOHSCROLL | ES_NUMBER
@@ -135,19 +138,19 @@ BEGIN
LTEXT "",IDC_BOX_HELP,0,75,214,64
LTEXT "",IDC_SPACE_LEFT,0,44,214,21
END
-IDD_VOLUME_LOCATION_PAGE_DLG DIALOGEX 0, 0, 226, 152
+IDD_VOLUME_LOCATION_PAGE_DLG DIALOGEX 0, 0, 226, 172
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
COMBOBOX IDC_COMBO_BOX,0,9,148,80,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP
CONTROL "&Never save history",IDC_NO_HISTORY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,3,28,137,10
PUSHBUTTON "",IDC_SELECT_VOLUME_LOCATION,155,9,62,14
- LTEXT "",IDC_BOX_HELP,0,45,219,104
+ LTEXT "",IDC_BOX_HELP,0,45,219,108
END
-IDD_FORMAT_PAGE_DLG DIALOGEX 0, 0, 226, 152
+IDD_FORMAT_PAGE_DLG DIALOGEX 0, 0, 226, 172
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
COMBOBOX IDC_FILESYS,43,13,36,90,CBS_DROPDOWNLIST | WS_TABSTOP
@@ -175,9 +178,9 @@ BEGIN
GROUPBOX "",IDC_STATIC,0,32,225,35
CONTROL "",IDC_RANDOM_BYTES,"Static",SS_SIMPLE | WS_GROUP,57,38,155,8,WS_EX_TRANSPARENT
END
-IDD_INTRO_PAGE_DLG DIALOGEX 0, 0, 226, 152
+IDD_INTRO_PAGE_DLG DIALOGEX 0, 0, 226, 172
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
CONTROL "Create an encrypted file container",IDC_FILE_CONTAINER,
@@ -192,24 +195,24 @@ BEGIN
LTEXT "Encrypts a non-system partition on any internal or external drive (e.g. a flash drive). Optionally, creates a hidden volume.",IDT_NON_SYS_DEVICE,16,66,205,16
LTEXT "Encrypts the partition/drive where Windows is installed. Anyone who wants to gain access and use the system, read and write files, etc., will need to enter the correct password each time before Windows boots. Optionally, creates a hidden system.",IDT_SYS_DEVICE,16,100,205,33
END
-IDD_INFO_PAGE_DLG DIALOGEX 0, 0, 226, 152
+IDD_INFO_PAGE_DLG DIALOGEX 0, 0, 226, 172
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
LTEXT "",IDC_BOX_HELP,0,10,225,137
END
-IDD_HIDVOL_HOST_FILL_PAGE_DLG DIALOGEX 0, 0, 226, 152
+IDD_HIDVOL_HOST_FILL_PAGE_DLG DIALOGEX 0, 0, 226, 172
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
- LTEXT "",IDC_BOX_HELP,0,6,226,130
- PUSHBUTTON "Open Outer Volume",IDC_OPEN_OUTER_VOLUME,0,136,85,14
+ LTEXT "",IDC_BOX_HELP,0,6,226,138
+ PUSHBUTTON "Open Outer Volume",IDC_OPEN_OUTER_VOLUME,0,146,85,14
END
-IDD_HIDDEN_VOL_WIZARD_MODE_PAGE_DLG DIALOGEX 0, 0, 226, 152
+IDD_HIDDEN_VOL_WIZARD_MODE_PAGE_DLG DIALOGEX 0, 0, 226, 172
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
CONTROL "Normal mode",IDC_HIDVOL_WIZ_MODE_FULL,"Button",BS_AUTORADIOBUTTON,0,7,217,10
@@ -217,54 +220,57 @@ BEGIN
LTEXT "",IDC_BOX_HELP,16,20,205,48
LTEXT "",IDC_BOX_HELP2,16,89,205,50
END
-IDD_PASSWORD_ENTRY_PAGE_DLG DIALOGEX 0, 0, 226, 152
+IDD_PASSWORD_ENTRY_PAGE_DLG DIALOGEX 0, 0, 226, 172
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
EDITTEXT IDC_PASSWORD_DIRECT,50,2,149,14,ES_PASSWORD | ES_AUTOHSCROLL
COMBOBOX IDC_PKCS5_PRF_ID,50,17,91,90,CBS_DROPDOWNLIST | WS_TABSTOP
- CONTROL "&Display password",IDC_SHOW_PASSWORD_SINGLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,50,31,84,11,WS_EX_TRANSPARENT
- CONTROL "U&se keyfiles",IDC_KEYFILES_ENABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,50,42,82,11
- PUSHBUTTON "&Keyfiles...",IDC_KEY_FILES,142,39,64,14
- LTEXT "",IDC_BOX_HELP,0,57,225,94
+ EDITTEXT IDC_PIN,50,32,42,14,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER
+ CONTROL "&Display password",IDC_SHOW_PASSWORD_SINGLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,50,46,84,11,WS_EX_TRANSPARENT
+ CONTROL "U&se keyfiles",IDC_KEYFILES_ENABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,50,57,82,11
+ PUSHBUTTON "&Keyfiles...",IDC_KEY_FILES,142,54,64,14
+ LTEXT "",IDC_BOX_HELP,0,74,225,94
RTEXT "Password:",IDT_PASSWORD,0,6,48,8
- RTEXT "PKCS-5 PRF:",IDT_PKCS5_PRF,0,17,48,8
+ RTEXT "PKCS-5 PRF:",IDT_PKCS5_PRF,0,19,48,8
+ RTEXT "Volume PIN:",IDT_PIN,0,34,48,8
+ LTEXT "(Empty or 0 for default iterations)",IDC_PIN_HELP,96,34,127,8
END
-IDD_VOLUME_TYPE_PAGE_DLG DIALOGEX 0, 0, 226, 152
+IDD_VOLUME_TYPE_PAGE_DLG DIALOGEX 0, 0, 226, 172
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
CONTROL "Standard VeraCrypt volume",IDC_STD_VOL,"Button",BS_AUTORADIOBUTTON,0,7,212,10
CONTROL "Hi&dden VeraCrypt volume ",IDC_HIDDEN_VOL,"Button",BS_AUTORADIOBUTTON,0,53,212,10
- LTEXT "More information about hidden volumes",IDC_HIDDEN_VOL_HELP,16,125,205,10,SS_NOTIFY
+ LTEXT "More information about hidden volumes",IDC_HIDDEN_VOL_HELP,16,126,205,10,SS_NOTIFY
LTEXT "",IDC_BOX_HELP_NORMAL_VOL,16,20,205,25
LTEXT "",IDC_BOX_HELP,16,66,205,57
END
-IDD_SYSENC_SPAN_PAGE_DLG DIALOGEX 0, 0, 226, 152
+IDD_SYSENC_SPAN_PAGE_DLG DIALOGEX 0, 0, 226, 172
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
CONTROL "Encrypt the Windows system partition",IDC_SYS_PARTITION,
"Button",BS_AUTORADIOBUTTON,0,7,212,10
CONTROL "Encrypt the whole drive",IDC_WHOLE_SYS_DRIVE,"Button",BS_AUTORADIOBUTTON,0,53,212,10
LTEXT "Select this option to encrypt the partition where the currently running Windows operating system is installed.",IDT_SYS_PARTITION,16,20,205,32
- LTEXT "",IDT_WHOLE_SYS_DRIVE,16,66,205,79
+ LTEXT "",IDT_WHOLE_SYS_DRIVE,16,70,205,95
END
-IDD_SYSENC_RESCUE_DISK_CREATION_DLG DIALOGEX 0, 0, 226, 152
+IDD_SYSENC_RESCUE_DISK_CREATION_DLG DIALOGEX 0, 0, 226, 172
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,135,163,13,ES_AUTOHSCROLL
- PUSHBUTTON "Bro&wse...",IDC_BROWSE,166,134,59,14
- LTEXT "",IDT_RESCUE_DISK_INFO,0,1,225,129
+ EDITTEXT IDC_RESCUE_DISK_ISO_PATH,0,152,163,13,ES_AUTOHSCROLL
+ PUSHBUTTON "Bro&wse...",IDC_BROWSE,166,151,59,14
+ LTEXT "",IDT_RESCUE_DISK_INFO,0,1,225,145
END
-IDD_SYSENC_COLLECTING_RANDOM_DATA_DLG DIALOGEX 0, 0, 226, 152
+IDD_SYSENC_COLLECTING_RANDOM_DATA_DLG DIALOGEX 0, 0, 226, 172
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
CONTROL "Display pool content",IDC_DISPLAY_POOL_CONTENTS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,1,98,122,10
@@ -272,9 +278,9 @@ BEGIN
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 encryption keys. Then click Next to continue.",IDT_COLLECTING_RANDOM_DATA_NOTE,1,112,224,40
GROUPBOX "Current pool content (partial)",IDT_PARTIAL_POOL_CONTENTS,0,5,222,88
END
-IDD_SYSENC_MULTI_BOOT_MODE_PAGE_DLG DIALOGEX 0, 0, 226, 152
+IDD_SYSENC_MULTI_BOOT_MODE_PAGE_DLG DIALOGEX 0, 0, 226, 172
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
CONTROL "Single-boot",IDC_SINGLE_BOOT,"Button",BS_AUTORADIOBUTTON,0,7,212,10
@@ -282,26 +288,26 @@ BEGIN
LTEXT "Select this option if there is only one operating system installed on this computer (even if it has multiple users).",IDT_SINGLE_BOOT,16,20,205,32
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,66,205,72
END
-IDD_SYSENC_RESCUE_DISK_BURN_PAGE_DLG DIALOGEX 0, 0, 226, 152
+IDD_SYSENC_RESCUE_DISK_BURN_PAGE_DLG DIALOGEX 0, 0, 226, 172
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
LTEXT "Download CD/DVD recording software",IDC_DOWNLOAD_CD_BURN_SOFTWARE,0,136,217,10,SS_NOTIFY
LTEXT "",IDT_RESCUE_DISK_BURN_INFO,0,4,225,128
END
-IDD_SYSENC_WIPE_MODE_PAGE_DLG DIALOGEX 0, 0, 226, 152
+IDD_SYSENC_WIPE_MODE_PAGE_DLG DIALOGEX 0, 0, 226, 172
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
COMBOBOX IDC_WIPE_MODE,61,0,127,90,CBS_DROPDOWNLIST | WS_TABSTOP
RTEXT "Wipe mode:",IDT_WIPE_MODE,0,2,59,8,0,WS_EX_RIGHT
LTEXT "",IDT_WIPE_MODE_INFO,0,19,225,128
END
-IDD_INPLACE_ENCRYPTION_PAGE_DLG DIALOGEX 0, 0, 226, 152
+IDD_INPLACE_ENCRYPTION_PAGE_DLG DIALOGEX 0, 0, 226, 172
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
COMBOBOX IDC_WIPE_MODE,67,13,125,90,CBS_DROPDOWNLIST | WS_TABSTOP
@@ -319,9 +325,9 @@ BEGIN
GROUPBOX "Options",IDT_FORMAT_OPTIONS,0,3,225,29
GROUPBOX "",IDC_STATIC,0,32,225,41
END
-IDD_SYSENC_KEYS_GEN_PAGE_DLG DIALOGEX 0, 0, 226, 152
+IDD_SYSENC_KEYS_GEN_PAGE_DLG DIALOGEX 0, 0, 226, 172
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
CONTROL "Display generated keys (their portions)",IDC_DISPLAY_KEYS,
@@ -333,46 +339,46 @@ BEGIN
RTEXT "Master Key: ",IDT_MASTER_KEY,2,80,54,8
GROUPBOX "",-1,0,65,225,26
END
-IDD_UNIVERSAL_DUAL_CHOICE_PAGE_DLG DIALOGEX 0, 0, 226, 152
+IDD_UNIVERSAL_DUAL_CHOICE_PAGE_DLG DIALOGEX 0, 0, 226, 172
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
CONTROL "",IDC_CHOICE1,"Button",BS_AUTORADIOBUTTON,0,7,212,10
CONTROL "",IDC_CHOICE2,"Button",BS_AUTORADIOBUTTON,0,17,217,10
LTEXT "",IDC_BOX_HELP,1,34,220,112
END
-IDD_SYSENC_DRIVE_ANALYSIS_PAGE_DLG DIALOGEX 0, 0, 226, 152
+IDD_SYSENC_DRIVE_ANALYSIS_PAGE_DLG DIALOGEX 0, 0, 226, 172
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
LTEXT "",IDT_SYSENC_DRIVE_ANALYSIS_INFO,2,10,215,88
CONTROL "",IDC_PROGRESS_BAR,"msctls_progress32",PBS_SMOOTH | WS_BORDER,1,115,216,12
LTEXT "Progress:",IDT_PROGRESS,2,104,57,8
END
-IDD_SYSENC_TYPE_PAGE_DLG DIALOGEX 0, 0, 226, 152
+IDD_SYSENC_TYPE_PAGE_DLG DIALOGEX 0, 0, 226, 172
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
CONTROL "Normal",IDC_SYSENC_NORMAL,"Button",BS_AUTORADIOBUTTON,0,7,212,10
CONTROL "Hi&dden",IDC_SYSENC_HIDDEN,"Button",BS_AUTORADIOBUTTON,0,53,212,10
- LTEXT "More information",IDC_HIDDEN_SYSENC_INFO_LINK,16,138,205,10,SS_NOTIFY
+ LTEXT "More information",IDC_HIDDEN_SYSENC_INFO_LINK,16,148,205,10,SS_NOTIFY
LTEXT "",IDC_BOX_HELP_SYSENC_NORMAL,16,20,205,25
- LTEXT "",IDC_BOX_HELP,16,66,205,72
+ LTEXT "",IDC_BOX_HELP,16,67,205,72
END
-IDD_SYSENC_HIDDEN_OS_REQ_CHECK_PAGE_DLG DIALOGEX 0, 0, 226, 152
+IDD_SYSENC_HIDDEN_OS_REQ_CHECK_PAGE_DLG DIALOGEX 0, 0, 226, 172
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
LTEXT "More information",IDC_HIDDEN_SYSENC_INFO_LINK,0,141,217,10,SS_NOTIFY
LTEXT "",IDC_BOX_HELP,0,2,225,136
END
-IDD_DEVICE_WIPE_PAGE_DLG DIALOGEX 0, 0, 226, 152
+IDD_DEVICE_WIPE_PAGE_DLG DIALOGEX 0, 0, 226, 172
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
PUSHBUTTON "Abort",IDC_ABORT_BUTTON,169,48,50,14
@@ -389,38 +395,38 @@ BEGIN
GROUPBOX "",IDC_STATIC,0,40,225,42
LTEXT "",IDC_WIPE_MODE,67,21,125,11,SS_CENTERIMAGE,WS_EX_TRANSPARENT | WS_EX_STATICEDGE
END
-IDD_DEVICE_WIPE_MODE_PAGE_DLG DIALOGEX 0, 0, 226, 152
+IDD_DEVICE_WIPE_MODE_PAGE_DLG DIALOGEX 0, 0, 226, 172
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
COMBOBOX IDC_WIPE_MODE,61,9,127,90,CBS_DROPDOWNLIST | WS_TABSTOP
RTEXT "Wipe mode:",IDT_WIPE_MODE,0,11,59,8,0,WS_EX_RIGHT
LTEXT "",IDT_WIPE_MODE_INFO,0,29,225,122
END
-IDD_DEVICE_TRANSFORM_MODE_DLG DIALOGEX 0, 0, 226, 152
+IDD_DEVICE_TRANSFORM_MODE_DLG DIALOGEX 0, 0, 226, 172
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
CONTROL "Create encrypted volume and format it",IDC_DEVICE_TRANSFORM_MODE_FORMAT,
"Button",BS_AUTORADIOBUTTON,0,8,217,10
CONTROL "Encrypt partition in place",IDC_DEVICE_TRANSFORM_MODE_INPLACE,
"Button",BS_AUTORADIOBUTTON,0,98,217,10
LTEXT "",IDC_BOX_HELP,16,21,205,74
- LTEXT "",IDC_BOX_HELP2,16,111,205,34
+ LTEXT "",IDC_BOX_HELP2,16,112,205,53
END
-IDD_EXPANDED_LIST_SELECT_PAGE_DLG DIALOGEX 0, 0, 226, 152
+IDD_EXPANDED_LIST_SELECT_PAGE_DLG DIALOGEX 0, 0, 226, 172
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
LTEXT "",IDC_BOX_HELP,0,107,225,41
LISTBOX IDC_LIST_BOX,0,3,222,100,LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_VSCROLL
END
-IDD_DRIVE_LETTER_SELECTION_PAGE DIALOGEX 0, 0, 226, 152
+IDD_DRIVE_LETTER_SELECTION_PAGE DIALOGEX 0, 0, 226, 172
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
LTEXT "",IDC_BOX_HELP,0,40,225,95
@@ -467,40 +473,40 @@ BEGIN
IDD_VOL_CREATION_WIZARD_DLG, DIALOG
BEGIN
RIGHTMARGIN, 393
TOPMARGIN, 1
- BOTTOMMARGIN, 207
- HORZGUIDE, 196
+ BOTTOMMARGIN, 227
+ HORZGUIDE, 216
END
IDD_CIPHER_PAGE_DLG, DIALOG
BEGIN
RIGHTMARGIN, 223
- BOTTOMMARGIN, 141
+ BOTTOMMARGIN, 161
END
IDD_PASSWORD_PAGE_DLG, DIALOG
BEGIN
RIGHTMARGIN, 223
- BOTTOMMARGIN, 123
+ BOTTOMMARGIN, 143
END
IDD_SIZE_PAGE_DLG, DIALOG
BEGIN
RIGHTMARGIN, 223
- BOTTOMMARGIN, 145
+ BOTTOMMARGIN, 165
END
IDD_VOLUME_LOCATION_PAGE_DLG, DIALOG
BEGIN
RIGHTMARGIN, 223
- BOTTOMMARGIN, 147
+ BOTTOMMARGIN, 167
END
IDD_FORMAT_PAGE_DLG, DIALOG
BEGIN
RIGHTMARGIN, 217
- BOTTOMMARGIN, 133
+ BOTTOMMARGIN, 153
HORZGUIDE, 80
HORZGUIDE, 96
END
@@ -508,67 +514,67 @@ BEGIN
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 219
TOPMARGIN, 7
- BOTTOMMARGIN, 145
+ BOTTOMMARGIN, 165
END
IDD_INFO_PAGE_DLG, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 219
TOPMARGIN, 7
- BOTTOMMARGIN, 145
+ BOTTOMMARGIN, 165
END
IDD_HIDVOL_HOST_FILL_PAGE_DLG, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 219
TOPMARGIN, 7
- BOTTOMMARGIN, 145
+ BOTTOMMARGIN, 165
END
IDD_HIDDEN_VOL_WIZARD_MODE_PAGE_DLG, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 219
TOPMARGIN, 7
- BOTTOMMARGIN, 145
+ BOTTOMMARGIN, 165
END
IDD_PASSWORD_ENTRY_PAGE_DLG, DIALOG
BEGIN
RIGHTMARGIN, 223
- BOTTOMMARGIN, 123
+ BOTTOMMARGIN, 143
END
IDD_VOLUME_TYPE_PAGE_DLG, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 219
TOPMARGIN, 7
- BOTTOMMARGIN, 145
+ BOTTOMMARGIN, 165
END
IDD_SYSENC_SPAN_PAGE_DLG, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 219
TOPMARGIN, 7
- BOTTOMMARGIN, 145
+ BOTTOMMARGIN, 165
END
IDD_SYSENC_RESCUE_DISK_CREATION_DLG, DIALOG
BEGIN
RIGHTMARGIN, 223
- BOTTOMMARGIN, 147
+ BOTTOMMARGIN, 167
END
IDD_SYSENC_COLLECTING_RANDOM_DATA_DLG, DIALOG
BEGIN
RIGHTMARGIN, 217
- BOTTOMMARGIN, 133
+ BOTTOMMARGIN, 153
HORZGUIDE, 80
HORZGUIDE, 96
END
@@ -576,37 +582,37 @@ BEGIN
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 219
TOPMARGIN, 7
- BOTTOMMARGIN, 145
+ BOTTOMMARGIN, 165
END
IDD_SYSENC_RESCUE_DISK_BURN_PAGE_DLG, DIALOG
BEGIN
RIGHTMARGIN, 223
- BOTTOMMARGIN, 147
+ BOTTOMMARGIN, 167
END
IDD_SYSENC_WIPE_MODE_PAGE_DLG, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 219
TOPMARGIN, 7
- BOTTOMMARGIN, 145
+ BOTTOMMARGIN, 165
END
IDD_INPLACE_ENCRYPTION_PAGE_DLG, DIALOG
BEGIN
RIGHTMARGIN, 217
- BOTTOMMARGIN, 133
+ BOTTOMMARGIN, 153
HORZGUIDE, 80
HORZGUIDE, 96
END
IDD_SYSENC_KEYS_GEN_PAGE_DLG, DIALOG
BEGIN
RIGHTMARGIN, 217
- BOTTOMMARGIN, 133
+ BOTTOMMARGIN, 153
HORZGUIDE, 80
HORZGUIDE, 96
END
@@ -614,15 +620,15 @@ BEGIN
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 219
TOPMARGIN, 7
- BOTTOMMARGIN, 145
+ BOTTOMMARGIN, 165
END
IDD_SYSENC_DRIVE_ANALYSIS_PAGE_DLG, DIALOG
BEGIN
RIGHTMARGIN, 217
- BOTTOMMARGIN, 133
+ BOTTOMMARGIN, 153
HORZGUIDE, 80
HORZGUIDE, 96
END
@@ -630,21 +636,21 @@ BEGIN
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 219
TOPMARGIN, 7
- BOTTOMMARGIN, 145
+ BOTTOMMARGIN, 165
END
IDD_SYSENC_HIDDEN_OS_REQ_CHECK_PAGE_DLG, DIALOG
BEGIN
RIGHTMARGIN, 223
- BOTTOMMARGIN, 147
+ BOTTOMMARGIN, 167
END
IDD_DEVICE_WIPE_PAGE_DLG, DIALOG
BEGIN
RIGHTMARGIN, 217
- BOTTOMMARGIN, 133
+ BOTTOMMARGIN, 153
HORZGUIDE, 80
HORZGUIDE, 96
END
@@ -652,33 +658,33 @@ BEGIN
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 219
TOPMARGIN, 7
- BOTTOMMARGIN, 145
+ BOTTOMMARGIN, 165
END
IDD_DEVICE_TRANSFORM_MODE_DLG, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 219
TOPMARGIN, 7
- BOTTOMMARGIN, 145
+ BOTTOMMARGIN, 165
END
IDD_EXPANDED_LIST_SELECT_PAGE_DLG, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 219
TOPMARGIN, 7
- BOTTOMMARGIN, 145
+ BOTTOMMARGIN, 165
END
IDD_DRIVE_LETTER_SELECTION_PAGE, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 219
TOPMARGIN, 7
- BOTTOMMARGIN, 145
+ BOTTOMMARGIN, 165
END
END
#endif // APSTUDIO_INVOKED
diff --git a/src/Format/InPlace.c b/src/Format/InPlace.c
index cf96b813..043c1cd7 100644
--- a/src/Format/InPlace.c
+++ b/src/Format/InPlace.c
@@ -569,8 +569,9 @@ int EncryptPartitionInPlaceBegin (volatile FORMAT_VOL_PARAMETERS *volParams, vol
volParams->ea,
FIRST_MODE_OF_OPERATION_ID,
volParams->password,
volParams->pkcs5,
+ volParams->pin,
wipePass == 0 ? NULL : (char *) cryptoInfo->master_keydata,
&cryptoInfo,
dataAreaSize,
0,
@@ -608,9 +609,9 @@ int EncryptPartitionInPlaceBegin (volatile FORMAT_VOL_PARAMETERS *volParams, vol
/* Now we will try to decrypt the backup header to verify it has been correctly written. */
- nStatus = OpenBackupHeader (dev, volParams->volumePath, volParams->password, volParams->pkcs5,&cryptoInfo2, NULL, deviceSize);
+ nStatus = OpenBackupHeader (dev, volParams->volumePath, volParams->password, volParams->pkcs5, volParams->pin, &cryptoInfo2, NULL, deviceSize);
if (nStatus != ERR_SUCCESS
|| cryptoInfo->EncryptedAreaStart.Value != cryptoInfo2->EncryptedAreaStart.Value
|| cryptoInfo2->EncryptedAreaStart.Value == 0)
@@ -724,8 +725,9 @@ int EncryptPartitionInPlaceResume (HANDLE dev,
DWORD n;
char *devicePath = volParams->volumePath;
Password *password = volParams->password;
int pkcs5_prf = volParams->pkcs5;
+ int pin = volParams->pin;
DISK_GEOMETRY driveGeometry;
HWND hwndDlg = volParams->hwndDlg;
@@ -817,9 +819,9 @@ int EncryptPartitionInPlaceResume (HANDLE dev,
sectorSize = driveGeometry.BytesPerSector;
- nStatus = OpenBackupHeader (dev, devicePath, password, pkcs5_prf, &masterCryptoInfo, headerCryptoInfo, deviceSize);
+ nStatus = OpenBackupHeader (dev, devicePath, password, pkcs5_prf, pin, &masterCryptoInfo, headerCryptoInfo, deviceSize);
if (nStatus != ERR_SUCCESS)
goto closing_seq;
@@ -1047,8 +1049,9 @@ inplace_enc_read:
headerCryptoInfo->ea,
headerCryptoInfo->mode,
password,
masterCryptoInfo->pkcs5,
+ pin,
(char *) masterCryptoInfo->master_keydata,
&tmpCryptoInfo,
masterCryptoInfo->VolumeSize.Value,
0,
@@ -1197,8 +1200,9 @@ int DecryptPartitionInPlace (volatile FORMAT_VOL_PARAMETERS *volParams, volatile
char *devicePath = volParams->volumePath;
Password *password = volParams->password;
HWND hwndDlg = volParams->hwndDlg;
int pkcs5_prf = volParams->pkcs5;
+ int pin = volParams->pin;
DISK_GEOMETRY driveGeometry;
buf = (char *) TCalloc (TC_MAX_NONSYS_INPLACE_ENC_WORK_CHUNK_SIZE);
@@ -1290,9 +1294,9 @@ int DecryptPartitionInPlace (volatile FORMAT_VOL_PARAMETERS *volParams, volatile
goto closing_seq;
}
- nStatus = OpenBackupHeader (dev, devicePath, password, pkcs5_prf, &masterCryptoInfo, headerCryptoInfo, deviceSize);
+ nStatus = OpenBackupHeader (dev, devicePath, password, pkcs5_prf, pin, &masterCryptoInfo, headerCryptoInfo, deviceSize);
if (nStatus != ERR_SUCCESS)
goto closing_seq;
@@ -2080,9 +2084,9 @@ closing_seq:
return nStatus;
}
-static int OpenBackupHeader (HANDLE dev, const char *devicePath, Password *password, int pkcs5, PCRYPTO_INFO *retMasterCryptoInfo, CRYPTO_INFO *headerCryptoInfo, __int64 deviceSize)
+static int OpenBackupHeader (HANDLE dev, const char *devicePath, Password *password, int pkcs5, int pin, PCRYPTO_INFO *retMasterCryptoInfo, CRYPTO_INFO *headerCryptoInfo, __int64 deviceSize)
{
LARGE_INTEGER offset;
DWORD n;
int nStatus = ERR_SUCCESS;
@@ -2106,9 +2110,9 @@ static int OpenBackupHeader (HANDLE dev, const char *devicePath, Password *passw
goto closing_seq;
}
- nStatus = ReadVolumeHeader (FALSE, header, password, pkcs5, FALSE, retMasterCryptoInfo, headerCryptoInfo);
+ nStatus = ReadVolumeHeader (FALSE, header, password, pkcs5, pin, FALSE, retMasterCryptoInfo, headerCryptoInfo);
if (nStatus != ERR_SUCCESS)
goto closing_seq;
diff --git a/src/Format/InPlace.h b/src/Format/InPlace.h
index 6b59bbd4..d482c714 100644
--- a/src/Format/InPlace.h
+++ b/src/Format/InPlace.h
@@ -39,9 +39,9 @@ static int DismountFileSystem (HWND hwndDlg, HANDLE dev, int driveLetter, BOOL b
static int ConcealNTFS (HANDLE dev);
BOOL SaveNonSysInPlaceEncSettings (int delta, WipeAlgorithmId wipeAlgorithm, BOOL bDecrypting);
static void ExportProgressStats (__int64 bytesDone, __int64 totalSize);
int ZeroUnreadableSectors (HANDLE dev, LARGE_INTEGER startOffset, int64 size, int sectorSize, uint64 *zeroedSectorCount);
-static int OpenBackupHeader (HANDLE dev, const char *devicePath, Password *password, int pkcs5, PCRYPTO_INFO *retCryptoInfo, CRYPTO_INFO *headerCryptoInfo, __int64 deviceSize);
+static int OpenBackupHeader (HANDLE dev, const char *devicePath, Password *password, int pkcs5, int pin, PCRYPTO_INFO *retCryptoInfo, CRYPTO_INFO *headerCryptoInfo, __int64 deviceSize);
BOOL MoveClustersBeforeThreshold (HANDLE volumeHandle, PWSTR volumeDevicePath, int64 clusterThreshold);
#ifdef __cplusplus
}
diff --git a/src/Format/Resource.h b/src/Format/Resource.h
index feba5ec3..2dc03faa 100644
--- a/src/Format/Resource.h
+++ b/src/Format/Resource.h
@@ -137,18 +137,22 @@
#define IDC_HIDDEN_SYSENC_INFO_LINK 1099
#define IDT_PASS 1100
#define IDC_DEVICE_TRANSFORM_MODE_FORMAT 1101
#define IDC_DEVICE_TRANSFORM_MODE_INPLACE 1102
-#define IDC_DRIVE_LETTER_LIST 1103
-#define IDT_DRIVE_LETTER 1104
+#define IDC_DRIVE_LETTER_LIST 1103
+#define IDT_DRIVE_LETTER 1104
+#define IDT_PIN 1105
+#define IDC_PIN 1106
+#define IDC_PIN_HELP 1107
+#define IDC_EDIT1 1108
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NO_MFC 1
#define _APS_NEXT_RESOURCE_VALUE 133
#define _APS_NEXT_COMMAND_VALUE 40001
-#define _APS_NEXT_CONTROL_VALUE 1105
+#define _APS_NEXT_CONTROL_VALUE 1109
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
diff --git a/src/Format/Tcformat.c b/src/Format/Tcformat.c
index bc59a433..574d61eb 100644
--- a/src/Format/Tcformat.c
+++ b/src/Format/Tcformat.c
@@ -227,8 +227,9 @@ BOOL bWarnOuterVolSuitableFileSys = TRUE;
Password volumePassword; /* User password */
char szVerify[MAX_PASSWORD + 1]; /* Tmp password buffer */
char szRawPassword[MAX_PASSWORD + 1]; /* Password before keyfile was applied to it */
+int volumePin = 0;
BOOL bHistoryCmdLine = FALSE; /* History control is always disabled */
BOOL ComServerMode = FALSE;
@@ -277,9 +278,9 @@ void CALLBACK ResumeInPlaceEncWaitThreadProc(void* pArg, HWND hwndDlg)
{
if (device.Path == szDevicePath)
{
OpenVolumeContext volume;
- int status = OpenVolume (&volume, device.Path.c_str(), &volumePassword, hash_algo, FALSE, FALSE, FALSE, TRUE);
+ int status = OpenVolume (&volume, device.Path.c_str(), &volumePassword, hash_algo, volumePin, FALSE, FALSE, FALSE, TRUE);
if ( status == ERR_SUCCESS)
{
if ((volume.CryptoInfo->HeaderFlags & TC_HEADER_FLAG_NONSYS_INPLACE_ENC) != 0
@@ -323,9 +324,9 @@ void CALLBACK ResumeInPlaceEncWaitThreadProc(void* pArg, HWND hwndDlg)
{
OpenVolumeContext volume;
- if (OpenVolume (&volume, device.Path.c_str(), &volumePassword, hash_algo, FALSE, FALSE, FALSE, TRUE) == ERR_SUCCESS)
+ if (OpenVolume (&volume, device.Path.c_str(), &volumePassword, hash_algo, volumePin, FALSE, FALSE, FALSE, TRUE) == ERR_SUCCESS)
{
if ((volume.CryptoInfo->HeaderFlags & TC_HEADER_FLAG_NONSYS_INPLACE_ENC) != 0
&& volume.CryptoInfo->EncryptedAreaLength.Value != volume.CryptoInfo->VolumeSize.Value)
{
@@ -2499,8 +2500,9 @@ static void __cdecl volTransformThreadFunction (void *hwndDlgArg)
volParams->quickFormat = quickFormat;
volParams->sectorSize = GetFormatSectorSize();
volParams->realClusterSize = &realClusterSize;
volParams->password = &volumePassword;
+ volParams->pin = volumePin;
volParams->hwndDlg = hwndDlg;
if (bInPlaceDecNonSys)
{
@@ -2570,9 +2572,9 @@ static void __cdecl volTransformThreadFunction (void *hwndDlgArg)
if (bHiddenVolHost && !bVolTransformThreadCancel && nStatus == 0)
{
/* Auto mount the newly created hidden volume host */
- switch (MountHiddenVolHost (hwndDlg, szDiskFile, &hiddenVolHostDriveNo, &volumePassword, hash_algo, FALSE))
+ switch (MountHiddenVolHost (hwndDlg, szDiskFile, &hiddenVolHostDriveNo, &volumePassword, hash_algo, volumePin, FALSE))
{
case ERR_NO_FREE_DRIVES:
MessageBoxW (hwndDlg, GetString ("NO_FREE_DRIVE_FOR_OUTER_VOL"), lpszTitle, ICON_HAND);
bVolTransformThreadCancel = TRUE;
@@ -4063,8 +4065,16 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
SetWindowText (GetDlgItem (hwndDlg, IDC_PASSWORD_DIRECT), szRawPassword);
SetFocus (GetDlgItem (hwndDlg, IDC_PASSWORD_DIRECT));
+ SendMessage (GetDlgItem (hwndDlg, IDC_PIN), EM_LIMITTEXT, MAX_PIN, 0);
+ if (volumePin > 0)
+ {
+ char szTmp[MAX_PIN + 1];
+ StringCbPrintfA(szTmp, sizeof(szTmp), "%d", volumePin);
+ SetWindowText (GetDlgItem (hwndDlg, IDC_PIN), szTmp);
+ }
+
SetCheckBox (hwndDlg, IDC_KEYFILES_ENABLE, KeyFilesEnable);
SetWindowTextW (GetDlgItem (hwndDlg, IDC_BOX_HELP), GetString (bInPlaceEncNonSys ? (bInPlaceEncNonSysResumed ? "NONSYS_INPLACE_ENC_RESUME_PASSWORD_PAGE_HELP" : "NONSYS_INPLACE_DEC_PASSWORD_PAGE_HELP") : "PASSWORD_HIDDENVOL_HOST_DIRECT_HELP"));
@@ -4083,9 +4093,9 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
{
wchar_t str[1000];
hPasswordInputField = GetDlgItem (hwndDlg, IDC_PASSWORD);
- hVerifyPasswordInputField = GetDlgItem (hwndDlg, IDC_VERIFY);
+ hVerifyPasswordInputField = GetDlgItem (hwndDlg, IDC_VERIFY);
if (SysEncInEffect ())
{
ToBootPwdField (hwndDlg, IDC_PASSWORD);
@@ -4137,8 +4147,16 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
SetWindowText (GetDlgItem (hwndDlg, IDC_VERIFY), szVerify);
SetFocus (GetDlgItem (hwndDlg, IDC_PASSWORD));
+ SendMessage (GetDlgItem (hwndDlg, IDC_PIN), EM_LIMITTEXT, SysEncInEffect()? MAX_BOOT_PIN: MAX_PIN, 0);
+ if (volumePin > 0)
+ {
+ char szTmp[MAX_PIN + 1];
+ StringCbPrintfA(szTmp, sizeof(szTmp), "%d", volumePin);
+ SetWindowText (GetDlgItem (hwndDlg, IDC_PIN), szTmp);
+ }
+
SetCheckBox (hwndDlg, IDC_KEYFILES_ENABLE, KeyFilesEnable && !SysEncInEffect());
EnableWindow (GetDlgItem (hwndDlg, IDC_KEY_FILES), KeyFilesEnable);
SetWindowTextW (GetDlgItem (hwndDlg, IDC_BOX_HELP), str);
@@ -4163,8 +4181,9 @@ 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);
+
}
break;
case FILESYS_PAGE:
@@ -6940,18 +6959,26 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
KeyFilesEnable && FirstKeyFile!=NULL && !SysEncInEffect());
volumePassword.Length = (unsigned __int32) strlen ((char *) volumePassword.Text);
+ volumePin = GetPin (hCurPage, IDC_PIN);
+
if (volumePassword.Length > 0)
- {
+ {
// Password character encoding
if (!CheckPasswordCharEncoding (GetDlgItem (hCurPage, IDC_PASSWORD), NULL))
{
Error ("UNSUPPORTED_CHARS_IN_PWD", hwndDlg);
return 1;
}
+ else if (SysEncInEffect() && (volumePin > MAX_BOOT_PIN_VALUE))
+ {
+ SetFocus (GetDlgItem(hCurPage, IDC_PIN));
+ Error ("PIN_SYSENC_TOO_BIG", hwndDlg);
+ return 1;
+ }
// Check password length (check also done for outer volume which is not the case in TrueCrypt).
- else if (!CheckPasswordLength (hwndDlg, GetDlgItem (hCurPage, IDC_PASSWORD)))
+ else if (!CheckPasswordLength (hwndDlg, GetDlgItem (hCurPage, IDC_PASSWORD), volumePin, SysEncInEffect()))
{
return 1;
}
}
@@ -7012,8 +7039,10 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
volumePassword.Length = (unsigned __int32) strlen ((char *) volumePassword.Text);
hash_algo = (int) SendMessage (GetDlgItem (hCurPage, IDC_PKCS5_PRF_ID), CB_GETITEMDATA, SendMessage (GetDlgItem (hCurPage, IDC_PKCS5_PRF_ID), CB_GETCURSEL, 0, 0), 0);
+ volumePin = GetPin (hCurPage, IDC_PIN);
+
// Store the password in case we need to restore it after keyfile is applied to it
GetWindowText (GetDlgItem (hCurPage, IDC_PASSWORD_DIRECT), szRawPassword, sizeof (szRawPassword));
if (KeyFilesEnable)
@@ -7049,9 +7078,9 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
int retCode;
// Mount the hidden volume host as read-only (to ensure consistent and secure
// results of the volume bitmap scanning)
- switch (MountHiddenVolHost (hwndDlg, szDiskFile, &hiddenVolHostDriveNo, &volumePassword, hash_algo, TRUE))
+ switch (MountHiddenVolHost (hwndDlg, szDiskFile, &hiddenVolHostDriveNo, &volumePassword, hash_algo, volumePin, TRUE))
{
case ERR_NO_FREE_DRIVES:
NormalCursor ();
MessageBoxW (hwndDlg, GetString ("NO_FREE_DRIVE_FOR_OUTER_VOL"), lpszTitle, ICON_HAND);
@@ -7217,9 +7246,9 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
mountOptions.Removable = ConfigReadInt ("MountVolumesRemovable", FALSE);
// Check that it is not a hidden or legacy volume
- if (MountVolume (hwndDlg, driveNo, szFileName, &volumePassword, hash_algo, FALSE, FALSE, TRUE, &mountOptions, FALSE, TRUE) < 1)
+ if (MountVolume (hwndDlg, driveNo, szFileName, &volumePassword, hash_algo, volumePin, FALSE, FALSE, TRUE, &mountOptions, FALSE, TRUE) < 1)
{
NormalCursor();
return 1;
}
@@ -7259,9 +7288,9 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
}
mountOptions.UseBackupHeader = TRUE; // This must be TRUE at this point (we won't be using the regular header, which will be lost soon after the decryption process starts)
- if (MountVolume (hwndDlg, driveNo, szFileName, &volumePassword, hash_algo, FALSE, FALSE, TRUE, &mountOptions, FALSE, TRUE) < 1)
+ if (MountVolume (hwndDlg, driveNo, szFileName, &volumePassword, hash_algo, volumePin, FALSE, FALSE, TRUE, &mountOptions, FALSE, TRUE) < 1)
{
NormalCursor();
return 1;
}
@@ -7325,9 +7354,9 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
try
{
WaitCursor();
- BootEncObj->PrepareInstallation (!bWholeSysDrive, volumePassword, nVolumeEA, FIRST_MODE_OF_OPERATION_ID, hash_algo, "");
+ BootEncObj->PrepareInstallation (!bWholeSysDrive, volumePassword, nVolumeEA, FIRST_MODE_OF_OPERATION_ID, hash_algo, volumePin, "");
}
catch (Exception &e)
{
e.Show (hwndDlg);
@@ -7871,9 +7900,9 @@ retryCDDriveCheck:
if (hiddenVolHostDriveNo < 0) // If the hidden volume host is not mounted
{
// Remount the hidden volume host as read-only (to ensure consistent and secure
// results of the volume bitmap scanning)
- switch (MountHiddenVolHost (hwndDlg, szDiskFile, &hiddenVolHostDriveNo, &volumePassword, hash_algo, TRUE))
+ switch (MountHiddenVolHost (hwndDlg, szDiskFile, &hiddenVolHostDriveNo, &volumePassword, hash_algo, volumePin, TRUE))
{
case ERR_NO_FREE_DRIVES:
MessageBoxW (hwndDlg, GetString ("NO_FREE_DRIVE_FOR_OUTER_VOL"), lpszTitle, ICON_HAND);
NormalCursor ();
@@ -8095,8 +8124,10 @@ ovf_end:
KeyFilesEnable && FirstKeyFile!=NULL && !SysEncInEffect ());
volumePassword.Length = (unsigned __int32) strlen ((char *) volumePassword.Text);
+ volumePin = GetPin (hCurPage, IDC_PIN);
+
nNewPageNo = SIZE_PAGE + 1; // Skip the hidden volume host password page
if (SysEncInEffect ())
{
@@ -8690,9 +8721,9 @@ efsf_error:
}
// Mounts a volume within which the user intends to create a hidden volume
-int MountHiddenVolHost (HWND hwndDlg, char *volumePath, int *driveNo, Password *password, int pkcs5_prf, BOOL bReadOnly)
+int MountHiddenVolHost (HWND hwndDlg, char *volumePath, int *driveNo, Password *password, int pkcs5_prf, int pin, BOOL bReadOnly)
{
MountOptions mountOptions;
ZeroMemory (&mountOptions, sizeof (mountOptions));
@@ -8710,9 +8741,9 @@ int MountHiddenVolHost (HWND hwndDlg, char *volumePath, int *driveNo, Password *
mountOptions.PreserveTimestamp = bPreserveTimestamp;
mountOptions.PartitionInInactiveSysEncScope = FALSE;
mountOptions.UseBackupHeader = FALSE;
- if (MountVolume (hwndDlg, *driveNo, volumePath, password, pkcs5_prf, FALSE, FALSE, TRUE, &mountOptions, FALSE, TRUE) < 1)
+ if (MountVolume (hwndDlg, *driveNo, volumePath, password, pkcs5_prf, pin, FALSE, FALSE, TRUE, &mountOptions, FALSE, TRUE) < 1)
{
*driveNo = -3;
return ERR_VOL_MOUNT_FAILED;
}
diff --git a/src/Format/Tcformat.h b/src/Format/Tcformat.h
index 15a81534..11d5b354 100644
--- a/src/Format/Tcformat.h
+++ b/src/Format/Tcformat.h
@@ -67,9 +67,9 @@ static BOOL CreatingHiddenSysVol(void);
static void NonSysInplaceEncPause (void);
static void NonSysInplaceEncResume (void);
void ShowNonSysInPlaceEncUIStatus (void);
void UpdateNonSysInPlaceEncControls (void);
-int MountHiddenVolHost ( HWND hwndDlg, char *volumePath, int *driveNo, Password *password, int pkcs5_prf, BOOL bReadOnly );
+int MountHiddenVolHost ( HWND hwndDlg, char *volumePath, int *driveNo, Password *password, int pkcs5_prf, int pin, BOOL bReadOnly );
int AnalyzeHiddenVolumeHost (HWND hwndDlg, int *driveNo, __int64 hiddenVolHostSize, int *realClusterSize, __int64 *pnbrFreeClusters);
int ScanVolClusterBitmap ( HWND hwndDlg, int *driveNo, __int64 nbrClusters, __int64 *nbrFreeClusters);
static void WipeStart (void);
static void WipeAbort (void);