mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2025-11-11 11:08:02 -06:00
Linux/MacOSX: Implement passing smart card PIN as command line argument (--token-pin switch)
This commit is contained in:
@@ -537,6 +537,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 (Gui->GetPreferences().NonInteractive)
|
||||
throw MissingArgument (SRC_POS);
|
||||
|
||||
@@ -563,6 +570,14 @@ namespace VeraCrypt
|
||||
|
||||
StringConverter::ToSingle (wPassword, passwordStr);
|
||||
}
|
||||
|
||||
virtual void notifyIncorrectPin ()
|
||||
{
|
||||
if (CmdLine->ArgTokenPin && CmdLine->ArgTokenPin->IsAllocated ())
|
||||
{
|
||||
CmdLine->ArgTokenPin->Free ();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
struct WarningHandler : public SendExceptionFunctor
|
||||
|
||||
Reference in New Issue
Block a user