diff options
Diffstat (limited to 'src/Main/Forms')
-rw-r--r-- | src/Main/Forms/ChangePasswordDialog.cpp | 7 | ||||
-rw-r--r-- | src/Main/Forms/MountOptionsDialog.cpp | 6 | ||||
-rw-r--r-- | src/Main/Forms/VolumePasswordPanel.cpp | 10 | ||||
-rw-r--r-- | src/Main/Forms/VolumePasswordPanel.h | 1 |
4 files changed, 24 insertions, 0 deletions
diff --git a/src/Main/Forms/ChangePasswordDialog.cpp b/src/Main/Forms/ChangePasswordDialog.cpp index ac8e8147..5b2fdd04 100644 --- a/src/Main/Forms/ChangePasswordDialog.cpp +++ b/src/Main/Forms/ChangePasswordDialog.cpp | |||
@@ -24,6 +24,12 @@ namespace VeraCrypt | |||
24 | bool enableNewPassword = false; | 24 | bool enableNewPassword = false; |
25 | bool enableNewKeyfiles = false; | 25 | bool enableNewKeyfiles = false; |
26 | bool enablePkcs5Prf = false; | 26 | bool enablePkcs5Prf = false; |
27 | bool isTrueCryptFile = false; | ||
28 | |||
29 | if (volumePath && volumePath->HasTrueCryptExtension ()) | ||
30 | { | ||
31 | isTrueCryptFile = true; | ||
32 | } | ||
27 | 33 | ||
28 | switch (mode) | 34 | switch (mode) |
29 | { | 35 | { |
@@ -54,6 +60,7 @@ namespace VeraCrypt | |||
54 | 60 | ||
55 | CurrentPasswordPanel = new VolumePasswordPanel (this, NULL, password, false, keyfiles, false, true, true, false, true, true); | 61 | CurrentPasswordPanel = new VolumePasswordPanel (this, NULL, password, false, keyfiles, false, true, true, false, true, true); |
56 | CurrentPasswordPanel->UpdateEvent.Connect (EventConnector <ChangePasswordDialog> (this, &ChangePasswordDialog::OnPasswordPanelUpdate)); | 62 | CurrentPasswordPanel->UpdateEvent.Connect (EventConnector <ChangePasswordDialog> (this, &ChangePasswordDialog::OnPasswordPanelUpdate)); |
63 | CurrentPasswordPanel->SetTrueCryptMode (isTrueCryptFile); | ||
57 | CurrentPasswordPanelSizer->Add (CurrentPasswordPanel, 1, wxALL | wxEXPAND); | 64 | CurrentPasswordPanelSizer->Add (CurrentPasswordPanel, 1, wxALL | wxEXPAND); |
58 | 65 | ||
59 | NewPasswordPanel = new VolumePasswordPanel (this, NULL, newPassword, true, newKeyfiles, false, enableNewPassword, enableNewKeyfiles, enableNewPassword, enablePkcs5Prf); | 66 | 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 c6b47fd5..c7a853c2 100644 --- a/src/Main/Forms/MountOptionsDialog.cpp +++ b/src/Main/Forms/MountOptionsDialog.cpp | |||
@@ -36,6 +36,12 @@ namespace VeraCrypt | |||
36 | 36 | ||
37 | PasswordPanel = new VolumePasswordPanel (this, &options, options.Password, disableMountOptions, options.Keyfiles, !disableMountOptions, true, true, false, true, true); | 37 | PasswordPanel = new VolumePasswordPanel (this, &options, options.Password, disableMountOptions, options.Keyfiles, !disableMountOptions, true, true, false, true, true); |
38 | PasswordPanel->SetCacheCheckBoxValidator (wxGenericValidator (&Options.CachePassword)); | 38 | PasswordPanel->SetCacheCheckBoxValidator (wxGenericValidator (&Options.CachePassword)); |
39 | |||
40 | if (options.Path && options.Path->HasTrueCryptExtension() && !disableMountOptions | ||
41 | && !options.TrueCryptMode && (options.Pim <= 0)) | ||
42 | { | ||
43 | PasswordPanel->SetTrueCryptMode (true); | ||
44 | } | ||
39 | 45 | ||
40 | PasswordSizer->Add (PasswordPanel, 1, wxALL | wxEXPAND); | 46 | PasswordSizer->Add (PasswordPanel, 1, wxALL | wxEXPAND); |
41 | 47 | ||
diff --git a/src/Main/Forms/VolumePasswordPanel.cpp b/src/Main/Forms/VolumePasswordPanel.cpp index 920d4f96..3ec6aedb 100644 --- a/src/Main/Forms/VolumePasswordPanel.cpp +++ b/src/Main/Forms/VolumePasswordPanel.cpp | |||
@@ -306,6 +306,16 @@ namespace VeraCrypt | |||
306 | { | 306 | { |
307 | return TrueCryptModeCheckBox->GetValue (); | 307 | return TrueCryptModeCheckBox->GetValue (); |
308 | } | 308 | } |
309 | |||
310 | void VolumePasswordPanel::SetTrueCryptMode (bool trueCryptMode) | ||
311 | { | ||
312 | bool bEnablePIM = !trueCryptMode; | ||
313 | TrueCryptModeCheckBox->SetValue (trueCryptMode); | ||
314 | PimCheckBox->Enable (bEnablePIM); | ||
315 | VolumePimStaticText->Enable (bEnablePIM); | ||
316 | VolumePimTextCtrl->Enable (bEnablePIM); | ||
317 | VolumePimHelpStaticText->Enable (bEnablePIM); | ||
318 | } | ||
309 | 319 | ||
310 | int VolumePasswordPanel::GetHeaderWipeCount () const | 320 | int VolumePasswordPanel::GetHeaderWipeCount () const |
311 | { | 321 | { |
diff --git a/src/Main/Forms/VolumePasswordPanel.h b/src/Main/Forms/VolumePasswordPanel.h index e692d447..a3ed2a6f 100644 --- a/src/Main/Forms/VolumePasswordPanel.h +++ b/src/Main/Forms/VolumePasswordPanel.h | |||
@@ -32,6 +32,7 @@ namespace VeraCrypt | |||
32 | shared_ptr <Pkcs5Kdf> GetPkcs5Kdf (bool bTrueCryptMode, bool &bUnsupportedKdf) const; | 32 | shared_ptr <Pkcs5Kdf> GetPkcs5Kdf (bool bTrueCryptMode, bool &bUnsupportedKdf) const; |
33 | int GetVolumePim () const; | 33 | int GetVolumePim () const; |
34 | bool GetTrueCryptMode () const; | 34 | bool GetTrueCryptMode () const; |
35 | void SetTrueCryptMode (bool trueCryptMode); | ||
35 | int GetHeaderWipeCount () const; | 36 | int GetHeaderWipeCount () const; |
36 | void SetCacheCheckBoxValidator (const wxGenericValidator &validator) { CacheCheckBox->SetValidator (validator); } | 37 | void SetCacheCheckBoxValidator (const wxGenericValidator &validator) { CacheCheckBox->SetValidator (validator); } |
37 | void SetFocusToPasswordTextCtrl () { PasswordTextCtrl->SetSelection (-1, -1); PasswordTextCtrl->SetFocus(); } | 38 | void SetFocusToPasswordTextCtrl () { PasswordTextCtrl->SetSelection (-1, -1); PasswordTextCtrl->SetFocus(); } |