From f3c91cb05c9a3ba2651438f576d707f7a48d507b Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Wed, 7 Oct 2015 04:06:50 +0200 Subject: =?UTF-8?q?Windows:=20Don=E2=80=99t=20try=20to=20mount=20using=20e?= =?UTF-8?q?mpty=20password=20when=20default=20keyfile=20configured=20or=20?= =?UTF-8?q?keyfile=20specified=20in=20command=20line.=20Add=20option=20in?= =?UTF-8?q?=20default=20keyfiles=20dialog=20to=20restore=20the=20old=20beh?= =?UTF-8?q?avior.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Common/Keyfiles.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'src/Common/Keyfiles.c') diff --git a/src/Common/Keyfiles.c b/src/Common/Keyfiles.c index 549ffe6e..428821b5 100644 --- a/src/Common/Keyfiles.c +++ b/src/Common/Keyfiles.c @@ -26,6 +26,9 @@ #include "Common/resource.h" #include "Platform/Finally.h" #include "Platform/ForEach.h" +#ifdef TCMOUNT +#include "Mount/Mount.h" +#endif #include @@ -465,6 +468,17 @@ BOOL CALLBACK KeyFilesDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPa LoadKeyList (hwndDlg, param->FirstKeyFile); SetCheckBox (hwndDlg, IDC_KEYFILES_ENABLE, param->EnableKeyFiles); + +#ifdef TCMOUNT + if ( (origParam.EnableKeyFiles == defaultKeyFilesParam.EnableKeyFiles) + && (origParam.FirstKeyFile == defaultKeyFilesParam.FirstKeyFile) + ) + { + /* default keyfile dialog case */ + SetCheckBox (hwndDlg, IDC_KEYFILES_TRY_EMPTY_PASSWORD, bTryEmptyPasswordWhenKeyfileUsed); + ShowWindow(GetDlgItem(hwndDlg, IDC_KEYFILES_TRY_EMPTY_PASSWORD), SW_SHOW); + } +#endif SetWindowTextW(GetDlgItem(hwndDlg, IDT_KEYFILES_NOTE), GetString ("KEYFILES_NOTE")); @@ -586,6 +600,17 @@ BOOL CALLBACK KeyFilesDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPa if (lw == IDOK) { param->EnableKeyFiles = IsButtonChecked (GetDlgItem (hwndDlg, IDC_KEYFILES_ENABLE)); + +#ifdef TCMOUNT + if (IsWindowVisible (GetDlgItem (hwndDlg, IDC_KEYFILES_TRY_EMPTY_PASSWORD))) + { + bTryEmptyPasswordWhenKeyfileUsed = IsButtonChecked (GetDlgItem (hwndDlg, IDC_KEYFILES_TRY_EMPTY_PASSWORD)); + + WaitCursor (); + SaveSettings (hwndDlg); + NormalCursor (); + } +#endif EndDialog (hwndDlg, IDOK); return 1; } -- cgit v1.2.3