VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Format
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2016-05-28 23:30:53 (GMT)
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2016-05-28 23:33:18 (GMT)
commit99c4031d89ce4f72e3899b3cac660082a1820a48 (patch)
tree6fc381d9789326a6b132fd17e6cf9a6c3e1dc411 /src/Format
parenta0d8b8a3b78b1d0db50de2a7d841efaec2a55c36 (diff)
downloadVeraCrypt-99c4031d89ce4f72e3899b3cac660082a1820a48.zip
VeraCrypt-99c4031d89ce4f72e3899b3cac660082a1820a48.tar.gz
Windows: better implementation for support of smart card PIN in command line. Supported now also on Format.
Diffstat (limited to 'src/Format')
-rw-r--r--src/Format/Tcformat.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/Format/Tcformat.c b/src/Format/Tcformat.c
index 40c17d6..fc88888 100644
--- a/src/Format/Tcformat.c
+++ b/src/Format/Tcformat.c
@@ -51,6 +51,7 @@
#include "Volumes.h"
#include "Wipe.h"
#include "Xml.h"
+#include "SecurityToken.h"
#include <Strsafe.h>
@@ -8777,6 +8778,7 @@ void ExtractCommandLine (HWND hwndDlg, wchar_t *lpszCommandLine)
OptionNoIsoCheck,
OptionQuit,
OptionTokenLib,
+ OptionTokenPin,
CommandResumeSysEncLogOn,
CommandResumeSysEnc,
CommandDecryptSysEnc,
@@ -8806,6 +8808,7 @@ void ExtractCommandLine (HWND hwndDlg, wchar_t *lpszCommandLine)
{ OptionHistory, L"/history", L"/h", FALSE },
{ OptionNoIsoCheck, L"/noisocheck", L"/n", FALSE },
{ OptionTokenLib, L"/tokenlib", NULL, FALSE },
+ { OptionTokenPin, L"/tokenpin", NULL, FALSE },
{ OptionQuit, L"/quit", L"/q", FALSE },
{ OptionEncryption, L"/encryption", NULL , FALSE },
{ OptionFilesystem, L"/filesystem", NULL , FALSE },
@@ -9190,6 +9193,20 @@ void ExtractCommandLine (HWND hwndDlg, wchar_t *lpszCommandLine)
break;
+ case OptionTokenPin:
+ {
+ wchar_t szTmp[SecurityToken::MaxPasswordLength + 1] = {0};
+ if (GetArgumentValue (lpszCommandLineArgs, &i, nNoCommandLineArgs, szTmp, ARRAYSIZE (szTmp)) == HAS_ARGUMENT)
+ {
+ if (0 == WideCharToMultiByte (CP_UTF8, 0, szTmp, -1, CmdTokenPin, TC_MAX_PATH, nullptr, nullptr))
+ AbortProcess ("COMMAND_LINE_ERROR");
+ }
+ else
+ AbortProcess ("COMMAND_LINE_ERROR");
+ }
+
+ break;
+
case OptionQuit:
{
// Used to indicate non-install elevation