VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Main/GraphicUserInterface.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Main/GraphicUserInterface.cpp')
-rw-r--r--[-rwxr-xr-x]src/Main/GraphicUserInterface.cpp80
1 files changed, 51 insertions, 29 deletions
diff --git a/src/Main/GraphicUserInterface.cpp b/src/Main/GraphicUserInterface.cpp
index b7b4cf45..16db8f83 100755..100644
--- a/src/Main/GraphicUserInterface.cpp
+++ b/src/Main/GraphicUserInterface.cpp
@@ -58,7 +58,7 @@ namespace VeraCrypt
#ifdef TC_MACOSX
g_customIdCmdV = wxNewId();
g_customIdCmdA = wxNewId();
- wxApp::s_macHelpMenuTitleName = _("&Help");
+ wxApp::s_macHelpMenuTitleName = LangString["MENU_HELP"];
#endif
}
@@ -191,8 +191,8 @@ namespace VeraCrypt
options->Password,
options->Pim,
options->Kdf,
- false,
options->Keyfiles,
+ options->EMVSupportEnabled,
options->Protection,
options->ProtectionPassword,
options->ProtectionPim,
@@ -219,8 +219,8 @@ namespace VeraCrypt
options->Password,
options->Pim,
options->Kdf,
- false,
options->Keyfiles,
+ options->EMVSupportEnabled,
options->Protection,
options->ProtectionPassword,
options->ProtectionPim,
@@ -315,7 +315,7 @@ namespace VeraCrypt
// Re-encrypt volume header
SecureBuffer newHeaderBuffer (normalVolume->GetLayout()->GetHeaderSize());
- ReEncryptHeaderThreadRoutine routine(newHeaderBuffer, normalVolume->GetHeader(), normalVolumeMountOptions.Password, normalVolumeMountOptions.Pim, normalVolumeMountOptions.Keyfiles);
+ ReEncryptHeaderThreadRoutine routine(newHeaderBuffer, normalVolume->GetHeader(), normalVolumeMountOptions.Password, normalVolumeMountOptions.Pim, normalVolumeMountOptions.Keyfiles, normalVolumeMountOptions.EMVSupportEnabled);
ExecuteWaitThreadRoutine (parent, &routine);
@@ -324,7 +324,7 @@ namespace VeraCrypt
if (hiddenVolume)
{
// Re-encrypt hidden volume header
- ReEncryptHeaderThreadRoutine hiddenRoutine(newHeaderBuffer, hiddenVolume->GetHeader(), hiddenVolumeMountOptions.Password, hiddenVolumeMountOptions.Pim, hiddenVolumeMountOptions.Keyfiles);
+ ReEncryptHeaderThreadRoutine hiddenRoutine(newHeaderBuffer, hiddenVolume->GetHeader(), hiddenVolumeMountOptions.Password, hiddenVolumeMountOptions.Pim, hiddenVolumeMountOptions.Keyfiles, hiddenVolumeMountOptions.EMVSupportEnabled);
ExecuteWaitThreadRoutine (parent, &hiddenRoutine);
}
@@ -344,7 +344,7 @@ namespace VeraCrypt
void GraphicUserInterface::BeginInteractiveBusyState (wxWindow *window)
{
- static auto_ptr <wxCursor> arrowWaitCursor;
+ static unique_ptr <wxCursor> arrowWaitCursor;
if (arrowWaitCursor.get() == nullptr)
arrowWaitCursor.reset (new wxCursor (wxCURSOR_ARROWWAIT));
@@ -409,7 +409,7 @@ namespace VeraCrypt
void GraphicUserInterface::EndInteractiveBusyState (wxWindow *window) const
{
- static auto_ptr <wxCursor> arrowCursor;
+ static unique_ptr <wxCursor> arrowCursor;
if (arrowCursor.get() == nullptr)
arrowCursor.reset (new wxCursor (wxCURSOR_ARROW));
@@ -466,7 +466,7 @@ namespace VeraCrypt
}
else
{
- wxPasswordEntryDialog dialog (Gui->GetActiveWindow(), _("Enter your user password or administrator password:"), _("Administrator privileges required"));
+ wxPasswordEntryDialog dialog (Gui->GetActiveWindow(), LangString["LINUX_ADMIN_PW_QUERY"], LangString["LINUX_ADMIN_PW_QUERY_TITLE"]);
if (dialog.ShowModal() != wxID_OK)
throw UserAbort (SRC_POS);
sValue = dialog.GetValue();
@@ -632,7 +632,7 @@ namespace VeraCrypt
try
{
- SecurityToken::InitLibrary (Preferences.SecurityTokenModule, auto_ptr <GetPinFunctor> (new PinRequestHandler), auto_ptr <SendExceptionFunctor> (new WarningHandler));
+ SecurityToken::InitLibrary (Preferences.SecurityTokenModule, unique_ptr <GetPinFunctor> (new PinRequestHandler), unique_ptr <SendExceptionFunctor> (new WarningHandler));
}
catch (Exception &e)
{
@@ -677,11 +677,21 @@ namespace VeraCrypt
return true;
}
- void GraphicUserInterface::ListSecurityTokenKeyfiles () const
+ void GraphicUserInterface::ListTokenKeyfiles () const
{
SecurityTokenKeyfilesDialog dialog (nullptr);
dialog.ShowModal();
}
+ void GraphicUserInterface::ListSecurityTokenKeyfiles () const
+ {
+ SecurityTokenKeyfilesDialog dialog (nullptr);
+ dialog.ShowModal();
+ }
+ void GraphicUserInterface::ListEMVTokenKeyfiles () const
+ {
+ SecurityTokenKeyfilesDialog dialog (nullptr);
+ dialog.ShowModal();
+ }
#ifdef TC_MACOSX
void GraphicUserInterface::MacOpenFiles (const wxArrayString &fileNames)
@@ -823,7 +833,7 @@ namespace VeraCrypt
options.Keyfiles = make_shared <KeyfileList> (GetPreferences().DefaultKeyfiles);
if ((options.Password && !options.Password->IsEmpty())
- || (options.Keyfiles && !options.Keyfiles->empty() && (options.TrueCryptMode || options.Password)))
+ || (options.Keyfiles && !options.Keyfiles->empty() && options.Password))
{
try
{
@@ -885,7 +895,7 @@ namespace VeraCrypt
#ifdef TC_LINUX
if (volume && !Preferences.NonInteractive && !Preferences.DisableKernelEncryptionModeWarning
&& volume->EncryptionModeName != L"XTS"
- && !AskYesNo (LangString["ENCRYPTION_MODE_NOT_SUPPORTED_BY_KERNEL"] + _("\n\nDo you want to show this message next time you mount such a volume?"), true, true))
+ && !AskYesNo (LangString["ENCRYPTION_MODE_NOT_SUPPORTED_BY_KERNEL"] + LangString["LINUX_MESSAGE_ON_MOUNT_AGAIN"], true, true))
{
UserPreferences prefs = GetPreferences();
prefs.DisableKernelEncryptionModeWarning = true;
@@ -965,8 +975,8 @@ namespace VeraCrypt
wxConnectionBase *OnMakeConnection () { return new Connection; }
};
- auto_ptr <wxDDEClient> client (new Client);
- auto_ptr <wxConnectionBase> connection (client->MakeConnection (L"localhost", serverName, L"raise"));
+ unique_ptr <wxDDEClient> client (new Client);
+ unique_ptr <wxConnectionBase> connection (client->MakeConnection (L"localhost", serverName, L"raise"));
if (connection.get() && connection->Execute (nullptr))
{
@@ -986,7 +996,7 @@ namespace VeraCrypt
if (write (showFifo, buf, 1) == 1)
{
close (showFifo);
- Gui->ShowInfo (_("VeraCrypt is already running."));
+ Gui->ShowInfo (LangString["LINUX_VC_RUNNING_ALREADY"]);
Application::SetExitCode (0);
return false;
}
@@ -1018,7 +1028,7 @@ namespace VeraCrypt
wxLog::FlushActive();
Application::SetExitCode (1);
- Gui->ShowInfo (_("VeraCrypt is already running."));
+ Gui->ShowInfo (LangString["LINUX_VC_RUNNING_ALREADY"]);
return false;
#endif
}
@@ -1317,7 +1327,14 @@ namespace VeraCrypt
{
/* check if local file exists */
wxFileName htmlFile = htmlPath + url;
- htmlFile.Normalize();
+ htmlFile.Normalize (
+ wxPATH_NORM_ENV_VARS |
+ wxPATH_NORM_DOTS |
+ wxPATH_NORM_CASE |
+ wxPATH_NORM_LONG |
+ wxPATH_NORM_SHORTCUT |
+ wxPATH_NORM_TILDE
+ );
localFile = htmlFile.FileExists();
}
@@ -1447,8 +1464,8 @@ namespace VeraCrypt
options.Password,
options.Pim,
options.Kdf,
- options.TrueCryptMode,
options.Keyfiles,
+ options.EMVSupportEnabled,
options.Protection,
options.ProtectionPassword,
options.ProtectionPim,
@@ -1481,7 +1498,7 @@ namespace VeraCrypt
// Re-encrypt volume header
wxBusyCursor busy;
SecureBuffer newHeaderBuffer (volume->GetLayout()->GetHeaderSize());
- ReEncryptHeaderThreadRoutine routine(newHeaderBuffer, volume->GetHeader(), options.Password, options.Pim, options.Keyfiles);
+ ReEncryptHeaderThreadRoutine routine(newHeaderBuffer, volume->GetHeader(), options.Password, options.Pim, options.Keyfiles, options.EMVSupportEnabled);
ExecuteWaitThreadRoutine (parent, &routine);
@@ -1562,12 +1579,12 @@ namespace VeraCrypt
backupFile.ReadAt (headerBuffer, layout->GetType() == VolumeType::Hidden ? layout->GetHeaderSize() : 0);
// Decrypt header
- shared_ptr <VolumePassword> passwordKey = Keyfile::ApplyListToPassword (options.Keyfiles, options.Password);
- Pkcs5KdfList keyDerivationFunctions = layout->GetSupportedKeyDerivationFunctions(options.TrueCryptMode);
+ shared_ptr <VolumePassword> passwordKey = Keyfile::ApplyListToPassword (options.Keyfiles, options.Password, options.EMVSupportEnabled);
+ Pkcs5KdfList keyDerivationFunctions = layout->GetSupportedKeyDerivationFunctions();
EncryptionAlgorithmList encryptionAlgorithms = layout->GetSupportedEncryptionAlgorithms();
EncryptionModeList encryptionModes = layout->GetSupportedEncryptionModes();
- DecryptThreadRoutine decryptRoutine(layout->GetHeader(), headerBuffer, *passwordKey, options.Pim, options.Kdf, options.TrueCryptMode, keyDerivationFunctions, encryptionAlgorithms, encryptionModes);
+ DecryptThreadRoutine decryptRoutine(layout->GetHeader(), headerBuffer, *passwordKey, options.Pim, options.Kdf, keyDerivationFunctions, encryptionAlgorithms, encryptionModes);
ExecuteWaitThreadRoutine (parent, &decryptRoutine);
@@ -1596,7 +1613,7 @@ namespace VeraCrypt
// Re-encrypt volume header
wxBusyCursor busy;
SecureBuffer newHeaderBuffer (decryptedLayout->GetHeaderSize());
- ReEncryptHeaderThreadRoutine routine(newHeaderBuffer, decryptedLayout->GetHeader(), options.Password, options.Pim, options.Keyfiles);
+ ReEncryptHeaderThreadRoutine routine(newHeaderBuffer, decryptedLayout->GetHeader(), options.Password, options.Pim, options.Keyfiles, options.EMVSupportEnabled);
ExecuteWaitThreadRoutine (parent, &routine);
@@ -1612,7 +1629,7 @@ namespace VeraCrypt
if (decryptedLayout->HasBackupHeader())
{
// Re-encrypt backup volume header
- ReEncryptHeaderThreadRoutine backupRoutine(newHeaderBuffer, decryptedLayout->GetHeader(), options.Password, options.Pim, options.Keyfiles);
+ ReEncryptHeaderThreadRoutine backupRoutine(newHeaderBuffer, decryptedLayout->GetHeader(), options.Password, options.Pim, options.Keyfiles, options.EMVSupportEnabled);
ExecuteWaitThreadRoutine (parent, &backupRoutine);
@@ -1754,6 +1771,10 @@ namespace VeraCrypt
}
BackgroundMode = state;
+
+#ifdef HAVE_INDICATORS
+ gtk_menu_item_set_label ((GtkMenuItem*) ((MainFrame*) mMainFrame)->indicator_item_showhide, LangString[Gui->IsInBackgroundMode() ? "SHOW_TC" : "HIDE_TC"].mb_str());
+#endif
}
void GraphicUserInterface::SetListCtrlColumnWidths (wxListCtrl *listCtrl, list <int> columnWidthPermilles, bool hasVerticalScrollbar) const
@@ -1887,9 +1908,9 @@ namespace VeraCrypt
else
{
if (style & wxICON_EXCLAMATION)
- caption = wxString (_("Warning")) + L':';
+ caption = wxString (LangString["LINUX_WARNING"]) + L':';
else if (style & wxICON_ERROR || style & wxICON_HAND)
- caption = wxString (_("Error")) + L':';
+ caption = wxString (LangString["LINUX_ERROR"]) + L':';
else
caption.clear();
}
@@ -1907,8 +1928,9 @@ namespace VeraCrypt
style |= wxSTAY_ON_TOP;
}
-
- return wxMessageBox (subMessage, caption, style, GetActiveWindow());
+ wxMessageDialog cur(GetActiveWindow(), subMessage, caption, style);
+ cur.SetYesNoLabels(LangString["UISTR_YES"], LangString["UISTR_NO"]);
+ return (cur.ShowModal() == wxID_YES ? wxYES : wxNO) ;
}
}
@@ -1923,7 +1945,7 @@ namespace VeraCrypt
void GraphicUserInterface::ThrowTextModeRequired () const
{
- Gui->ShowError (_("This feature is currently supported only in text mode."));
+ Gui->ShowError (LangString["LINUX_ONLY_TEXTMODE"]);
throw UserAbort (SRC_POS);
}