mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2025-11-11 11:08:02 -06:00
Linux/MacOSX: Implement Unicode passwords suppport. Make validation of parameters in GUI more robust.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user