VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Main/TextUserInterface.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Main/TextUserInterface.cpp')
-rw-r--r--src/Main/TextUserInterface.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/Main/TextUserInterface.cpp b/src/Main/TextUserInterface.cpp
index 7e791035..32c34fd3 100644
--- a/src/Main/TextUserInterface.cpp
+++ b/src/Main/TextUserInterface.cpp
@@ -1058,6 +1058,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);
@@ -1074,6 +1081,14 @@ namespace VeraCrypt
StringConverter::ToSingle (wPassword, passwordStr);
}
+ virtual void notifyIncorrectPin ()
+ {
+ if (CmdLine->ArgTokenPin && CmdLine->ArgTokenPin->IsAllocated ())
+ {
+ CmdLine->ArgTokenPin->Free ();
+ }
+ }
+
const TextUserInterface *UI;
};