VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Main
diff options
context:
space:
mode:
Diffstat (limited to 'src/Main')
-rw-r--r--src/Main/CommandLineInterface.cpp6
-rw-r--r--src/Main/CommandLineInterface.h1
-rw-r--r--src/Main/Forms/EncryptionOptionsWizardPage.cpp6
-rw-r--r--src/Main/GraphicUserInterface.cpp27
-rw-r--r--src/Main/TextUserInterface.cpp15
5 files changed, 55 insertions, 0 deletions
diff --git a/src/Main/CommandLineInterface.cpp b/src/Main/CommandLineInterface.cpp
index 0a4f41b3..4d2f1387 100644
--- a/src/Main/CommandLineInterface.cpp
+++ b/src/Main/CommandLineInterface.cpp
@@ -89,6 +89,7 @@ namespace VeraCrypt
parser.AddSwitch (L"", L"test", _("Test internal algorithms"));
parser.AddSwitch (L"t", L"text", _("Use text user interface"));
parser.AddOption (L"", L"token-lib", _("Security token library"));
+ parser.AddOption (L"", L"token-pin", _("Security token PIN"));
parser.AddSwitch (L"v", L"verbose", _("Enable verbose output"));
parser.AddSwitch (L"", L"version", _("Display version information"));
parser.AddSwitch (L"", L"volume-properties", _("Display volume properties"));
@@ -593,6 +594,11 @@ namespace VeraCrypt
if (parser.Found (L"token-lib", &str))
Preferences.SecurityTokenModule = wstring (str);
+ if (parser.Found (L"token-pin", &str) && !str.IsEmpty ())
+ {
+ ArgTokenPin = ToUTF8Buffer (str.c_str(), str.Len ());
+ }
+
if (parser.Found (L"verbose"))
Preferences.Verbose = true;
diff --git a/src/Main/CommandLineInterface.h b/src/Main/CommandLineInterface.h
index 9bca2614..d7a18818 100644
--- a/src/Main/CommandLineInterface.h
+++ b/src/Main/CommandLineInterface.h
@@ -82,6 +82,7 @@ namespace VeraCrypt
VolumeInfoList ArgVolumes;
VolumeType::Enum ArgVolumeType;
bool ArgTrueCryptMode;
+ shared_ptr<SecureBuffer> ArgTokenPin;
bool StartBackgroundTask;
UserPreferences Preferences;
diff --git a/src/Main/Forms/EncryptionOptionsWizardPage.cpp b/src/Main/Forms/EncryptionOptionsWizardPage.cpp
index 5af01d02..f7216b80 100644
--- a/src/Main/Forms/EncryptionOptionsWizardPage.cpp
+++ b/src/Main/Forms/EncryptionOptionsWizardPage.cpp
@@ -78,6 +78,12 @@ namespace VeraCrypt
EncryptionAlgorithmStaticText->SetLabel (LangString["SERPENT_HELP"]);
else if (typeid (*ea) == typeid (Twofish))
EncryptionAlgorithmStaticText->SetLabel (LangString["TWOFISH_HELP"]);
+ else if (typeid (*ea) == typeid (Camellia))
+ EncryptionAlgorithmStaticText->SetLabel (LangString["CAMELLIA_HELP"]);
+ else if (typeid (*ea) == typeid (GOST89))
+ EncryptionAlgorithmStaticText->SetLabel (LangString["GOST89_HELP"]);
+ else if (typeid (*ea) == typeid (Kuznyechik))
+ EncryptionAlgorithmStaticText->SetLabel (LangString["KUZNYECHIK_HELP"]);
else
EncryptionAlgorithmStaticText->SetLabel (L"");
}
diff --git a/src/Main/GraphicUserInterface.cpp b/src/Main/GraphicUserInterface.cpp
index d15e7375..77a9524d 100644
--- a/src/Main/GraphicUserInterface.cpp
+++ b/src/Main/GraphicUserInterface.cpp
@@ -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
@@ -1144,6 +1159,18 @@ namespace VeraCrypt
{
url = L"https://veracrypt.codeplex.com/wikipage?title=Twofish";
}
+ else if (linkId == L"camellia")
+ {
+ url = L"https://veracrypt.codeplex.com/wikipage?title=Camellia";
+ }
+ else if (linkId == L"GOST89")
+ {
+ url = L"https://veracrypt.codeplex.com/wikipage?title=GOST89";
+ }
+ else if (linkId == L"Kuznyechik")
+ {
+ url = L"https://veracrypt.codeplex.com/wikipage?title=Kuznyechik";
+ }
else if (linkId == L"cascades")
{
url = L"https://veracrypt.codeplex.com/wikipage?title=Cascades";
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;
};