diff options
author | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2020-07-06 18:03:57 +0200 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2020-07-06 18:18:54 +0200 |
commit | 3daaae0d4895b6d4f37499ec75f42ed8359a4d74 (patch) | |
tree | bb24764fe66b2d87d83ed8d251974163e84e870a | |
parent | ff391d9a6afb856e20e827edbad0aff9e6caffe3 (diff) | |
download | VeraCrypt-3daaae0d4895b6d4f37499ec75f42ed8359a4d74.tar.gz VeraCrypt-3daaae0d4895b6d4f37499ec75f42ed8359a4d74.zip |
Windows: correctly wipe password in UI input field in case of direct creation of Hidden volume or resuming non-system in-place encryption
-rw-r--r-- | src/Format/Tcformat.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/Format/Tcformat.c b/src/Format/Tcformat.c index ab7b165b..6a31883c 100644 --- a/src/Format/Tcformat.c +++ b/src/Format/Tcformat.c @@ -420,7 +420,9 @@ static void WipePasswordsAndKeyfiles (bool bFull) // Attempt to wipe passwords stored in the input field buffers wmemset (tmp, L'X', MAX_PASSWORD); tmp [MAX_PASSWORD] = 0; + if (hPasswordInputField) SetWindowText (hPasswordInputField, tmp); + if (hVerifyPasswordInputField) SetWindowText (hVerifyPasswordInputField, tmp); burn (&szVerify[0], sizeof (szVerify)); @@ -436,8 +438,10 @@ static void WipePasswordsAndKeyfiles (bool bFull) burn (&outerVolumePim, sizeof (outerVolumePim)); } - SetWindowText (hPasswordInputField, L""); - SetWindowText (hVerifyPasswordInputField, L""); + if (hPasswordInputField) + SetWindowText (hPasswordInputField, L""); + if (hVerifyPasswordInputField) + SetWindowText (hVerifyPasswordInputField, L""); KeyFileRemoveAll (&FirstKeyFile); KeyFileRemoveAll (&defaultKeyFilesParam.FirstKeyFile); @@ -4327,6 +4331,8 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa /* make autodetection the default */ SendMessage (hComboBox, CB_SETCURSEL, 0, 0); + hPasswordInputField = GetDlgItem (hwndDlg, IDC_PASSWORD_DIRECT); + hVerifyPasswordInputField = NULL; ToNormalPwdField (hwndDlg, IDC_PASSWORD_DIRECT); SetPassword (hwndDlg, IDC_PASSWORD_DIRECT, szRawPassword); |