diff options
author | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2015-11-30 11:35:41 +0100 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2015-11-30 13:58:19 +0100 |
commit | efa436974d8203485eec6faa1bf0116bb32f6fcd (patch) | |
tree | 97a5ef2eea0310a12db399151de7ca97dbd47ece /src/Main/Forms/MountOptionsDialog.cpp | |
parent | cfadb231d24bd292a6ea3708b776bde8f06e50ab (diff) | |
download | VeraCrypt-efa436974d8203485eec6faa1bf0116bb32f6fcd.tar.gz VeraCrypt-efa436974d8203485eec6faa1bf0116bb32f6fcd.zip |
Linux/MacOSX: Implement Unicode passwords suppport. Make validation of parameters in GUI more robust.
Diffstat (limited to 'src/Main/Forms/MountOptionsDialog.cpp')
-rw-r--r-- | src/Main/Forms/MountOptionsDialog.cpp | 56 |
1 files changed, 33 insertions, 23 deletions
diff --git a/src/Main/Forms/MountOptionsDialog.cpp b/src/Main/Forms/MountOptionsDialog.cpp index 890c1ca2..2d53dda7 100644 --- a/src/Main/Forms/MountOptionsDialog.cpp +++ b/src/Main/Forms/MountOptionsDialog.cpp @@ -85,12 +85,26 @@ namespace VeraCrypt } void MountOptionsDialog::OnOKButtonClick (wxCommandEvent& event) - { + { + bool bUnsupportedKdf = false; TransferDataFromWindow(); - Options.Password = PasswordPanel->GetPassword(); + try + { + Options.Password = PasswordPanel->GetPassword(); + } + catch (PasswordException& e) + { + Gui->ShowWarning (e); + return; + } Options.Pim = PasswordPanel->GetVolumePim(); - Options.Kdf = PasswordPanel->GetPkcs5Kdf(); + Options.Kdf = PasswordPanel->GetPkcs5Kdf(bUnsupportedKdf); + if (bUnsupportedKdf) + { + Gui->ShowWarning (LangString ["ALGO_NOT_SUPPORTED_FOR_TRUECRYPT_MODE"]); + return; + } Options.TrueCryptMode = PasswordPanel->GetTrueCryptMode(); Options.Keyfiles = PasswordPanel->GetKeyfiles(); @@ -100,10 +114,23 @@ namespace VeraCrypt } else if (ProtectionCheckBox->IsChecked()) { - Options.Protection = VolumeProtection::HiddenVolumeReadOnly; - Options.ProtectionPassword = ProtectionPasswordPanel->GetPassword(); + try + { + Options.ProtectionPassword = ProtectionPasswordPanel->GetPassword(); + } + catch (PasswordException& e) + { + Gui->ShowWarning (e); + return; + } + Options.Protection = VolumeProtection::HiddenVolumeReadOnly; Options.ProtectionPim = ProtectionPasswordPanel->GetVolumePim(); - Options.ProtectionKdf = ProtectionPasswordPanel->GetPkcs5Kdf(); + Options.ProtectionKdf = ProtectionPasswordPanel->GetPkcs5Kdf(Options.TrueCryptMode, bUnsupportedKdf); + if (bUnsupportedKdf) + { + Gui->ShowWarning (LangString ["ALGO_NOT_SUPPORTED_FOR_TRUECRYPT_MODE"]); + return; + } Options.ProtectionKeyfiles = ProtectionPasswordPanel->GetKeyfiles(); } else @@ -117,23 +144,6 @@ namespace VeraCrypt Options.FilesystemOptions = FilesystemOptionsTextCtrl->GetValue(); - try - { - if (Options.Password) - Options.Password->CheckPortability(); - } - catch (UnportablePassword &) - { - Gui->ShowWarning (LangString ["UNSUPPORTED_CHARS_IN_PWD_RECOM"]); - } - - if (Options.TrueCryptMode && Options.Kdf && (Options.Kdf->GetName() == L"HMAC-SHA-256")) - { - Gui->ShowWarning (LangString ["ALGO_NOT_SUPPORTED_FOR_TRUECRYPT_MODE"]); - event.Skip(); - return; - } - EndModal (wxID_OK); } |