mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2026-06-17 18:16:07 -05:00
Linux/macOS: Remove TrueCrypt support
This commit is contained in:
@@ -273,7 +273,7 @@ namespace VeraCrypt
|
||||
Buffer salt(64);
|
||||
const char *tmp_salt = {"\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xAA\xBB\xCC\xDD\xEE\xFF\x01\x23\x45\x67\x89\xAB\xCD\xEF\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xAA\xBB\xCC\xDD\xEE\xFF\x01\x23\x45\x67\x89\xAB\xCD\xEF\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xAA\xBB\xCC\xDD\xEE\xFF"};
|
||||
unsigned long pim;
|
||||
Pkcs5KdfList prfList = Pkcs5Kdf::GetAvailableAlgorithms (false);
|
||||
Pkcs5KdfList prfList = Pkcs5Kdf::GetAvailableAlgorithms ();
|
||||
VolumePassword password ((const byte*) "passphrase-1234567890", 21);
|
||||
|
||||
memcpy (&pim, buffer.Ptr (), sizeof (unsigned long));
|
||||
|
||||
@@ -35,12 +35,6 @@ namespace VeraCrypt
|
||||
bool enableNewPassword = false;
|
||||
bool enableNewKeyfiles = false;
|
||||
bool enablePkcs5Prf = false;
|
||||
bool isTrueCryptFile = false;
|
||||
|
||||
if (volumePath && volumePath->HasTrueCryptExtension ())
|
||||
{
|
||||
isTrueCryptFile = true;
|
||||
}
|
||||
|
||||
switch (mode)
|
||||
{
|
||||
@@ -73,12 +67,11 @@ namespace VeraCrypt
|
||||
GraphicUserInterface::InstallPasswordEntryCustomKeyboardShortcuts (this);
|
||||
#endif
|
||||
|
||||
CurrentPasswordPanel = new VolumePasswordPanel (this, NULL, password, false, keyfiles, false, true, true, false, true, true);
|
||||
CurrentPasswordPanel = new VolumePasswordPanel (this, NULL, password, keyfiles, false, true, true, false, true, true);
|
||||
CurrentPasswordPanel->UpdateEvent.Connect (EventConnector <ChangePasswordDialog> (this, &ChangePasswordDialog::OnPasswordPanelUpdate));
|
||||
CurrentPasswordPanel->SetTrueCryptMode (isTrueCryptFile);
|
||||
CurrentPasswordPanelSizer->Add (CurrentPasswordPanel, 1, wxALL | wxEXPAND);
|
||||
|
||||
NewPasswordPanel = new VolumePasswordPanel (this, NULL, newPassword, true, newKeyfiles, false, enableNewPassword, enableNewKeyfiles, enableNewPassword, enablePkcs5Prf);
|
||||
NewPasswordPanel = new VolumePasswordPanel (this, NULL, newPassword, newKeyfiles, false, enableNewPassword, enableNewKeyfiles, enableNewPassword, enablePkcs5Prf);
|
||||
NewPasswordPanel->UpdateEvent.Connect (EventConnector <ChangePasswordDialog> (this, &ChangePasswordDialog::OnPasswordPanelUpdate));
|
||||
NewPasswordPanelSizer->Add (NewPasswordPanel, 1, wxALL | wxEXPAND);
|
||||
|
||||
@@ -107,13 +100,7 @@ namespace VeraCrypt
|
||||
|
||||
try
|
||||
{
|
||||
bool bUnsupportedKdf = false;
|
||||
shared_ptr <Pkcs5Kdf> currentKdf = CurrentPasswordPanel->GetPkcs5Kdf(bUnsupportedKdf);
|
||||
if (bUnsupportedKdf)
|
||||
{
|
||||
Gui->ShowWarning (LangString ["ALGO_NOT_SUPPORTED_FOR_TRUECRYPT_MODE"]);
|
||||
return;
|
||||
}
|
||||
shared_ptr <Pkcs5Kdf> currentKdf = CurrentPasswordPanel->GetPkcs5Kdf();
|
||||
int currentPim = CurrentPasswordPanel->GetVolumePim();
|
||||
if (-1 == currentPim)
|
||||
{
|
||||
@@ -182,7 +169,7 @@ namespace VeraCrypt
|
||||
|
||||
/* force the display of the random enriching interface */
|
||||
RandomNumberGenerator::SetEnrichedByUserStatus (false);
|
||||
Gui->UserEnrichRandomPool (this, NewPasswordPanel->GetPkcs5Kdf(bUnsupportedKdf) ? NewPasswordPanel->GetPkcs5Kdf(bUnsupportedKdf)->GetHash() : shared_ptr <Hash>());
|
||||
Gui->UserEnrichRandomPool (this, NewPasswordPanel->GetPkcs5Kdf() ? NewPasswordPanel->GetPkcs5Kdf()->GetHash() : shared_ptr <Hash>());
|
||||
|
||||
{
|
||||
#ifdef TC_UNIX
|
||||
@@ -203,8 +190,8 @@ namespace VeraCrypt
|
||||
#endif
|
||||
wxBusyCursor busy;
|
||||
ChangePasswordThreadRoutine routine(Path, Gui->GetPreferences().DefaultMountOptions.PreserveTimestamps,
|
||||
CurrentPasswordPanel->GetPassword(), CurrentPasswordPanel->GetVolumePim(), CurrentPasswordPanel->GetPkcs5Kdf(bUnsupportedKdf), CurrentPasswordPanel->GetTrueCryptMode(),CurrentPasswordPanel->GetKeyfiles(),
|
||||
newPassword, newPim, newKeyfiles, NewPasswordPanel->GetPkcs5Kdf(bUnsupportedKdf), NewPasswordPanel->GetHeaderWipeCount(), Gui->GetPreferences().EMVSupportEnabled);
|
||||
CurrentPasswordPanel->GetPassword(), CurrentPasswordPanel->GetVolumePim(), CurrentPasswordPanel->GetPkcs5Kdf(), CurrentPasswordPanel->GetKeyfiles(),
|
||||
newPassword, newPim, newKeyfiles, NewPasswordPanel->GetPkcs5Kdf(), NewPasswordPanel->GetHeaderWipeCount(), Gui->GetPreferences().EMVSupportEnabled);
|
||||
Gui->ExecuteWaitThreadRoutine (this, &routine);
|
||||
}
|
||||
|
||||
|
||||
@@ -642,13 +642,9 @@ namespace VeraCrypt
|
||||
try
|
||||
{
|
||||
MountOptions mountOptions (GetPreferences().DefaultMountOptions);
|
||||
if (CmdLine->ArgTrueCryptMode)
|
||||
{
|
||||
mountOptions.TrueCryptMode = CmdLine->ArgTrueCryptMode;
|
||||
}
|
||||
if (CmdLine->ArgHash)
|
||||
{
|
||||
mountOptions.Kdf = Pkcs5Kdf::GetAlgorithm (*CmdLine->ArgHash, mountOptions.TrueCryptMode);
|
||||
mountOptions.Kdf = Pkcs5Kdf::GetAlgorithm (*CmdLine->ArgHash);
|
||||
}
|
||||
if (CmdLine->ArgPim > 0)
|
||||
{
|
||||
@@ -671,13 +667,9 @@ namespace VeraCrypt
|
||||
try
|
||||
{
|
||||
MountOptions mountOptions (GetPreferences().DefaultMountOptions);
|
||||
if (CmdLine->ArgTrueCryptMode)
|
||||
{
|
||||
mountOptions.TrueCryptMode = CmdLine->ArgTrueCryptMode;
|
||||
}
|
||||
if (CmdLine->ArgHash)
|
||||
{
|
||||
mountOptions.Kdf = Pkcs5Kdf::GetAlgorithm (*CmdLine->ArgHash, mountOptions.TrueCryptMode);
|
||||
mountOptions.Kdf = Pkcs5Kdf::GetAlgorithm (*CmdLine->ArgHash);
|
||||
}
|
||||
if (CmdLine->ArgPim > 0)
|
||||
{
|
||||
@@ -706,13 +698,9 @@ namespace VeraCrypt
|
||||
MountOptions mountOptions (GetPreferences().DefaultMountOptions);
|
||||
mountOptions.SlotNumber = SelectedSlotNumber;
|
||||
mountOptions.Path = GetSelectedVolumePath();
|
||||
if (CmdLine->ArgTrueCryptMode)
|
||||
{
|
||||
mountOptions.TrueCryptMode = CmdLine->ArgTrueCryptMode;
|
||||
}
|
||||
if (CmdLine->ArgHash)
|
||||
{
|
||||
mountOptions.Kdf = Pkcs5Kdf::GetAlgorithm (*CmdLine->ArgHash, mountOptions.TrueCryptMode);
|
||||
mountOptions.Kdf = Pkcs5Kdf::GetAlgorithm (*CmdLine->ArgHash);
|
||||
}
|
||||
if (CmdLine->ArgPim > 0)
|
||||
{
|
||||
@@ -964,13 +952,9 @@ namespace VeraCrypt
|
||||
SetVolumePath (favorite.Path);
|
||||
|
||||
MountOptions mountOptions (GetPreferences().DefaultMountOptions);
|
||||
if (CmdLine->ArgTrueCryptMode)
|
||||
{
|
||||
mountOptions.TrueCryptMode = CmdLine->ArgTrueCryptMode;
|
||||
}
|
||||
if (CmdLine->ArgHash)
|
||||
{
|
||||
mountOptions.Kdf = Pkcs5Kdf::GetAlgorithm (*CmdLine->ArgHash, mountOptions.TrueCryptMode);
|
||||
mountOptions.Kdf = Pkcs5Kdf::GetAlgorithm (*CmdLine->ArgHash);
|
||||
}
|
||||
if (CmdLine->ArgPim > 0)
|
||||
{
|
||||
@@ -1706,7 +1690,7 @@ namespace VeraCrypt
|
||||
#endif
|
||||
fields[ColumnPath] = volume->Path;
|
||||
fields[ColumnSize] = Gui->SizeToString (volume->Size);
|
||||
fields[ColumnType] = Gui->VolumeTypeToString (volume->Type, volume->TrueCryptMode, volume->Protection);
|
||||
fields[ColumnType] = Gui->VolumeTypeToString (volume->Type, volume->Protection);
|
||||
|
||||
if (volume->HiddenVolumeProtectionTriggered)
|
||||
{
|
||||
|
||||
@@ -50,14 +50,8 @@ namespace VeraCrypt
|
||||
GraphicUserInterface::InstallPasswordEntryCustomKeyboardShortcuts (this);
|
||||
#endif
|
||||
|
||||
PasswordPanel = new VolumePasswordPanel (this, &options, options.Password, disableMountOptions, options.Keyfiles, !disableMountOptions, true, true, false, true, true);
|
||||
PasswordPanel = new VolumePasswordPanel (this, &options, options.Password, options.Keyfiles, !disableMountOptions, true, true, false, true, true);
|
||||
PasswordPanel->SetCacheCheckBoxValidator (wxGenericValidator (&Options.CachePassword));
|
||||
|
||||
if (options.Path && options.Path->HasTrueCryptExtension() && !disableMountOptions
|
||||
&& !options.TrueCryptMode && (options.Pim <= 0))
|
||||
{
|
||||
PasswordPanel->SetTrueCryptMode (true);
|
||||
}
|
||||
|
||||
PasswordSizer->Add (PasswordPanel, 1, wxALL | wxEXPAND);
|
||||
|
||||
@@ -88,7 +82,7 @@ namespace VeraCrypt
|
||||
OptionsButton->SetLabel (OptionsButtonLabel + L" >");
|
||||
OptionsPanel->Show (false);
|
||||
|
||||
ProtectionPasswordPanel = new VolumePasswordPanel (ProtectionSizer->GetStaticBox(), &options, options.ProtectionPassword, true, options.ProtectionKeyfiles, false, true, true, false, true, true, LangString["IDT_HIDDEN_PROT_PASSWD"]);
|
||||
ProtectionPasswordPanel = new VolumePasswordPanel (ProtectionSizer->GetStaticBox(), &options, options.ProtectionPassword, options.ProtectionKeyfiles, false, true, true, false, true, true, LangString["IDT_HIDDEN_PROT_PASSWD"]);
|
||||
ProtectionPasswordPanel->TopOwnerParent = this;
|
||||
ProtectionPasswordSizer->Add (ProtectionPasswordPanel, 1, wxALL | wxEXPAND);
|
||||
|
||||
@@ -110,8 +104,6 @@ namespace VeraCrypt
|
||||
|
||||
void MountOptionsDialog::OnOKButtonClick (wxCommandEvent& event)
|
||||
{
|
||||
bool bUnsupportedKdf = false;
|
||||
|
||||
/* verify that PIM values are valid before continuing*/
|
||||
int Pim = PasswordPanel->GetVolumePim();
|
||||
int ProtectionPim = (!ReadOnlyCheckBox->IsChecked() && ProtectionCheckBox->IsChecked())?
|
||||
@@ -149,13 +141,7 @@ namespace VeraCrypt
|
||||
}
|
||||
|
||||
Options.Pim = Pim;
|
||||
Options.Kdf = PasswordPanel->GetPkcs5Kdf(bUnsupportedKdf);
|
||||
if (bUnsupportedKdf)
|
||||
{
|
||||
Gui->ShowWarning (LangString ["ALGO_NOT_SUPPORTED_FOR_TRUECRYPT_MODE"]);
|
||||
return;
|
||||
}
|
||||
Options.TrueCryptMode = PasswordPanel->GetTrueCryptMode();
|
||||
Options.Kdf = PasswordPanel->GetPkcs5Kdf();
|
||||
Options.Keyfiles = PasswordPanel->GetKeyfiles();
|
||||
|
||||
if (ReadOnlyCheckBox->IsChecked())
|
||||
@@ -166,7 +152,7 @@ namespace VeraCrypt
|
||||
{
|
||||
try
|
||||
{
|
||||
Options.ProtectionPassword = ProtectionPasswordPanel->GetPassword(Options.TrueCryptMode);
|
||||
Options.ProtectionPassword = ProtectionPasswordPanel->GetPassword(false);
|
||||
}
|
||||
catch (PasswordException& e)
|
||||
{
|
||||
@@ -175,12 +161,7 @@ namespace VeraCrypt
|
||||
}
|
||||
Options.Protection = VolumeProtection::HiddenVolumeReadOnly;
|
||||
Options.ProtectionPim = ProtectionPim;
|
||||
Options.ProtectionKdf = ProtectionPasswordPanel->GetPkcs5Kdf(Options.TrueCryptMode, bUnsupportedKdf);
|
||||
if (bUnsupportedKdf)
|
||||
{
|
||||
Gui->ShowWarning (LangString ["ALGO_NOT_SUPPORTED_FOR_TRUECRYPT_MODE"]);
|
||||
return;
|
||||
}
|
||||
Options.ProtectionKdf = ProtectionPasswordPanel->GetPkcs5Kdf();
|
||||
Options.ProtectionKeyfiles = ProtectionPasswordPanel->GetKeyfiles();
|
||||
}
|
||||
else
|
||||
|
||||
@@ -53,12 +53,10 @@ namespace VeraCrypt
|
||||
|
||||
FilesystemOptionsTextCtrl->SetValue (Preferences.DefaultMountOptions.FilesystemOptions);
|
||||
|
||||
TrueCryptModeCheckBox->SetValidator (wxGenericValidator (&Preferences.DefaultMountOptions.TrueCryptMode));
|
||||
|
||||
int index, prfInitialIndex = 0;
|
||||
Pkcs5PrfChoice->Append (LangString["AUTODETECTION"]);
|
||||
|
||||
foreach_ref (const Pkcs5Kdf &kdf, Pkcs5Kdf::GetAvailableAlgorithms(false))
|
||||
foreach_ref (const Pkcs5Kdf &kdf, Pkcs5Kdf::GetAvailableAlgorithms())
|
||||
{
|
||||
index = Pkcs5PrfChoice->Append (kdf.GetName());
|
||||
if (Preferences.DefaultMountOptions.Kdf
|
||||
@@ -370,11 +368,10 @@ namespace VeraCrypt
|
||||
{
|
||||
try
|
||||
{
|
||||
selectedKdf = Pkcs5Kdf::GetAlgorithm (wstring (Pkcs5PrfChoice->GetStringSelection ()), TrueCryptModeCheckBox->IsChecked ());
|
||||
selectedKdf = Pkcs5Kdf::GetAlgorithm (wstring (Pkcs5PrfChoice->GetStringSelection ()));
|
||||
}
|
||||
catch (ParameterIncorrect&)
|
||||
{
|
||||
Gui->ShowWarning ("ALGO_NOT_SUPPORTED_FOR_TRUECRYPT_MODE");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -479,7 +479,6 @@ namespace VeraCrypt
|
||||
mountOptions.Pim = Pim;
|
||||
mountOptions.Keyfiles = Keyfiles;
|
||||
mountOptions.Kdf = Kdf;
|
||||
mountOptions.TrueCryptMode = false;
|
||||
|
||||
shared_ptr <VolumeInfo> volume = Core->MountVolume (mountOptions);
|
||||
finally_do_arg (shared_ptr <VolumeInfo>, volume, { Core->DismountVolume (finally_arg, true); });
|
||||
@@ -1031,7 +1030,7 @@ namespace VeraCrypt
|
||||
options->Quick = QuickFormatEnabled;
|
||||
options->Size = VolumeSize;
|
||||
options->Type = OuterVolume ? VolumeType::Normal : SelectedVolumeType;
|
||||
options->VolumeHeaderKdf = Pkcs5Kdf::GetAlgorithm (*SelectedHash, false);
|
||||
options->VolumeHeaderKdf = Pkcs5Kdf::GetAlgorithm (*SelectedHash);
|
||||
options->EMVSupportEnabled = Gui->GetPreferences().EMVSupportEnabled;
|
||||
|
||||
|
||||
@@ -1127,7 +1126,7 @@ namespace VeraCrypt
|
||||
});
|
||||
#endif
|
||||
|
||||
shared_ptr <Volume> outerVolume = Core->OpenVolume (make_shared <VolumePath> (SelectedVolumePath), true, Password, Pim, Kdf, false, Keyfiles, VolumeProtection::ReadOnly);
|
||||
shared_ptr <Volume> outerVolume = Core->OpenVolume (make_shared <VolumePath> (SelectedVolumePath), true, Password, Pim, Kdf, Keyfiles, VolumeProtection::ReadOnly);
|
||||
try
|
||||
{
|
||||
MaxHiddenVolumeSize = Core->GetMaxHiddenVolumeSize (outerVolume);
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
namespace VeraCrypt
|
||||
{
|
||||
VolumePasswordPanel::VolumePasswordPanel (wxWindow* parent, MountOptions* options, shared_ptr <VolumePassword> password, bool disableTruecryptMode, shared_ptr <KeyfileList> keyfiles, bool enableCache, bool enablePassword, bool enableKeyfiles, bool enableConfirmation, bool enablePkcs5Prf, bool isMountPassword, const wxString &passwordLabel)
|
||||
VolumePasswordPanel::VolumePasswordPanel (wxWindow* parent, MountOptions* options, shared_ptr <VolumePassword> password, shared_ptr <KeyfileList> 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 <VolumePassword> VolumePasswordPanel::GetPassword (bool bForceLegacyPassword) const
|
||||
{
|
||||
return GetPassword (PasswordTextCtrl, bForceLegacyPassword || GetTrueCryptMode());
|
||||
return GetPassword (PasswordTextCtrl, bForceLegacyPassword);
|
||||
}
|
||||
|
||||
shared_ptr <VolumePassword> VolumePasswordPanel::GetPassword (wxTextCtrl *textCtrl, bool bLegacyPassword) const
|
||||
@@ -246,14 +233,8 @@ namespace VeraCrypt
|
||||
return password;
|
||||
}
|
||||
|
||||
shared_ptr <Pkcs5Kdf> VolumePasswordPanel::GetPkcs5Kdf (bool &bUnsupportedKdf) const
|
||||
shared_ptr <Pkcs5Kdf> VolumePasswordPanel::GetPkcs5Kdf () const
|
||||
{
|
||||
return GetPkcs5Kdf (GetTrueCryptMode(), bUnsupportedKdf);
|
||||
}
|
||||
|
||||
shared_ptr <Pkcs5Kdf> VolumePasswordPanel::GetPkcs5Kdf (bool bTrueCryptMode, bool &bUnsupportedKdf) const
|
||||
{
|
||||
bUnsupportedKdf = false;
|
||||
try
|
||||
{
|
||||
int index = Pkcs5PrfChoice->GetSelection ();
|
||||
@@ -263,11 +244,10 @@ namespace VeraCrypt
|
||||
return shared_ptr <Pkcs5Kdf> ();
|
||||
}
|
||||
else
|
||||
return Pkcs5Kdf::GetAlgorithm (wstring (Pkcs5PrfChoice->GetStringSelection()), bTrueCryptMode);
|
||||
return Pkcs5Kdf::GetAlgorithm (wstring (Pkcs5PrfChoice->GetStringSelection()));
|
||||
}
|
||||
catch (ParameterIncorrect&)
|
||||
{
|
||||
bUnsupportedKdf = true;
|
||||
return shared_ptr <Pkcs5Kdf> ();
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,17 +22,14 @@ namespace VeraCrypt
|
||||
class VolumePasswordPanel : public VolumePasswordPanelBase
|
||||
{
|
||||
public:
|
||||
VolumePasswordPanel (wxWindow* parent, MountOptions* options, shared_ptr <VolumePassword> password, bool disableTruecryptMode, shared_ptr <KeyfileList> keyfiles, bool enableCache = false, bool enablePassword = true, bool enableKeyfiles = true, bool enableConfirmation = false, bool enablePkcs5Prf = false, bool isMountPassword = false, const wxString &passwordLabel = wxString());
|
||||
VolumePasswordPanel (wxWindow* parent, MountOptions* options, shared_ptr <VolumePassword> password, shared_ptr <KeyfileList> keyfiles, bool enableCache = false, bool enablePassword = true, bool enableKeyfiles = true, bool enableConfirmation = false, bool enablePkcs5Prf = false, bool isMountPassword = false, const wxString &passwordLabel = wxString());
|
||||
virtual ~VolumePasswordPanel ();
|
||||
|
||||
void AddKeyfile (shared_ptr <Keyfile> keyfile);
|
||||
shared_ptr <KeyfileList> GetKeyfiles () const { return UseKeyfilesCheckBox->IsChecked() ? Keyfiles : shared_ptr <KeyfileList> (); }
|
||||
shared_ptr <VolumePassword> GetPassword (bool bForceLegacyPassword = false) const;
|
||||
shared_ptr <Pkcs5Kdf> GetPkcs5Kdf (bool &bUnsupportedKdf) const;
|
||||
shared_ptr <Pkcs5Kdf> GetPkcs5Kdf (bool bTrueCryptMode, bool &bUnsupportedKdf) const;
|
||||
shared_ptr <Pkcs5Kdf> GetPkcs5Kdf () const;
|
||||
int GetVolumePim () const;
|
||||
bool GetTrueCryptMode () const;
|
||||
void SetTrueCryptMode (bool trueCryptMode);
|
||||
int GetHeaderWipeCount () const;
|
||||
void SetCacheCheckBoxValidator (const wxGenericValidator &validator) { CacheCheckBox->SetValidator (validator); }
|
||||
void SetFocusToPasswordTextCtrl () { PasswordTextCtrl->SetSelection (-1, -1); PasswordTextCtrl->SetFocus(); }
|
||||
@@ -64,7 +61,6 @@ namespace VeraCrypt
|
||||
void OnUpdate () { UpdateEvent.Raise(); }
|
||||
void OnUseKeyfilesCheckBoxClick (wxCommandEvent& event) { OnUpdate(); }
|
||||
void WipeTextCtrl (wxTextCtrl *textCtrl);
|
||||
void OnTrueCryptModeChecked( wxCommandEvent& event );
|
||||
|
||||
shared_ptr <KeyfileList> Keyfiles;
|
||||
shared_ptr <Functor> UpdateCallback;
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace VeraCrypt
|
||||
VolumePasswordWizardPage::VolumePasswordWizardPage (wxPanel* parent, shared_ptr <VolumePassword> password, shared_ptr <KeyfileList> keyfiles, bool enableConfirmation)
|
||||
: VolumePasswordWizardPageBase (parent), ConfirmationMode (enableConfirmation)
|
||||
{
|
||||
PasswordPanel = new VolumePasswordPanel (this, NULL, password, true, keyfiles, false, true, true, enableConfirmation, !enableConfirmation, !enableConfirmation);
|
||||
PasswordPanel = new VolumePasswordPanel (this, NULL, password, keyfiles, false, true, true, enableConfirmation, !enableConfirmation, !enableConfirmation);
|
||||
PasswordPanel->UpdateEvent.Connect (EventConnector <VolumePasswordWizardPage> (this, &VolumePasswordWizardPage::OnPasswordPanelUpdate));
|
||||
|
||||
PasswordPanelSizer->Add (PasswordPanel, 1, wxALL | wxEXPAND);
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace VeraCrypt
|
||||
bool IsPimSelected () const { return PasswordPanel->IsUsePimChecked ();}
|
||||
void SetPimSelected (bool selected) const { PasswordPanel->SetUsePimChecked (selected);}
|
||||
|
||||
shared_ptr <Pkcs5Kdf> GetPkcs5Kdf () const { bool bUnsupportedKdf; return PasswordPanel->GetPkcs5Kdf(bUnsupportedKdf); }
|
||||
shared_ptr <Pkcs5Kdf> GetPkcs5Kdf () const { return PasswordPanel->GetPkcs5Kdf(); }
|
||||
bool IsValid ();
|
||||
void SetMaxStaticTextWidth (int width) { InfoStaticText->Wrap (width); }
|
||||
void SetPageText (const wxString &text) { InfoStaticText->SetLabel (text); }
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace VeraCrypt
|
||||
AppendToList ("VIRTUAL_DEVICE", wstring (volumeInfo.VirtualDevice));
|
||||
#endif
|
||||
AppendToList ("SIZE", Gui->SizeToString (volumeInfo.Size));
|
||||
AppendToList ("TYPE", Gui->VolumeTypeToString (volumeInfo.Type, volumeInfo.TrueCryptMode, volumeInfo.Protection));
|
||||
AppendToList ("TYPE", Gui->VolumeTypeToString (volumeInfo.Type, volumeInfo.Protection));
|
||||
AppendToList ("READ_ONLY", LangString [volumeInfo.Protection == VolumeProtection::ReadOnly ? "UISTR_YES" : "UISTR_NO"]);
|
||||
|
||||
wxString protection;
|
||||
|
||||
@@ -96,8 +96,6 @@ namespace VeraCrypt
|
||||
VC_CONVERT_EXCEPTION (SecurityTokenLibraryNotInitialized);
|
||||
VC_CONVERT_EXCEPTION (SecurityTokenKeyfileAlreadyExists);
|
||||
VC_CONVERT_EXCEPTION (SecurityTokenKeyfileNotFound);
|
||||
VC_CONVERT_EXCEPTION (UnsupportedAlgoInTrueCryptMode);
|
||||
VC_CONVERT_EXCEPTION (UnsupportedTrueCryptFormat);
|
||||
VC_CONVERT_EXCEPTION (SystemException);
|
||||
VC_CONVERT_EXCEPTION (CipherException);
|
||||
VC_CONVERT_EXCEPTION (VolumeException);
|
||||
|
||||
Reference in New Issue
Block a user