VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Main
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2019-09-24 20:04:23 (GMT)
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2019-09-24 20:06:44 (GMT)
commitc8beacbdd70c29f9c4a38c43c52c557b30d37fe2 (patch)
treec354b3fc13343d7e800d2b8c39873c11d0facd18 /src/Main
parent89a8b0c2625f3d016d0754ab280212efa8929f43 (diff)
downloadVeraCrypt-c8beacbdd70c29f9c4a38c43c52c557b30d37fe2.zip
VeraCrypt-c8beacbdd70c29f9c4a38c43c52c557b30d37fe2.tar.gz
Linux/OSX: make CLI switch --import-token-keyfiles compatible with Non-Interactive
mode by using keyfiles passed as arguments and check the Non-Interactive mode switch.
Diffstat (limited to 'src/Main')
-rw-r--r--src/Main/TextUserInterface.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/Main/TextUserInterface.cpp b/src/Main/TextUserInterface.cpp
index 61b8b8a..b5263c4 100644
--- a/src/Main/TextUserInterface.cpp
+++ b/src/Main/TextUserInterface.cpp
@@ -1056,9 +1056,18 @@ namespace VeraCrypt
slotId = (CK_SLOT_ID) AskSelection (tokens.back().SlotId, tokens.front().SlotId);
}
- shared_ptr <KeyfileList> keyfiles = AskKeyfiles();
- if (keyfiles->empty())
- throw UserAbort();
+ shared_ptr <KeyfileList> keyfiles;
+
+ if (CmdLine->ArgKeyfiles.get() && !CmdLine->ArgKeyfiles->empty())
+ keyfiles = CmdLine->ArgKeyfiles;
+ else if (!Preferences.NonInteractive)
+ {
+ keyfiles = AskKeyfiles();
+ if (keyfiles->empty())
+ throw UserAbort();
+ }
+ else
+ throw MissingArgument (SRC_POS);
foreach_ref (const Keyfile &keyfilePath, *keyfiles)
{