VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Mount/Mount.c
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2019-03-03 00:18:48 +0100
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2019-03-03 00:20:49 +0100
commit453ef927ef734320a715de12ec8536e3a642bc26 (patch)
tree7491ef15d8b5e9b86e776b5f6b4af9689220a0f3 /src/Mount/Mount.c
parentea88c6175c19bbc2c063be63f64705733112ff0d (diff)
downloadVeraCrypt-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/Mount.c')
-rw-r--r--src/Mount/Mount.c13
1 files changed, 13 insertions, 0 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();