VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Format/Tcformat.c
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2016-05-29 01:30:53 +0200
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2016-05-29 01:33:18 +0200
commit99c4031d89ce4f72e3899b3cac660082a1820a48 (patch)
tree6fc381d9789326a6b132fd17e6cf9a6c3e1dc411 /src/Format/Tcformat.c
parenta0d8b8a3b78b1d0db50de2a7d841efaec2a55c36 (diff)
downloadVeraCrypt-99c4031d89ce4f72e3899b3cac660082a1820a48.tar.gz
VeraCrypt-99c4031d89ce4f72e3899b3cac660082a1820a48.zip
Windows: better implementation for support of smart card PIN in command line. Supported now also on Format.
Diffstat (limited to 'src/Format/Tcformat.c')
-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 40c17d66..fc888886 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