diff options
author | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2016-01-25 01:35:17 +0100 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2016-01-25 01:46:32 +0100 |
commit | b8a2e808c693a59e236b98c3274019e5a25b3089 (patch) | |
tree | 27780023676d1de97ac4dea47b7b1390628a732a /src/Main/Forms/MountOptionsDialog.cpp | |
parent | e9d3ba0b113433f634324d2c407fba3e825af1ce (diff) | |
download | VeraCrypt-b8a2e808c693a59e236b98c3274019e5a25b3089.tar.gz VeraCrypt-b8a2e808c693a59e236b98c3274019e5a25b3089.zip |
MacOSX: Add PIM value validity checks to workaround wxWidget bug that makes wxTextValidator useless when applied to a text control with password attribute (http://trac.wxwidgets.org/ticket/17185).
Diffstat (limited to 'src/Main/Forms/MountOptionsDialog.cpp')
-rwxr-xr-x[-rw-r--r--] | src/Main/Forms/MountOptionsDialog.cpp | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/src/Main/Forms/MountOptionsDialog.cpp b/src/Main/Forms/MountOptionsDialog.cpp index 14198e68..207d2479 100644..100755 --- a/src/Main/Forms/MountOptionsDialog.cpp +++ b/src/Main/Forms/MountOptionsDialog.cpp @@ -87,6 +87,25 @@ namespace VeraCrypt void MountOptionsDialog::OnOKButtonClick (wxCommandEvent& event) { bool bUnsupportedKdf = false; + + /* verify that PIM values are valid before continuing*/ + int Pim = PasswordPanel->GetVolumePim(); + int ProtectionPim = (!ReadOnlyCheckBox->IsChecked() && ProtectionCheckBox->IsChecked())? + ProtectionPasswordPanel->GetVolumePim() : 0; + + /* invalid PIM: set focus to PIM field and stop processing */ + if (-1 == Pim) + { + PasswordPanel->SetFocusToPimTextCtrl(); + return; + } + + if (-1 == ProtectionPim) + { + ProtectionPasswordPanel->SetFocusToPimTextCtrl(); + return; + } + TransferDataFromWindow(); try @@ -98,7 +117,7 @@ namespace VeraCrypt Gui->ShowWarning (e); return; } - Options.Pim = PasswordPanel->GetVolumePim(); + Options.Pim = Pim; Options.Kdf = PasswordPanel->GetPkcs5Kdf(bUnsupportedKdf); if (bUnsupportedKdf) { @@ -124,7 +143,7 @@ namespace VeraCrypt return; } Options.Protection = VolumeProtection::HiddenVolumeReadOnly; - Options.ProtectionPim = ProtectionPasswordPanel->GetVolumePim(); + Options.ProtectionPim = ProtectionPim; Options.ProtectionKdf = ProtectionPasswordPanel->GetPkcs5Kdf(Options.TrueCryptMode, bUnsupportedKdf); if (bUnsupportedKdf) { |