From 6bb1f24ed571bccd4d1d247dafdc1dda6eaa3d8d Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Mon, 4 Feb 2019 11:37:37 +0100 Subject: Automatically truncate passwords for TrueCrypt volumes and System Encryption to the first 64 characters. This fix issues encountered by users of TrueCrypt volumes who were using passwords longer than 64 characters that were truncated in previous version. --- src/Format/Tcformat.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/Format/Tcformat.c') diff --git a/src/Format/Tcformat.c b/src/Format/Tcformat.c index e91a5bf6..cbd0eec5 100644 --- a/src/Format/Tcformat.c +++ b/src/Format/Tcformat.c @@ -5755,7 +5755,7 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa { if (hw == EN_CHANGE) { - GetPassword (hCurPage, IDC_PASSWORD_DIRECT, (char*) volumePassword.Text, MAX_PASSWORD + 1, FALSE); + GetPassword (hCurPage, IDC_PASSWORD_DIRECT, (char*) volumePassword.Text, MAX_PASSWORD + 1, FALSE, FALSE); volumePassword.Length = (unsigned __int32) strlen ((char *) volumePassword.Text); return 1; } @@ -7575,7 +7575,7 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa } // Store the password in case we need to restore it after keyfile is applied to it - if (!GetPassword (hCurPage, IDC_PASSWORD, szRawPassword, sizeof (szRawPassword), TRUE)) + if (!GetPassword (hCurPage, IDC_PASSWORD, szRawPassword, sizeof (szRawPassword), FALSE, TRUE)) return 1; if (!SysEncInEffect ()) @@ -7684,7 +7684,7 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa { WaitCursor (); - if (!GetPassword (hCurPage, IDC_PASSWORD_DIRECT, (char*) volumePassword.Text, MAX_PASSWORD + 1, TRUE)) + if (!GetPassword (hCurPage, IDC_PASSWORD_DIRECT, (char*) volumePassword.Text, MAX_PASSWORD + 1, FALSE, TRUE)) { NormalCursor (); return 1; @@ -7696,7 +7696,7 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa volumePim = GetPim (hCurPage, IDC_PIM, 0); // Store the password in case we need to restore it after keyfile is applied to it - if (!GetPassword (hCurPage, IDC_PASSWORD_DIRECT, szRawPassword, sizeof (szRawPassword), TRUE)) + if (!GetPassword (hCurPage, IDC_PASSWORD_DIRECT, szRawPassword, sizeof (szRawPassword), FALSE, TRUE)) { NormalCursor (); return 1; @@ -8791,7 +8791,7 @@ ovf_end: else if (nCurPageNo == PASSWORD_PAGE) { // Store the password in case we need to restore it after keyfile is applied to it - GetPassword (hCurPage, IDC_PASSWORD, szRawPassword, sizeof (szRawPassword), FALSE); + GetPassword (hCurPage, IDC_PASSWORD, szRawPassword, sizeof (szRawPassword), FALSE, FALSE); VerifyPasswordAndUpdate (hwndDlg, GetDlgItem (MainDlg, IDC_NEXT), GetDlgItem (hCurPage, IDC_PASSWORD), @@ -8833,7 +8833,7 @@ ovf_end: || nCurPageNo == NONSYS_INPLACE_ENC_RESUME_PASSWORD_PAGE) { // Store the password in case we need to restore it after keyfile is applied to it - GetPassword (hCurPage, IDC_PASSWORD_DIRECT, szRawPassword, MAX_PASSWORD + 1, FALSE); + GetPassword (hCurPage, IDC_PASSWORD_DIRECT, szRawPassword, MAX_PASSWORD + 1, FALSE, FALSE); memcpy (volumePassword.Text, szRawPassword, MAX_PASSWORD + 1); volumePassword.Length = (unsigned __int32) strlen ((char *) volumePassword.Text); -- cgit v1.2.3