From 3f976c24d2c991f8634991371cbb99662f979022 Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Mon, 24 Jul 2023 08:48:52 +0200 Subject: Linux/macOS: Remove TrueCrypt support --- src/Main/Forms/VolumePasswordPanel.cpp | 54 ++++------------------------------ 1 file changed, 5 insertions(+), 49 deletions(-) (limited to 'src/Main/Forms/VolumePasswordPanel.cpp') diff --git a/src/Main/Forms/VolumePasswordPanel.cpp b/src/Main/Forms/VolumePasswordPanel.cpp index 5bd98daa..32b92edc 100644 --- a/src/Main/Forms/VolumePasswordPanel.cpp +++ b/src/Main/Forms/VolumePasswordPanel.cpp @@ -18,7 +18,7 @@ namespace VeraCrypt { - VolumePasswordPanel::VolumePasswordPanel (wxWindow* parent, MountOptions* options, shared_ptr password, bool disableTruecryptMode, shared_ptr keyfiles, bool enableCache, bool enablePassword, bool enableKeyfiles, bool enableConfirmation, bool enablePkcs5Prf, bool isMountPassword, const wxString &passwordLabel) + VolumePasswordPanel::VolumePasswordPanel (wxWindow* parent, MountOptions* options, shared_ptr password, shared_ptr keyfiles, bool enableCache, bool enablePassword, bool enableKeyfiles, bool enableConfirmation, bool enablePkcs5Prf, bool isMountPassword, const wxString &passwordLabel) : VolumePasswordPanelBase (parent), TopOwnerParent(NULL), Keyfiles (new KeyfileList), EnablePimEntry (true) { size_t maxPasswordLength = CmdLine->ArgUseLegacyPassword? VolumePassword::MaxLegacySize : VolumePassword::MaxSize; @@ -78,22 +78,9 @@ namespace VeraCrypt Pkcs5PrfStaticText->Show (enablePkcs5Prf); Pkcs5PrfChoice->Show (enablePkcs5Prf); - TrueCryptModeCheckBox->Show (!disableTruecryptMode); HeaderWipeCountText->Show (enablePkcs5Prf && !isMountPassword); HeaderWipeCount->Show (enablePkcs5Prf && !isMountPassword); - if (options && !disableTruecryptMode) - { - TrueCryptModeCheckBox->SetValue (options->TrueCryptMode); - if (options->TrueCryptMode) - { - PimCheckBox->Enable (false); - VolumePimStaticText->Enable (false); - VolumePimTextCtrl->Enable (false); - VolumePimHelpStaticText->Enable (false); - } - } - if (EnablePimEntry && options && options->Pim > 0) { PimCheckBox->SetValue (true); @@ -113,7 +100,7 @@ namespace VeraCrypt Pkcs5PrfChoice->Delete (0); Pkcs5PrfChoice->Append (LangString["AUTODETECTION"]); } - foreach_ref (const Pkcs5Kdf &kdf, Pkcs5Kdf::GetAvailableAlgorithms(false)) + foreach_ref (const Pkcs5Kdf &kdf, Pkcs5Kdf::GetAvailableAlgorithms()) { if (!kdf.IsDeprecated() || isMountPassword) { @@ -221,7 +208,7 @@ namespace VeraCrypt shared_ptr VolumePasswordPanel::GetPassword (bool bForceLegacyPassword) const { - return GetPassword (PasswordTextCtrl, bForceLegacyPassword || GetTrueCryptMode()); + return GetPassword (PasswordTextCtrl, bForceLegacyPassword); } shared_ptr VolumePasswordPanel::GetPassword (wxTextCtrl *textCtrl, bool bLegacyPassword) const @@ -246,14 +233,8 @@ namespace VeraCrypt return password; } - shared_ptr VolumePasswordPanel::GetPkcs5Kdf (bool &bUnsupportedKdf) const - { - return GetPkcs5Kdf (GetTrueCryptMode(), bUnsupportedKdf); - } - - shared_ptr VolumePasswordPanel::GetPkcs5Kdf (bool bTrueCryptMode, bool &bUnsupportedKdf) const + shared_ptr VolumePasswordPanel::GetPkcs5Kdf () const { - bUnsupportedKdf = false; try { int index = Pkcs5PrfChoice->GetSelection (); @@ -263,11 +244,10 @@ namespace VeraCrypt return shared_ptr (); } else - return Pkcs5Kdf::GetAlgorithm (wstring (Pkcs5PrfChoice->GetStringSelection()), bTrueCryptMode); + return Pkcs5Kdf::GetAlgorithm (wstring (Pkcs5PrfChoice->GetStringSelection())); } catch (ParameterIncorrect&) { - bUnsupportedKdf = true; return shared_ptr (); } } @@ -303,21 +283,6 @@ namespace VeraCrypt } } - bool VolumePasswordPanel::GetTrueCryptMode () const - { - return TrueCryptModeCheckBox->GetValue (); - } - - void VolumePasswordPanel::SetTrueCryptMode (bool trueCryptMode) - { - bool bEnablePIM = !trueCryptMode; - TrueCryptModeCheckBox->SetValue (trueCryptMode); - PimCheckBox->Enable (bEnablePIM); - VolumePimStaticText->Enable (bEnablePIM); - VolumePimTextCtrl->Enable (bEnablePIM); - VolumePimHelpStaticText->Enable (bEnablePIM); - } - int VolumePasswordPanel::GetHeaderWipeCount () const { try @@ -515,13 +480,4 @@ namespace VeraCrypt layoutParent->Fit(); } } - - void VolumePasswordPanel::OnTrueCryptModeChecked( wxCommandEvent& event ) - { - bool bEnablePIM = !GetTrueCryptMode (); - PimCheckBox->Enable (bEnablePIM); - VolumePimStaticText->Enable (bEnablePIM); - VolumePimTextCtrl->Enable (bEnablePIM); - VolumePimHelpStaticText->Enable (bEnablePIM); - } } -- cgit v1.2.3