diff options
author | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2016-05-10 22:34:27 +0200 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2016-05-10 22:34:27 +0200 |
commit | 268ef2d8e904db5068dbdc0fdc7ce3940d6452ea (patch) | |
tree | b1afa687c97fbf5e1ba2c92c5a10479ae5f832f5 /src/Main/Forms/VolumePasswordPanel.cpp | |
parent | 6d61f06a5348aebe7dbc0bf44d3e2729c20f7fd0 (diff) | |
parent | 5f47d8b6f11cdb3c4c2f43e04e5acfc6ffcb3035 (diff) | |
download | VeraCrypt-268ef2d8e904db5068dbdc0fdc7ce3940d6452ea.tar.gz VeraCrypt-268ef2d8e904db5068dbdc0fdc7ce3940d6452ea.zip |
Merge pull request #61 from davidfoerster/normalize-line-terminators
Normalize line terminators
Diffstat (limited to 'src/Main/Forms/VolumePasswordPanel.cpp')
-rw-r--r-- | src/Main/Forms/VolumePasswordPanel.cpp | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/src/Main/Forms/VolumePasswordPanel.cpp b/src/Main/Forms/VolumePasswordPanel.cpp index 27d66bd8..920d4f96 100644 --- a/src/Main/Forms/VolumePasswordPanel.cpp +++ b/src/Main/Forms/VolumePasswordPanel.cpp @@ -3,7 +3,7 @@ Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed by the TrueCrypt License 3.0. - Modifications and additions to the original source code (contained in this file) + Modifications and additions to the original source code (contained in this file) and all other portions of this file are Copyright (c) 2013-2016 IDRIX and are governed by the Apache License 2.0 the full text of which is contained in the file License.txt included in VeraCrypt binary and source @@ -43,7 +43,7 @@ namespace VeraCrypt } CacheCheckBox->Show (enableCache); - + if (!enablePassword && enableKeyfiles) { Layout(); @@ -58,8 +58,8 @@ namespace VeraCrypt PasswordStaticText->Show (enablePassword); PasswordTextCtrl->Show (enablePassword); DisplayPasswordCheckBox->Show (enablePassword); - - + + EnablePimEntry = enablePassword && (!enableConfirmation || (enablePkcs5Prf && !isMountPassword)); PimCheckBox->Show (EnablePimEntry); VolumePimStaticText->Show (false); @@ -71,12 +71,12 @@ namespace VeraCrypt ConfirmPasswordStaticText->Show (enableConfirmation); ConfirmPasswordTextCtrl->Show (enableConfirmation); - + UseKeyfilesCheckBox->Show (enableKeyfiles); KeyfilesButton->Show (enableKeyfiles); Pkcs5PrfStaticText->Show (enablePkcs5Prf); - Pkcs5PrfChoice->Show (enablePkcs5Prf); + Pkcs5PrfChoice->Show (enablePkcs5Prf); TrueCryptModeCheckBox->Show (!disableTruecryptMode); HeaderWipeCountText->Show (enablePkcs5Prf && !isMountPassword); HeaderWipeCount->Show (enablePkcs5Prf && !isMountPassword); @@ -104,20 +104,20 @@ namespace VeraCrypt } if (enablePkcs5Prf) - { + { int index, prfInitialIndex = 0; if (isMountPassword) { // case of password for mounting Pkcs5PrfChoice->Delete (0); - Pkcs5PrfChoice->Append (LangString["AUTODETECTION"]); + Pkcs5PrfChoice->Append (LangString["AUTODETECTION"]); } foreach_ref (const Pkcs5Kdf &kdf, Pkcs5Kdf::GetAvailableAlgorithms(false)) { if (!kdf.IsDeprecated() || isMountPassword) { index = Pkcs5PrfChoice->Append (kdf.GetName()); - if (isMountPassword && options && options->Kdf + if (isMountPassword && options && options->Kdf && (options->Kdf->GetName() == kdf.GetName()) ) { @@ -199,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? MAX_PIM_DIGITS : VolumePassword::MaxSize); + newTextCtrl->SetMaxLength (isPim? MAX_PIM_DIGITS : VolumePassword::MaxSize); newTextCtrl->SetValue ((*textCtrl)->GetValue()); newTextCtrl->SetMinSize ((*textCtrl)->GetSize()); @@ -270,7 +270,7 @@ namespace VeraCrypt return shared_ptr <Pkcs5Kdf> (); } } - + int VolumePasswordPanel::GetVolumePim () const { if (VolumePimTextCtrl->IsEnabled () && VolumePimTextCtrl->IsShown ()) @@ -279,7 +279,7 @@ namespace VeraCrypt long pim = 0; if (pimStr.IsEmpty()) return 0; - if (((size_t) wxNOT_FOUND == pimStr.find_first_not_of (wxT("0123456789"))) + if (((size_t) wxNOT_FOUND == pimStr.find_first_not_of (wxT("0123456789"))) && pimStr.ToLong (&pim) && pim <= MAX_PIM_VALUE) return (int) pim; @@ -288,7 +288,7 @@ namespace VeraCrypt } else return 0; - } + } void VolumePasswordPanel::SetVolumePim (int pim) { @@ -306,7 +306,7 @@ namespace VeraCrypt { return TrueCryptModeCheckBox->GetValue (); } - + int VolumePasswordPanel::GetHeaderWipeCount () const { try @@ -393,10 +393,10 @@ namespace VeraCrypt void VolumePasswordPanel::OnDisplayPasswordCheckBoxClick (wxCommandEvent& event) { DisplayPassword (event.IsChecked(), &PasswordTextCtrl, 1); - + if (ConfirmPasswordTextCtrl->IsShown()) DisplayPassword (event.IsChecked(), &ConfirmPasswordTextCtrl, 2); - + if (VolumePimTextCtrl->IsShown()) DisplayPassword (event.IsChecked(), &VolumePimTextCtrl, 3); @@ -467,7 +467,7 @@ namespace VeraCrypt VolumePimHelpStaticText->SetLabel(LangString["IDC_PIM_HELP"]); guiUpdated = true; } - + if (guiUpdated) { Layout(); @@ -485,8 +485,8 @@ namespace VeraCrypt PimCheckBox->Show (false); VolumePimStaticText->Show (true); VolumePimTextCtrl->Show (true); - VolumePimHelpStaticText->Show (true); - + VolumePimHelpStaticText->Show (true); + if (DisplayPasswordCheckBox->IsChecked ()) DisplayPassword (true, &VolumePimTextCtrl, 3); else @@ -494,12 +494,12 @@ namespace VeraCrypt Layout(); Fit(); } - + GetParent()->Layout(); GetParent()->Fit(); } } - + void VolumePasswordPanel::OnTrueCryptModeChecked( wxCommandEvent& event ) { bool bEnablePIM = !GetTrueCryptMode (); |