mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2025-11-12 11:28:26 -06:00
Windows/Linux/MacOSX: Set maximum PIM value to 2147468 in order to avoid having negative values for iterations count using the formula 15000 + (PIM x 1000). Add specific error message to XML language files.
This commit is contained in:
@@ -3240,7 +3240,7 @@ VolumePasswordPanelBase::VolumePasswordPanelBase( wxWindow* parent, wxWindowID i
|
||||
GridBagSizer->Add( VolumePimStaticText, wxGBPosition( 3, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxBOTTOM|wxRIGHT, 5 );
|
||||
|
||||
VolumePimTextCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PASSWORD );
|
||||
VolumePimTextCtrl->SetMaxLength( 10 );
|
||||
VolumePimTextCtrl->SetMaxLength( 7 );
|
||||
GridBagSizer->Add( VolumePimTextCtrl, wxGBPosition( 3, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxEXPAND, 5 );
|
||||
|
||||
VolumePimHelpStaticText = new wxStaticText( this, wxID_ANY, _("(Empty or 0 for default iterations)"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
@@ -3381,7 +3381,7 @@ VolumePimWizardPageBase::VolumePimWizardPageBase( wxWindow* parent, wxWindowID i
|
||||
PimSizer->Add( VolumePimStaticText, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
|
||||
|
||||
VolumePimTextCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PASSWORD );
|
||||
VolumePimTextCtrl->SetMaxLength( 10 );
|
||||
VolumePimTextCtrl->SetMaxLength( 7 );
|
||||
PimSizer->Add( VolumePimTextCtrl, 0, wxALL, 5 );
|
||||
|
||||
VolumePimHelpStaticText = new wxStaticText( this, wxID_ANY, _("(Empty or 0 for default iterations)"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
|
||||
@@ -94,13 +94,13 @@ namespace VeraCrypt
|
||||
ProtectionPasswordPanel->GetVolumePim() : 0;
|
||||
|
||||
/* invalid PIM: set focus to PIM field and stop processing */
|
||||
if (-1 == Pim)
|
||||
if (-1 == Pim || (PartitionInSystemEncryptionScopeCheckBox->IsChecked() && Pim > MAX_BOOT_PIM_VALUE))
|
||||
{
|
||||
PasswordPanel->SetFocusToPimTextCtrl();
|
||||
return;
|
||||
}
|
||||
|
||||
if (-1 == ProtectionPim)
|
||||
if (-1 == ProtectionPim || (PartitionInSystemEncryptionScopeCheckBox->IsChecked() && ProtectionPim > MAX_BOOT_PIM_VALUE))
|
||||
{
|
||||
ProtectionPasswordPanel->SetFocusToPimTextCtrl();
|
||||
return;
|
||||
|
||||
@@ -26270,7 +26270,7 @@
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="maxlength">10</property>
|
||||
<property name="maxlength">7</property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
@@ -27710,7 +27710,7 @@
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="maxlength">10</property>
|
||||
<property name="maxlength">7</property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
|
||||
@@ -63,6 +63,7 @@ namespace VeraCrypt
|
||||
EnablePimEntry = enablePassword && (!enableConfirmation || (enablePkcs5Prf && !isMountPassword));
|
||||
PimCheckBox->Show (EnablePimEntry);
|
||||
VolumePimStaticText->Show (false);
|
||||
VolumePimTextCtrl->SetMaxLength (MAX_PIM_DIGITS);
|
||||
VolumePimTextCtrl->Show (false);
|
||||
VolumePimHelpStaticText->Show (false);
|
||||
|
||||
@@ -198,7 +199,7 @@ namespace VeraCrypt
|
||||
int colspan = isPim? 1 : 2;
|
||||
|
||||
wxTextCtrl *newTextCtrl = new wxTextCtrl (this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, display ? 0 : wxTE_PASSWORD);
|
||||
newTextCtrl->SetMaxLength (isPim? 10 : VolumePassword::MaxSize);
|
||||
newTextCtrl->SetMaxLength (isPim? MAX_PIM_DIGITS : VolumePassword::MaxSize);
|
||||
newTextCtrl->SetValue ((*textCtrl)->GetValue());
|
||||
newTextCtrl->SetMinSize ((*textCtrl)->GetSize());
|
||||
|
||||
@@ -279,7 +280,8 @@ namespace VeraCrypt
|
||||
if (pimStr.IsEmpty())
|
||||
return 0;
|
||||
if (((size_t) wxNOT_FOUND == pimStr.find_first_not_of (wxT("0123456789")))
|
||||
&& pimStr.ToLong (&pim))
|
||||
&& pimStr.ToLong (&pim)
|
||||
&& pim <= MAX_PIM_VALUE)
|
||||
return (int) pim;
|
||||
else
|
||||
return -1;
|
||||
|
||||
@@ -103,7 +103,7 @@ namespace VeraCrypt
|
||||
bool display = event.IsChecked ();
|
||||
|
||||
wxTextCtrl *newTextCtrl = new wxTextCtrl (this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, display ? 0 : wxTE_PASSWORD);
|
||||
newTextCtrl->SetMaxLength (10);
|
||||
newTextCtrl->SetMaxLength (MAX_PIM_DIGITS);
|
||||
newTextCtrl->SetValue (VolumePimTextCtrl->GetValue());
|
||||
newTextCtrl->SetMinSize (VolumePimTextCtrl->GetSize());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user