diff options
author | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2015-10-07 04:06:50 +0200 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2015-10-07 12:55:58 +0200 |
commit | f3c91cb05c9a3ba2651438f576d707f7a48d507b (patch) | |
tree | 6e7f4b7ae134247357109a86f6540b3a4bca523e /src/Common/Keyfiles.c | |
parent | 13058fd638eaddf4ecdd52e902f3bf7254b5c45c (diff) | |
download | VeraCrypt-f3c91cb05c9a3ba2651438f576d707f7a48d507b.tar.gz VeraCrypt-f3c91cb05c9a3ba2651438f576d707f7a48d507b.zip |
Windows: Don’t try to mount using empty password when default keyfile configured or keyfile specified in command line. Add option in default keyfiles dialog to restore the old behavior.
Diffstat (limited to 'src/Common/Keyfiles.c')
-rw-r--r-- | src/Common/Keyfiles.c | 25 |
1 files changed, 25 insertions, 0 deletions
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 <Strsafe.h>
@@ -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;
}
|