VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Main/UserInterface.cpp
diff options
context:
space:
mode:
authorLouisTakePILLz <LouisTakePILLz@users.noreply.github.com>2015-08-12 21:25:47 (GMT)
committerLouisTakePILLz <LouisTakePILLz@users.noreply.github.com>2015-08-30 23:45:01 (GMT)
commit9582d8fbcb57c0297aad3d4a05eac53f1c125cd3 (patch)
treeb7149525bbcb8903ced14b7077f614925decba59 /src/Main/UserInterface.cpp
parentba9af466624706ada9bff2d74a257c7fbedba5cc (diff)
downloadVeraCrypt-9582d8fbcb57c0297aad3d4a05eac53f1c125cd3.zip
VeraCrypt-9582d8fbcb57c0297aad3d4a05eac53f1c125cd3.tar.gz
Add stdin-supplied password supportrefs/pull/18/head
Diffstat (limited to 'src/Main/UserInterface.cpp')
-rw-r--r--src/Main/UserInterface.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/Main/UserInterface.cpp b/src/Main/UserInterface.cpp
index 6804866..070a49c 100644
--- a/src/Main/UserInterface.cpp
+++ b/src/Main/UserInterface.cpp
@@ -889,11 +889,19 @@ namespace VeraCrypt
{
CommandLineInterface &cmdLine = *CmdLine;
- switch (cmdLine.ArgCommand)
- {
- case CommandId::None:
+ if (cmdLine.ArgCommand == CommandId::None)
return false;
+ if (Preferences.UseStandardInput)
+ {
+ wstring pwdInput;
+ wcin >> pwdInput;
+
+ cmdLine.ArgPassword = make_shared<VolumePassword> (pwdInput);
+ }
+
+ switch (cmdLine.ArgCommand)
+ {
case CommandId::AutoMountDevices:
case CommandId::AutoMountFavorites:
case CommandId::AutoMountDevicesFavorites: