VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Main/UserInterface.cpp
diff options
context:
space:
mode:
authorLouisTakePILLz <LouisTakePILLz@users.noreply.github.com>2015-08-12 17:25:47 -0400
committerLouisTakePILLz <LouisTakePILLz@users.noreply.github.com>2015-08-30 19:45:01 -0400
commit9582d8fbcb57c0297aad3d4a05eac53f1c125cd3 (patch)
treeb7149525bbcb8903ced14b7077f614925decba59 /src/Main/UserInterface.cpp
parentba9af466624706ada9bff2d74a257c7fbedba5cc (diff)
downloadVeraCrypt-9582d8fbcb57c0297aad3d4a05eac53f1c125cd3.tar.gz
VeraCrypt-9582d8fbcb57c0297aad3d4a05eac53f1c125cd3.zip
Add stdin-supplied password support
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 68048663..070a49c1 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: