VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Mount
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2016-02-01 23:44:39 (GMT)
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2016-02-01 23:47:15 (GMT)
commit4a7a9f4dd25e1c8357ba8831dc78c5a5b945f18f (patch)
tree10226c664f8265e8e0ca1745d9d86c65ac90c7c2 /src/Mount
parentce8a9becdf73e480cba50e38a119dafb1e7b553c (diff)
downloadVeraCrypt-4a7a9f4dd25e1c8357ba8831dc78c5a5b945f18f.zip
VeraCrypt-4a7a9f4dd25e1c8357ba8831dc78c5a5b945f18f.tar.gz
Windows: Don't try to mount using cached passwords if password and/or keyfile are specified in the command line.
Diffstat (limited to 'src/Mount')
-rw-r--r--src/Mount/Mount.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/Mount/Mount.c b/src/Mount/Mount.c
index 2df0868..2bbb8af 100644
--- a/src/Mount/Mount.c
+++ b/src/Mount/Mount.c
@@ -6320,11 +6320,8 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
if (!EffectiveVolumeTrueCryptMode)
EffectiveVolumeTrueCryptMode = DefaultVolumeTrueCryptMode;
- // Cached password
- mounted = MountVolume (hwndDlg, szDriveLetter[0] - L'A', szFileName, NULL, EffectiveVolumePkcs5, CmdVolumePim, EffectiveVolumeTrueCryptMode, bCacheInDriver, bIncludePimInCache, bForceMount, &mountOptions, Silent, FALSE);
-
// Command line password or keyfiles
- if (!mounted && (CmdVolumePassword.Length != 0 || (FirstCmdKeyFile && (CmdVolumePasswordValid || bEffectiveTryEmptyPasswordWhenKeyfileUsed))))
+ if (CmdVolumePassword.Length != 0 || (FirstCmdKeyFile && (CmdVolumePasswordValid || bEffectiveTryEmptyPasswordWhenKeyfileUsed)))
{
BOOL reportBadPasswd = CmdVolumePassword.Length > 0;
@@ -6337,6 +6334,11 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
burn (&CmdVolumePassword, sizeof (CmdVolumePassword));
}
+ else
+ {
+ // Cached password
+ mounted = MountVolume (hwndDlg, szDriveLetter[0] - L'A', szFileName, NULL, EffectiveVolumePkcs5, CmdVolumePim, EffectiveVolumeTrueCryptMode, bCacheInDriver, bIncludePimInCache, bForceMount, &mountOptions, Silent, FALSE);
+ }
if (FirstCmdKeyFile)
{