VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/ExpandVolume/WinMain.cpp
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2019-03-03 16:54:44 +0100
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2019-03-03 23:47:58 +0100
commitd92e045b8da9ab41005d9caa440744997b9de8ce (patch)
tree5e229dfa0d0c4d5fb702c1fbdc18ff9e9d418789 /src/ExpandVolume/WinMain.cpp
parent453ef927ef734320a715de12ec8536e3a642bc26 (diff)
downloadVeraCrypt-d92e045b8da9ab41005d9caa440744997b9de8ce.tar.gz
VeraCrypt-d92e045b8da9ab41005d9caa440744997b9de8ce.zip
Windows: replicate old behavior when handling passwords in UI when legacy password maximum length option selected
Diffstat (limited to 'src/ExpandVolume/WinMain.cpp')
-rw-r--r--src/ExpandVolume/WinMain.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/ExpandVolume/WinMain.cpp b/src/ExpandVolume/WinMain.cpp
index 7823ad12..2710cc4e 100644
--- a/src/ExpandVolume/WinMain.cpp
+++ b/src/ExpandVolume/WinMain.cpp
@@ -285,6 +285,7 @@ void LoadSettings (HWND hwndDlg)
bShowDisconnectedNetworkDrives = ConfigReadInt ("ShowDisconnectedNetworkDrives", FALSE);
bHideWaitingDialog = ConfigReadInt ("HideWaitingDialog", FALSE);
bUseSecureDesktop = ConfigReadInt ("UseSecureDesktop", FALSE);
+ bUseLegacyMaxPasswordLength = ConfigReadInt ("UseLegacyMaxPasswordLength", FALSE);
defaultMountOptions.Removable = ConfigReadInt ("MountVolumesRemovable", FALSE);
defaultMountOptions.ReadOnly = ConfigReadInt ("MountVolumesReadOnly", FALSE);
defaultMountOptions.ProtectHiddenVolume = FALSE;
@@ -674,10 +675,11 @@ BOOL CALLBACK ExtcvPasswordDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
if (lw == IDOK)
{
BOOL bTrueCryptMode = GetCheckBox (hwndDlg, IDC_TRUECRYPT_MODE);
+ int iMaxPasswordLength = (bUseLegacyMaxPasswordLength || bTrueCryptMode)? MAX_LEGACY_PASSWORD : MAX_PASSWORD;
if (mountOptions.ProtectHiddenVolume && hidVolProtKeyFilesParam.EnableKeyFiles)
KeyFilesApply (hwndDlg, &mountOptions.ProtectedHidVolPassword, hidVolProtKeyFilesParam.FirstKeyFile, PasswordDlgVolume);
- if (GetPassword (hwndDlg, IDC_PASSWORD, (LPSTR) szXPwd->Text, MAX_PASSWORD + 1, bTrueCryptMode, TRUE))
+ if (GetPassword (hwndDlg, IDC_PASSWORD, (LPSTR) szXPwd->Text, iMaxPasswordLength + 1, bTrueCryptMode, TRUE))
szXPwd->Length = (unsigned __int32) (strlen ((char *) szXPwd->Text));
else
return 1;
@@ -886,6 +888,7 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
bShowDisconnectedNetworkDrives = FALSE;
bHideWaitingDialog = FALSE;
bUseSecureDesktop = FALSE;
+ bUseLegacyMaxPasswordLength = FALSE;
if (UsePreferences)
{