VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Format
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/Format
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/Format')
-rw-r--r--src/Format/Tcformat.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Format/Tcformat.c b/src/Format/Tcformat.c
index cbd0eec5..b04e95c9 100644
--- a/src/Format/Tcformat.c
+++ b/src/Format/Tcformat.c
@@ -779,6 +779,8 @@ static void LoadSettingsAndCheckModified (HWND hwndDlg, BOOL bOnlyCheckModified,
ConfigReadCompareInt ("SaveVolumeHistory", FALSE, &bHistory, bOnlyCheckModified, pbSettingsModified);
+ ConfigReadCompareInt ("UseLegacyMaxPasswordLength", FALSE, &bUseLegacyMaxPasswordLength, bOnlyCheckModified, pbSettingsModified);
+
{
char szTmp[MAX_PATH] = {0};
WideCharToMultiByte (CP_UTF8, 0, SecurityTokenLibraryPath, -1, szTmp, MAX_PATH, NULL, NULL);
@@ -9080,7 +9082,8 @@ void ExtractCommandLine (HWND hwndDlg, wchar_t *lpszCommandLine)
if (HAS_ARGUMENT == GetArgumentValue (lpszCommandLineArgs, &i, nNoCommandLineArgs,
szTmp, ARRAYSIZE (szTmp)))
{
- int iLen = WideCharToMultiByte (CP_UTF8, 0, szTmp, -1, (LPSTR) CmdVolumePassword.Text, MAX_PASSWORD + 1, NULL, NULL);
+ int iMaxPassLen = bUseLegacyMaxPasswordLength? MAX_LEGACY_PASSWORD : MAX_PASSWORD;
+ int iLen = WideCharToMultiByte (CP_UTF8, 0, szTmp, -1, (LPSTR) CmdVolumePassword.Text, iMaxPassLen + 1, NULL, NULL);
burn (szTmp, sizeof (szTmp));
if (iLen > 0)
CmdVolumePassword.Length = (unsigned __int32) (iLen - 1);