diff options
author | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2019-03-03 00:18:48 +0100 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2019-03-03 00:20:49 +0100 |
commit | 453ef927ef734320a715de12ec8536e3a642bc26 (patch) | |
tree | 7491ef15d8b5e9b86e776b5f6b4af9689220a0f3 /src/Mount | |
parent | ea88c6175c19bbc2c063be63f64705733112ff0d (diff) | |
download | VeraCrypt-453ef927ef734320a715de12ec8536e3a642bc26.tar.gz VeraCrypt-453ef927ef734320a715de12ec8536e3a642bc26.zip |
Windows: Add option to use legacy maximum password length (64 characters) instead of new maximum length (128) in UI and command line. This will users who were relying on the UI truncating the passwords to the first 64 characters in the previous versions of VeraCrypt.
Diffstat (limited to 'src/Mount')
-rw-r--r-- | src/Mount/Mount.c | 13 | ||||
-rw-r--r-- | src/Mount/Mount.rc | 26 | ||||
-rw-r--r-- | src/Mount/Resource.h | 3 |
3 files changed, 29 insertions, 13 deletions
diff --git a/src/Mount/Mount.c b/src/Mount/Mount.c index cc3ae11e..c99f538a 100644 --- a/src/Mount/Mount.c +++ b/src/Mount/Mount.c @@ -891,6 +891,8 @@ void LoadSettingsAndCheckModified (HWND hwndDlg, BOOL bOnlyCheckModified, BOOL* ConfigReadCompareInt ("UseSecureDesktop", FALSE, &bUseSecureDesktop, bOnlyCheckModified, pbSettingsModified); + ConfigReadCompareInt ("UseLegacyMaxPasswordLength", FALSE, &bUseLegacyMaxPasswordLength, bOnlyCheckModified, pbSettingsModified); + ConfigReadCompareInt ("MountVolumesRemovable", FALSE, &defaultMountOptions.Removable, bOnlyCheckModified, pbSettingsModified); ConfigReadCompareInt ("MountVolumesReadOnly", FALSE, &defaultMountOptions.ReadOnly, bOnlyCheckModified, pbSettingsModified); @@ -1049,6 +1051,7 @@ void SaveSettings (HWND hwndDlg) ConfigWriteInt ("ShowDisconnectedNetworkDrives",bShowDisconnectedNetworkDrives); ConfigWriteInt ("HideWaitingDialog", bHideWaitingDialog); ConfigWriteInt ("UseSecureDesktop", bUseSecureDesktop); + ConfigWriteInt ("UseLegacyMaxPasswordLength", bUseLegacyMaxPasswordLength); ConfigWriteInt ("EnableBackgroundTask", bEnableBkgTask); ConfigWriteInt ("CloseBackgroundTaskOnNoVolumes", bCloseBkgTaskWhenNoVolumes); @@ -3340,6 +3343,9 @@ BOOL CALLBACK PreferencesDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM SendMessage (GetDlgItem (hwndDlg, IDC_SECURE_DESKTOP_PASSWORD_ENTRY), BM_SETCHECK, bUseSecureDesktop ? BST_CHECKED:BST_UNCHECKED, 0); + SendMessage (GetDlgItem (hwndDlg, IDC_USE_LEGACY_MAX_PASSWORD_LENGTH), BM_SETCHECK, + bUseLegacyMaxPasswordLength ? BST_CHECKED:BST_UNCHECKED, 0); + SendMessage (GetDlgItem (hwndDlg, IDC_PREF_TEMP_CACHE_ON_MULTIPLE_MOUNT), BM_SETCHECK, bCacheDuringMultipleMount ? BST_CHECKED:BST_UNCHECKED, 0); @@ -3456,6 +3462,7 @@ BOOL CALLBACK PreferencesDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM bShowDisconnectedNetworkDrives = IsButtonChecked (GetDlgItem (hwndDlg, IDC_SHOW_DISCONNECTED_NETWORK_DRIVES)); bHideWaitingDialog = IsButtonChecked (GetDlgItem (hwndDlg, IDC_HIDE_WAITING_DIALOG)); bUseSecureDesktop = IsButtonChecked (GetDlgItem (hwndDlg, IDC_SECURE_DESKTOP_PASSWORD_ENTRY)); + bUseLegacyMaxPasswordLength = IsButtonChecked (GetDlgItem (hwndDlg, IDC_USE_LEGACY_MAX_PASSWORD_LENGTH)); bCacheDuringMultipleMount = IsButtonChecked (GetDlgItem (hwndDlg, IDC_PREF_TEMP_CACHE_ON_MULTIPLE_MOUNT)); bWipeCacheOnExit = IsButtonChecked (GetDlgItem (hwndDlg, IDC_PREF_WIPE_CACHE_ON_EXIT)); bWipeCacheOnAutoDismount = IsButtonChecked (GetDlgItem (hwndDlg, IDC_PREF_WIPE_CACHE_ON_AUTODISMOUNT)); @@ -6791,6 +6798,7 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa bShowDisconnectedNetworkDrives = FALSE; bHideWaitingDialog = FALSE; bUseSecureDesktop = FALSE; + bUseLegacyMaxPasswordLength = FALSE; ResetWrongPwdRetryCount (); @@ -6833,6 +6841,10 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa // Keyfiles LoadDefaultKeyFilesParam (); RestoreDefaultKeyFilesParam (); + + // if maximum password length is set to legacy value, abort if password in command line is longer + if (bUseLegacyMaxPasswordLength && CmdVolumePasswordValid && (CmdVolumePassword.Length > MAX_LEGACY_PASSWORD)) + AbortProcess ("COMMAND_LINE_ERROR"); } if (ComServerMode) @@ -9561,6 +9573,7 @@ static BOOL StartSystemFavoritesService () bShowDisconnectedNetworkDrives = TRUE; bHideWaitingDialog = TRUE; bUseSecureDesktop = FALSE; + bUseLegacyMaxPasswordLength = FALSE; InitOSVersionInfo(); diff --git a/src/Mount/Mount.rc b/src/Mount/Mount.rc index 6082d2cd..9006b46f 100644 --- a/src/Mount/Mount.rc +++ b/src/Mount/Mount.rc @@ -41,7 +41,7 @@ IDR_MOUNT_TLB TYPELIB "Mount.tlb" // Dialog // -IDD_PREFERENCES_DLG DIALOGEX 0, 0, 336, 340 +IDD_PREFERENCES_DLG DIALOGEX 0, 0, 336, 347 STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "VeraCrypt - Preferences" FONT 8, "MS Shell Dlg", 400, 0, 0x1 @@ -78,30 +78,32 @@ BEGIN CONTROL "Make disconnected network drives available for mounting",IDC_SHOW_DISCONNECTED_NETWORK_DRIVES, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,208,316,10 CONTROL "Cache passwords in driver memory",IDC_PREF_CACHE_PASSWORDS, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,263,146,11 + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,271,146,11 CONTROL "Wipe cached passwords on exit",IDC_PREF_WIPE_CACHE_ON_EXIT, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,162,263,165,11 + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,162,271,165,11 CONTROL "Temporarily cache password during ""Mount Favorite Volumes"" operations",IDC_PREF_TEMP_CACHE_ON_MULTIPLE_MOUNT, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,277,294,11 + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,285,294,11 CONTROL "Wipe cached passwords on auto-dismount",IDC_PREF_WIPE_CACHE_ON_AUTODISMOUNT, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,291,296,11 + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,299,296,11 CONTROL "Include PIM when caching a password",IDC_PREF_CACHE_PIM, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,305,296,10 - PUSHBUTTON "More Settings...",IDC_MORE_SETTINGS,5,324,85,14 - DEFPUSHBUTTON "OK",IDOK,225,324,50,14 - PUSHBUTTON "Cancel",IDCANCEL,281,324,50,14 - GROUPBOX "Windows",IDT_WINDOWS_RELATED_SETTING,4,160,328,87 + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,313,296,10 + PUSHBUTTON "More Settings...",IDC_MORE_SETTINGS,5,331,85,14 + DEFPUSHBUTTON "OK",IDOK,225,331,50,14 + PUSHBUTTON "Cancel",IDCANCEL,281,331,50,14 + GROUPBOX "Windows",IDT_WINDOWS_RELATED_SETTING,4,160,328,97 GROUPBOX "Default Mount Options",IDT_DEFAULT_MOUNT_OPTIONS,4,3,328,26 GROUPBOX "VeraCrypt Background Task",IDT_TASKBAR_ICON,4,33,328,26 GROUPBOX "Auto-Dismount",IDT_AUTO_DISMOUNT,4,94,328,62 LTEXT "minutes",IDT_MINUTES,289,129,39,10 LTEXT "Dismount all when:",IDT_AUTO_DISMOUNT_ON,9,104,71,20 - GROUPBOX "Password Cache",IDT_PW_CACHE_OPTIONS,4,252,328,68 + GROUPBOX "Password Cache",IDT_PW_CACHE_OPTIONS,4,260,328,68 GROUPBOX "Actions to perform upon logon to Windows",IDT_LOGON,4,63,328,28 CONTROL "Don't show wait message dialog when performing operations",IDC_HIDE_WAITING_DIALOG, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,220,316,10 CONTROL "Use Secure Desktop for password entry",IDC_SECURE_DESKTOP_PASSWORD_ENTRY, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,232,316,10 + CONTROL "Use legacy maximum password length (64 characters)",IDC_USE_LEGACY_MAX_PASSWORD_LENGTH, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,244,316,10 END IDD_VOLUME_PROPERTIES DIALOGEX 60, 30, 284, 224 @@ -442,7 +444,7 @@ BEGIN LEFTMARGIN, 7 RIGHTMARGIN, 329 TOPMARGIN, 7 - BOTTOMMARGIN, 338 + BOTTOMMARGIN, 345 END IDD_VOLUME_PROPERTIES, DIALOG diff --git a/src/Mount/Resource.h b/src/Mount/Resource.h index f0903cab..d102faf4 100644 --- a/src/Mount/Resource.h +++ b/src/Mount/Resource.h @@ -194,6 +194,7 @@ #define IDC_CLEAR_KEYS_ON_NEW_DEVICE_INSERTION 1171 #define IDC_ENABLE_CPU_RNG 1172 #define IDC_ENABLE_RAM_ENCRYPTION 1173 +#define IDC_USE_LEGACY_MAX_PASSWORD_LENGTH 1174 #define IDM_HELP 40001 #define IDM_ABOUT 40002 #define IDM_UNMOUNT_VOLUME 40003 @@ -270,7 +271,7 @@ #define _APS_NO_MFC 1 #define _APS_NEXT_RESOURCE_VALUE 120 #define _APS_NEXT_COMMAND_VALUE 40069 -#define _APS_NEXT_CONTROL_VALUE 1174 +#define _APS_NEXT_CONTROL_VALUE 1175 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif |