From 9582d8fbcb57c0297aad3d4a05eac53f1c125cd3 Mon Sep 17 00:00:00 2001 From: LouisTakePILLz Date: Wed, 12 Aug 2015 17:25:47 -0400 Subject: Add stdin-supplied password support --- src/Main/UserInterface.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/Main/UserInterface.cpp') 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 (pwdInput); + } + + switch (cmdLine.ArgCommand) + { case CommandId::AutoMountDevices: case CommandId::AutoMountFavorites: case CommandId::AutoMountDevicesFavorites: -- cgit v1.2.3