diff options
Diffstat (limited to 'src/Main/TextUserInterface.cpp')
-rw-r--r-- | src/Main/TextUserInterface.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/Main/TextUserInterface.cpp b/src/Main/TextUserInterface.cpp index 902f4616..035e458e 100644 --- a/src/Main/TextUserInterface.cpp +++ b/src/Main/TextUserInterface.cpp @@ -1053,6 +1053,13 @@ namespace VeraCrypt virtual void operator() (string &passwordStr) { + if (CmdLine->ArgTokenPin && CmdLine->ArgTokenPin->IsAllocated ()) + { + passwordStr.clear(); + passwordStr.insert (0, (char*) CmdLine->ArgTokenPin->Ptr (), CmdLine->ArgTokenPin->Size()); + return; + } + if (UI->GetPreferences().NonInteractive) throw MissingArgument (SRC_POS); @@ -1069,6 +1076,14 @@ namespace VeraCrypt StringConverter::ToSingle (wPassword, passwordStr); } + virtual void notifyIncorrectPin () + { + if (CmdLine->ArgTokenPin && CmdLine->ArgTokenPin->IsAllocated ()) + { + CmdLine->ArgTokenPin->Free (); + } + } + const TextUserInterface *UI; }; |