VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Main/Forms
diff options
context:
space:
mode:
Diffstat (limited to 'src/Main/Forms')
-rw-r--r--src/Main/Forms/ChangePasswordDialog.cpp7
-rw-r--r--src/Main/Forms/MountOptionsDialog.cpp6
-rw-r--r--src/Main/Forms/VolumePasswordPanel.cpp10
-rw-r--r--src/Main/Forms/VolumePasswordPanel.h1
4 files changed, 24 insertions, 0 deletions
diff --git a/src/Main/Forms/ChangePasswordDialog.cpp b/src/Main/Forms/ChangePasswordDialog.cpp
index ac8e814..5b2fdd0 100644
--- a/src/Main/Forms/ChangePasswordDialog.cpp
+++ b/src/Main/Forms/ChangePasswordDialog.cpp
@@ -24,6 +24,12 @@ namespace VeraCrypt
bool enableNewPassword = false;
bool enableNewKeyfiles = false;
bool enablePkcs5Prf = false;
+ bool isTrueCryptFile = false;
+
+ if (volumePath && volumePath->HasTrueCryptExtension ())
+ {
+ isTrueCryptFile = true;
+ }
switch (mode)
{
@@ -54,6 +60,7 @@ namespace VeraCrypt
CurrentPasswordPanel = new VolumePasswordPanel (this, NULL, password, false, 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);
diff --git a/src/Main/Forms/MountOptionsDialog.cpp b/src/Main/Forms/MountOptionsDialog.cpp
index c6b47fd..c7a853c 100644
--- a/src/Main/Forms/MountOptionsDialog.cpp
+++ b/src/Main/Forms/MountOptionsDialog.cpp
@@ -36,6 +36,12 @@ namespace VeraCrypt
PasswordPanel = new VolumePasswordPanel (this, &options, options.Password, disableMountOptions, options.Keyfiles, !disableMountOptions, true, true, false, true, true);
PasswordPanel->SetCacheCheckBoxValidator (wxGenericValidator (&Options.CachePassword));
+
+ if (options.Path && options.Path->HasTrueCryptExtension() && !disableMountOptions
+ && !options.TrueCryptMode && (options.Pim <= 0))
+ {
+ PasswordPanel->SetTrueCryptMode (true);
+ }
PasswordSizer->Add (PasswordPanel, 1, wxALL | wxEXPAND);
diff --git a/src/Main/Forms/VolumePasswordPanel.cpp b/src/Main/Forms/VolumePasswordPanel.cpp
index 920d4f9..3ec6aed 100644
--- a/src/Main/Forms/VolumePasswordPanel.cpp
+++ b/src/Main/Forms/VolumePasswordPanel.cpp
@@ -306,6 +306,16 @@ namespace VeraCrypt
{
return TrueCryptModeCheckBox->GetValue ();
}
+
+ void VolumePasswordPanel::SetTrueCryptMode (bool trueCryptMode)
+ {
+ bool bEnablePIM = !trueCryptMode;
+ TrueCryptModeCheckBox->SetValue (trueCryptMode);
+ PimCheckBox->Enable (bEnablePIM);
+ VolumePimStaticText->Enable (bEnablePIM);
+ VolumePimTextCtrl->Enable (bEnablePIM);
+ VolumePimHelpStaticText->Enable (bEnablePIM);
+ }
int VolumePasswordPanel::GetHeaderWipeCount () const
{
diff --git a/src/Main/Forms/VolumePasswordPanel.h b/src/Main/Forms/VolumePasswordPanel.h
index e692d44..a3ed2a6 100644
--- a/src/Main/Forms/VolumePasswordPanel.h
+++ b/src/Main/Forms/VolumePasswordPanel.h
@@ -32,6 +32,7 @@ namespace VeraCrypt
shared_ptr <Pkcs5Kdf> GetPkcs5Kdf (bool bTrueCryptMode, bool &bUnsupportedKdf) const;
int GetVolumePim () const;
bool GetTrueCryptMode () const;
+ void SetTrueCryptMode (bool trueCryptMode);
int GetHeaderWipeCount () const;
void SetCacheCheckBoxValidator (const wxGenericValidator &validator) { CacheCheckBox->SetValidator (validator); }
void SetFocusToPasswordTextCtrl () { PasswordTextCtrl->SetSelection (-1, -1); PasswordTextCtrl->SetFocus(); }