mirror of
https://github.com/veracrypt/VeraCrypt
synced 2024-11-24 12:03:28 +01:00
Windows: Don't try to mount using cached passwords if password and/or keyfile are specified in the command line.
This commit is contained in:
parent
ce8a9becdf
commit
4a7a9f4dd2
@ -6320,11 +6320,8 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
|
|||||||
if (!EffectiveVolumeTrueCryptMode)
|
if (!EffectiveVolumeTrueCryptMode)
|
||||||
EffectiveVolumeTrueCryptMode = DefaultVolumeTrueCryptMode;
|
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
|
// 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;
|
BOOL reportBadPasswd = CmdVolumePassword.Length > 0;
|
||||||
|
|
||||||
@ -6337,6 +6334,11 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
|
|||||||
|
|
||||||
burn (&CmdVolumePassword, sizeof (CmdVolumePassword));
|
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)
|
if (FirstCmdKeyFile)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user