VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Main/Forms/ChangePasswordDialog.cpp
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2016-01-25 01:35:17 +0100
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2016-01-25 01:46:32 +0100
commitb8a2e808c693a59e236b98c3274019e5a25b3089 (patch)
tree27780023676d1de97ac4dea47b7b1390628a732a /src/Main/Forms/ChangePasswordDialog.cpp
parente9d3ba0b113433f634324d2c407fba3e825af1ce (diff)
downloadVeraCrypt-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/ChangePasswordDialog.cpp')
-rwxr-xr-x[-rw-r--r--]src/Main/Forms/ChangePasswordDialog.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/Main/Forms/ChangePasswordDialog.cpp b/src/Main/Forms/ChangePasswordDialog.cpp
index 9b69be0b..b3e0bd04 100644..100755
--- a/src/Main/Forms/ChangePasswordDialog.cpp
+++ b/src/Main/Forms/ChangePasswordDialog.cpp
@@ -92,6 +92,12 @@ namespace VeraCrypt
Gui->ShowWarning (LangString ["ALGO_NOT_SUPPORTED_FOR_TRUECRYPT_MODE"]);
return;
}
+ int currentPim = CurrentPasswordPanel->GetVolumePim();
+ if (-1 == currentPim)
+ {
+ CurrentPasswordPanel->SetFocusToPimTextCtrl();
+ return;
+ }
shared_ptr <VolumePassword> newPassword;
int newPim = 0;
@@ -108,6 +114,11 @@ namespace VeraCrypt
return;
}
newPim = NewPasswordPanel->GetVolumePim();
+ if (-1 == newPim)
+ {
+ NewPasswordPanel->SetFocusToPimTextCtrl();
+ return;
+ }
if (newPassword->Size() > 0)
{
@@ -224,6 +235,9 @@ namespace VeraCrypt
if (passwordEmpty && keyfilesEmpty)
ok = false;
+
+ if (CurrentPasswordPanel->GetVolumePim () == -1)
+ ok = false;
if (DialogMode == Mode::RemoveAllKeyfiles && (passwordEmpty || keyfilesEmpty))
ok = false;
@@ -237,7 +251,11 @@ namespace VeraCrypt
ok = false;
if (DialogMode == Mode::ChangePasswordAndKeyfiles
- && ((NewPasswordPanel->GetPassword()->IsEmpty() && newKeyfilesEmpty) || !NewPasswordPanel->PasswordsMatch()))
+ && ( (NewPasswordPanel->GetPassword()->IsEmpty() && newKeyfilesEmpty)
+ || !NewPasswordPanel->PasswordsMatch()
+ || (NewPasswordPanel->GetVolumePim() == -1)
+ )
+ )
ok = false;
}
}