VeraCrypt
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2019-09-24 22:04:23 +0200
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2019-09-24 22:06:44 +0200
commitc8beacbdd70c29f9c4a38c43c52c557b30d37fe2 (patch)
treec354b3fc13343d7e800d2b8c39873c11d0facd18
parent89a8b0c2625f3d016d0754ab280212efa8929f43 (diff)
downloadVeraCrypt-c8beacbdd70c29f9c4a38c43c52c557b30d37fe2.tar.gz
VeraCrypt-c8beacbdd70c29f9c4a38c43c52c557b30d37fe2.zip
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.
-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 61b8b8a6..b5263c45 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)
{