VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Main/Forms/ChangePasswordDialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Main/Forms/ChangePasswordDialog.cpp')
-rw-r--r--src/Main/Forms/ChangePasswordDialog.cpp48
1 files changed, 25 insertions, 23 deletions
diff --git a/src/Main/Forms/ChangePasswordDialog.cpp b/src/Main/Forms/ChangePasswordDialog.cpp
index 2f8e1e47..397ee693 100644
--- a/src/Main/Forms/ChangePasswordDialog.cpp
+++ b/src/Main/Forms/ChangePasswordDialog.cpp
@@ -18,18 +18,23 @@
namespace VeraCrypt
{
+#ifdef TC_MACOSX
+
+ bool ChangePasswordDialog::ProcessEvent(wxEvent& event)
+ {
+ if(GraphicUserInterface::HandlePasswordEntryCustomEvent (event))
+ return true;
+ else
+ return ChangePasswordDialogBase::ProcessEvent(event);
+ }
+#endif
+
ChangePasswordDialog::ChangePasswordDialog (wxWindow* parent, shared_ptr <VolumePath> volumePath, Mode::Enum mode, shared_ptr <VolumePassword> password, shared_ptr <KeyfileList> keyfiles, shared_ptr <VolumePassword> newPassword, shared_ptr <KeyfileList> newKeyfiles)
: ChangePasswordDialogBase (parent), DialogMode (mode), Path (volumePath)
{
bool enableNewPassword = false;
bool enableNewKeyfiles = false;
bool enablePkcs5Prf = false;
- bool isTrueCryptFile = false;
-
- if (volumePath && volumePath->HasTrueCryptExtension ())
- {
- isTrueCryptFile = true;
- }
switch (mode)
{
@@ -37,33 +42,36 @@ namespace VeraCrypt
enableNewPassword = true;
enableNewKeyfiles = true;
enablePkcs5Prf = true;
- SetTitle (_("Change Volume Password and Keyfiles"));
+ SetTitle (LangString["IDD_PASSWORDCHANGE_DLG"]);
break;
case Mode::ChangeKeyfiles:
enableNewKeyfiles = true;
- SetTitle (_("Add/Remove Keyfiles to/from Volume"));
+ SetTitle (LangString["IDD_PCDM_ADD_REMOVE_VOL_KEYFILES"]);
break;
case Mode::RemoveAllKeyfiles:
- SetTitle (_("Remove All Keyfiles from Volume"));
+ SetTitle (LangString["IDD_PCDM_REMOVE_ALL_KEYFILES_FROM_VOL"]);
break;
case Mode::ChangePkcs5Prf:
enablePkcs5Prf = true;
- SetTitle (_("Change Header Key Derivation Algorithm"));
+ SetTitle (LangString["IDD_PCDM_CHANGE_PKCS5_PRF"]);
break;
default:
throw ParameterIncorrect (SRC_POS);
}
+
+#ifdef TC_MACOSX
+ GraphicUserInterface::InstallPasswordEntryCustomKeyboardShortcuts (this);
+#endif
- CurrentPasswordPanel = new VolumePasswordPanel (this, NULL, password, false, keyfiles, false, true, true, false, true, true);
+ CurrentPasswordPanel = new VolumePasswordPanel (this, NULL, password, keyfiles, false, true, true, false, true, true);
CurrentPasswordPanel->UpdateEvent.Connect (EventConnector <ChangePasswordDialog> (this, &ChangePasswordDialog::OnPasswordPanelUpdate));
- CurrentPasswordPanel->SetTrueCryptMode (isTrueCryptFile);
CurrentPasswordPanelSizer->Add (CurrentPasswordPanel, 1, wxALL | wxEXPAND);
- NewPasswordPanel = new VolumePasswordPanel (this, NULL, newPassword, true, newKeyfiles, false, enableNewPassword, enableNewKeyfiles, enableNewPassword, enablePkcs5Prf);
+ NewPasswordPanel = new VolumePasswordPanel (this, NULL, newPassword, newKeyfiles, false, enableNewPassword, enableNewKeyfiles, enableNewPassword, enablePkcs5Prf);
NewPasswordPanel->UpdateEvent.Connect (EventConnector <ChangePasswordDialog> (this, &ChangePasswordDialog::OnPasswordPanelUpdate));
NewPasswordPanelSizer->Add (NewPasswordPanel, 1, wxALL | wxEXPAND);
@@ -92,13 +100,7 @@ namespace VeraCrypt
try
{
- bool bUnsupportedKdf = false;
- shared_ptr <Pkcs5Kdf> currentKdf = CurrentPasswordPanel->GetPkcs5Kdf(bUnsupportedKdf);
- if (bUnsupportedKdf)
- {
- Gui->ShowWarning (LangString ["ALGO_NOT_SUPPORTED_FOR_TRUECRYPT_MODE"]);
- return;
- }
+ shared_ptr <Pkcs5Kdf> currentKdf = CurrentPasswordPanel->GetPkcs5Kdf();
int currentPim = CurrentPasswordPanel->GetVolumePim();
if (-1 == currentPim)
{
@@ -167,7 +169,7 @@ namespace VeraCrypt
/* force the display of the random enriching interface */
RandomNumberGenerator::SetEnrichedByUserStatus (false);
- Gui->UserEnrichRandomPool (this, NewPasswordPanel->GetPkcs5Kdf(bUnsupportedKdf) ? NewPasswordPanel->GetPkcs5Kdf(bUnsupportedKdf)->GetHash() : shared_ptr <Hash>());
+ Gui->UserEnrichRandomPool (this, NewPasswordPanel->GetPkcs5Kdf() ? NewPasswordPanel->GetPkcs5Kdf()->GetHash() : shared_ptr <Hash>());
{
#ifdef TC_UNIX
@@ -188,8 +190,8 @@ namespace VeraCrypt
#endif
wxBusyCursor busy;
ChangePasswordThreadRoutine routine(Path, Gui->GetPreferences().DefaultMountOptions.PreserveTimestamps,
- CurrentPasswordPanel->GetPassword(), CurrentPasswordPanel->GetVolumePim(), CurrentPasswordPanel->GetPkcs5Kdf(bUnsupportedKdf), CurrentPasswordPanel->GetTrueCryptMode(),CurrentPasswordPanel->GetKeyfiles(),
- newPassword, newPim, newKeyfiles, NewPasswordPanel->GetPkcs5Kdf(bUnsupportedKdf), NewPasswordPanel->GetHeaderWipeCount());
+ CurrentPasswordPanel->GetPassword(), CurrentPasswordPanel->GetVolumePim(), CurrentPasswordPanel->GetPkcs5Kdf(), CurrentPasswordPanel->GetKeyfiles(),
+ newPassword, newPim, newKeyfiles, NewPasswordPanel->GetPkcs5Kdf(), NewPasswordPanel->GetHeaderWipeCount(), Gui->GetPreferences().EMVSupportEnabled);
Gui->ExecuteWaitThreadRoutine (this, &routine);
}