VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Main
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2023-07-24 08:48:52 +0200
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2023-07-24 08:48:52 +0200
commit3f976c24d2c991f8634991371cbb99662f979022 (patch)
treeb2e6af95be6cb091506c8ba0a1f2230a493fa742 /src/Main
parentba74b9d5b84c9e8ce692489985ae331386359cb0 (diff)
downloadVeraCrypt-3f976c24d2c991f8634991371cbb99662f979022.tar.gz
VeraCrypt-3f976c24d2c991f8634991371cbb99662f979022.zip
Linux/macOS: Remove TrueCrypt support
Diffstat (limited to 'src/Main')
-rw-r--r--src/Main/CommandLineInterface.cpp11
-rw-r--r--src/Main/CommandLineInterface.h1
-rw-r--r--src/Main/Forms/BenchmarkDialog.cpp2
-rw-r--r--src/Main/Forms/ChangePasswordDialog.cpp25
-rw-r--r--src/Main/Forms/MainFrame.cpp26
-rw-r--r--src/Main/Forms/MountOptionsDialog.cpp29
-rw-r--r--src/Main/Forms/PreferencesDialog.cpp7
-rw-r--r--src/Main/Forms/VolumeCreationWizard.cpp5
-rw-r--r--src/Main/Forms/VolumePasswordPanel.cpp54
-rw-r--r--src/Main/Forms/VolumePasswordPanel.h8
-rw-r--r--src/Main/Forms/VolumePasswordWizardPage.cpp2
-rw-r--r--src/Main/Forms/VolumePasswordWizardPage.h2
-rw-r--r--src/Main/Forms/VolumePropertiesDialog.cpp2
-rw-r--r--src/Main/Forms/WaitDialog.cpp2
-rw-r--r--src/Main/GraphicUserInterface.cpp9
-rw-r--r--src/Main/GraphicUserInterface.h2
-rw-r--r--src/Main/TextUserInterface.cpp29
-rw-r--r--src/Main/TextUserInterface.h2
-rw-r--r--src/Main/UserInterface.cpp22
-rw-r--r--src/Main/UserInterface.h4
-rw-r--r--src/Main/UserPreferences.cpp6
21 files changed, 59 insertions, 191 deletions
diff --git a/src/Main/CommandLineInterface.cpp b/src/Main/CommandLineInterface.cpp
index a7189652..2bbc73ea 100644
--- a/src/Main/CommandLineInterface.cpp
+++ b/src/Main/CommandLineInterface.cpp
@@ -29,7 +29,6 @@ namespace VeraCrypt
ArgPim (-1),
ArgSize (0),
ArgVolumeType (VolumeType::Unknown),
- ArgTrueCryptMode (false),
ArgDisableFileSizeCheck (false),
ArgUseLegacyPassword (false),
#if defined(TC_LINUX ) || defined (TC_FREEBSD)
@@ -92,7 +91,6 @@ namespace VeraCrypt
parser.AddSwitch (L"", L"quick", _("Enable quick format"));
parser.AddOption (L"", L"size", _("Size in bytes"));
parser.AddOption (L"", L"slot", _("Volume slot number"));
- parser.AddSwitch (L"tc",L"truecrypt", _("Enable TrueCrypt mode. Should be put first to avoid issues."));
parser.AddSwitch (L"", L"test", _("Test internal algorithms"));
parser.AddSwitch (L"t", L"text", _("Use text user interface"));
parser.AddOption (L"", L"token-lib", _("Security token library"));
@@ -357,9 +355,8 @@ namespace VeraCrypt
ArgForce = parser.Found (L"force");
- ArgTrueCryptMode = parser.Found (L"truecrypt");
ArgDisableFileSizeCheck = parser.Found (L"no-size-check");
- ArgUseLegacyPassword = parser.Found (L"legacy-password-maxlength") || ArgTrueCryptMode;
+ ArgUseLegacyPassword = parser.Found (L"legacy-password-maxlength");
#if defined(TC_LINUX ) || defined (TC_FREEBSD)
ArgUseDummySudoPassword = parser.Found (L"use-dummy-sudo-password");
#endif
@@ -449,8 +446,6 @@ namespace VeraCrypt
if (ArgNewPim < 0 || ArgNewPim > (ArgMountOptions.PartitionInSystemEncryptionScope? MAX_BOOT_PIM_VALUE: MAX_PIM_VALUE))
throw_err (LangString["PARAMETER_INCORRECT"] + L": " + str);
- else if (ArgNewPim > 0 && ArgTrueCryptMode)
- throw_err (LangString["PIM_NOT_SUPPORTED_FOR_TRUECRYPT_MODE"]);
}
if (parser.Found (L"non-interactive"))
@@ -489,8 +484,6 @@ namespace VeraCrypt
if (ArgPim < 0 || ArgPim > (ArgMountOptions.PartitionInSystemEncryptionScope? MAX_BOOT_PIM_VALUE: MAX_PIM_VALUE))
throw_err (LangString["PARAMETER_INCORRECT"] + L": " + str);
- else if (ArgPim > 0 && ArgTrueCryptMode)
- throw_err (LangString["PIM_NOT_SUPPORTED_FOR_TRUECRYPT_MODE"]);
}
if (parser.Found (L"protect-hidden", &str))
@@ -545,7 +538,7 @@ namespace VeraCrypt
if (hashName.IsSameAs (str, false) || hashAltName.IsSameAs (str, false))
{
bHashFound = true;
- ArgMountOptions.ProtectionKdf = Pkcs5Kdf::GetAlgorithm (*hash, ArgTrueCryptMode);
+ ArgMountOptions.ProtectionKdf = Pkcs5Kdf::GetAlgorithm (*hash);
}
}
diff --git a/src/Main/CommandLineInterface.h b/src/Main/CommandLineInterface.h
index 6a31932e..4003dc05 100644
--- a/src/Main/CommandLineInterface.h
+++ b/src/Main/CommandLineInterface.h
@@ -83,7 +83,6 @@ namespace VeraCrypt
shared_ptr <VolumePath> ArgVolumePath;
VolumeInfoList ArgVolumes;
VolumeType::Enum ArgVolumeType;
- bool ArgTrueCryptMode;
shared_ptr<SecureBuffer> ArgTokenPin;
bool ArgDisableFileSizeCheck;
bool ArgUseLegacyPassword;
diff --git a/src/Main/Forms/BenchmarkDialog.cpp b/src/Main/Forms/BenchmarkDialog.cpp
index 18712274..7b0209ff 100644
--- a/src/Main/Forms/BenchmarkDialog.cpp
+++ b/src/Main/Forms/BenchmarkDialog.cpp
@@ -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));
diff --git a/src/Main/Forms/ChangePasswordDialog.cpp b/src/Main/Forms/ChangePasswordDialog.cpp
index 0b54fefc..397ee693 100644
--- a/src/Main/Forms/ChangePasswordDialog.cpp
+++ b/src/Main/Forms/ChangePasswordDialog.cpp
@@ -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);
}
diff --git a/src/Main/Forms/MainFrame.cpp b/src/Main/Forms/MainFrame.cpp
index 4b9b9bf1..2e34ef85 100644
--- a/src/Main/Forms/MainFrame.cpp
+++ b/src/Main/Forms/MainFrame.cpp
@@ -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)
{
diff --git a/src/Main/Forms/MountOptionsDialog.cpp b/src/Main/Forms/MountOptionsDialog.cpp
index 4b8f7ce5..85a06d1e 100644
--- a/src/Main/Forms/MountOptionsDialog.cpp
+++ b/src/Main/Forms/MountOptionsDialog.cpp
@@ -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
diff --git a/src/Main/Forms/PreferencesDialog.cpp b/src/Main/Forms/PreferencesDialog.cpp
index abf1d505..91204389 100644
--- a/src/Main/Forms/PreferencesDialog.cpp
+++ b/src/Main/Forms/PreferencesDialog.cpp
@@ -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;
}
}
diff --git a/src/Main/Forms/VolumeCreationWizard.cpp b/src/Main/Forms/VolumeCreationWizard.cpp
index 5939fc1b..2653ff66 100644
--- a/src/Main/Forms/VolumeCreationWizard.cpp
+++ b/src/Main/Forms/VolumeCreationWizard.cpp
@@ -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);
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 <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
- {
- return GetPkcs5Kdf (GetTrueCryptMode(), bUnsupportedKdf);
- }
-
- shared_ptr <Pkcs5Kdf> VolumePasswordPanel::GetPkcs5Kdf (bool bTrueCryptMode, bool &bUnsupportedKdf) const
+ shared_ptr <Pkcs5Kdf> VolumePasswordPanel::GetPkcs5Kdf () 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);
- }
}
diff --git a/src/Main/Forms/VolumePasswordPanel.h b/src/Main/Forms/VolumePasswordPanel.h
index e9b81e29..7019e8fd 100644
--- a/src/Main/Forms/VolumePasswordPanel.h
+++ b/src/Main/Forms/VolumePasswordPanel.h
@@ -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;
diff --git a/src/Main/Forms/VolumePasswordWizardPage.cpp b/src/Main/Forms/VolumePasswordWizardPage.cpp
index 274a59f5..859a613a 100644
--- a/src/Main/Forms/VolumePasswordWizardPage.cpp
+++ b/src/Main/Forms/VolumePasswordWizardPage.cpp
@@ -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);
diff --git a/src/Main/Forms/VolumePasswordWizardPage.h b/src/Main/Forms/VolumePasswordWizardPage.h
index a9a2872c..525db216 100644
--- a/src/Main/Forms/VolumePasswordWizardPage.h
+++ b/src/Main/Forms/VolumePasswordWizardPage.h
@@ -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); }
diff --git a/src/Main/Forms/VolumePropertiesDialog.cpp b/src/Main/Forms/VolumePropertiesDialog.cpp
index 4332e844..3bba33bc 100644
--- a/src/Main/Forms/VolumePropertiesDialog.cpp
+++ b/src/Main/Forms/VolumePropertiesDialog.cpp
@@ -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;
diff --git a/src/Main/Forms/WaitDialog.cpp b/src/Main/Forms/WaitDialog.cpp
index 720c2bdc..d53656f9 100644
--- a/src/Main/Forms/WaitDialog.cpp
+++ b/src/Main/Forms/WaitDialog.cpp
@@ -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);
diff --git a/src/Main/GraphicUserInterface.cpp b/src/Main/GraphicUserInterface.cpp
index 6786e9a8..16db8f83 100644
--- a/src/Main/GraphicUserInterface.cpp
+++ b/src/Main/GraphicUserInterface.cpp
@@ -191,7 +191,6 @@ namespace VeraCrypt
options->Password,
options->Pim,
options->Kdf,
- false,
options->Keyfiles,
options->EMVSupportEnabled,
options->Protection,
@@ -220,7 +219,6 @@ namespace VeraCrypt
options->Password,
options->Pim,
options->Kdf,
- false,
options->Keyfiles,
options->EMVSupportEnabled,
options->Protection,
@@ -835,7 +833,7 @@ namespace VeraCrypt
options.Keyfiles = make_shared <KeyfileList> (GetPreferences().DefaultKeyfiles);
if ((options.Password && !options.Password->IsEmpty())
- || (options.Keyfiles && !options.Keyfiles->empty() && (options.TrueCryptMode || options.Password)))
+ || (options.Keyfiles && !options.Keyfiles->empty() && options.Password))
{
try
{
@@ -1466,7 +1464,6 @@ namespace VeraCrypt
options.Password,
options.Pim,
options.Kdf,
- options.TrueCryptMode,
options.Keyfiles,
options.EMVSupportEnabled,
options.Protection,
@@ -1583,11 +1580,11 @@ namespace VeraCrypt
// Decrypt header
shared_ptr <VolumePassword> passwordKey = Keyfile::ApplyListToPassword (options.Keyfiles, options.Password, options.EMVSupportEnabled);
- Pkcs5KdfList keyDerivationFunctions = layout->GetSupportedKeyDerivationFunctions(options.TrueCryptMode);
+ Pkcs5KdfList keyDerivationFunctions = layout->GetSupportedKeyDerivationFunctions();
EncryptionAlgorithmList encryptionAlgorithms = layout->GetSupportedEncryptionAlgorithms();
EncryptionModeList encryptionModes = layout->GetSupportedEncryptionModes();
- DecryptThreadRoutine decryptRoutine(layout->GetHeader(), headerBuffer, *passwordKey, options.Pim, options.Kdf, options.TrueCryptMode, keyDerivationFunctions, encryptionAlgorithms, encryptionModes);
+ DecryptThreadRoutine decryptRoutine(layout->GetHeader(), headerBuffer, *passwordKey, options.Pim, options.Kdf, keyDerivationFunctions, encryptionAlgorithms, encryptionModes);
ExecuteWaitThreadRoutine (parent, &decryptRoutine);
diff --git a/src/Main/GraphicUserInterface.h b/src/Main/GraphicUserInterface.h
index 820a4831..d48b7973 100644
--- a/src/Main/GraphicUserInterface.h
+++ b/src/Main/GraphicUserInterface.h
@@ -34,7 +34,7 @@ namespace VeraCrypt
virtual void BackupVolumeHeaders (shared_ptr <VolumePath> volumePath) const;
virtual void BeginBusyState () const { wxBeginBusyCursor(); }
virtual void BeginInteractiveBusyState (wxWindow *window);
- virtual void ChangePassword (shared_ptr <VolumePath> volumePath = shared_ptr <VolumePath>(), shared_ptr <VolumePassword> password = shared_ptr <VolumePassword>(), int pim = 0, shared_ptr <Hash> currentHash = shared_ptr <Hash>(), bool truecryptMode = false, shared_ptr <KeyfileList> keyfiles = shared_ptr <KeyfileList>(), shared_ptr <VolumePassword> newPassword = shared_ptr <VolumePassword>(), int newPim = 0, shared_ptr <KeyfileList> newKeyfiles = shared_ptr <KeyfileList>(), shared_ptr <Hash> newHash = shared_ptr <Hash>()) const { ThrowTextModeRequired(); }
+ virtual void ChangePassword (shared_ptr <VolumePath> volumePath = shared_ptr <VolumePath>(), shared_ptr <VolumePassword> password = shared_ptr <VolumePassword>(), int pim = 0, shared_ptr <Hash> currentHash = shared_ptr <Hash>(), shared_ptr <KeyfileList> keyfiles = shared_ptr <KeyfileList>(), shared_ptr <VolumePassword> newPassword = shared_ptr <VolumePassword>(), int newPim = 0, shared_ptr <KeyfileList> newKeyfiles = shared_ptr <KeyfileList>(), shared_ptr <Hash> newHash = shared_ptr <Hash>()) const { ThrowTextModeRequired(); }
wxHyperlinkCtrl *CreateHyperlink (wxWindow *parent, const wxString &linkUrl, const wxString &linkText) const;
virtual void CreateKeyfile (shared_ptr <FilePath> keyfilePath = shared_ptr <FilePath>()) const;
virtual void CreateVolume (shared_ptr <VolumeCreationOptions> options) const { ThrowTextModeRequired(); }
diff --git a/src/Main/TextUserInterface.cpp b/src/Main/TextUserInterface.cpp
index 22df8e1f..37b346bd 100644
--- a/src/Main/TextUserInterface.cpp
+++ b/src/Main/TextUserInterface.cpp
@@ -277,7 +277,7 @@ namespace VeraCrypt
shared_ptr <Pkcs5Kdf> kdf;
if (CmdLine->ArgHash)
{
- kdf = Pkcs5Kdf::GetAlgorithm (*CmdLine->ArgHash, false);
+ kdf = Pkcs5Kdf::GetAlgorithm (*CmdLine->ArgHash);
}
shared_ptr <Volume> normalVolume;
@@ -315,7 +315,6 @@ namespace VeraCrypt
options->Password,
options->Pim,
kdf,
- false,
options->Keyfiles,
options->EMVSupportEnabled,
options->Protection,
@@ -341,7 +340,6 @@ namespace VeraCrypt
options->Password,
options->Pim,
kdf,
- false,
options->Keyfiles,
options->EMVSupportEnabled,
options->Protection,
@@ -437,7 +435,7 @@ namespace VeraCrypt
ShowInfo ("VOL_HEADER_BACKED_UP");
}
- void TextUserInterface::ChangePassword (shared_ptr <VolumePath> volumePath, shared_ptr <VolumePassword> password, int pim, shared_ptr <Hash> currentHash, bool truecryptMode, shared_ptr <KeyfileList> keyfiles, shared_ptr <VolumePassword> newPassword, int newPim, shared_ptr <KeyfileList> newKeyfiles, shared_ptr <Hash> newHash) const
+ void TextUserInterface::ChangePassword (shared_ptr <VolumePath> volumePath, shared_ptr <VolumePassword> password, int pim, shared_ptr <Hash> currentHash, shared_ptr <KeyfileList> keyfiles, shared_ptr <VolumePassword> newPassword, int newPim, shared_ptr <KeyfileList> newKeyfiles, shared_ptr <Hash> newHash) const
{
shared_ptr <Volume> volume;
@@ -459,7 +457,7 @@ namespace VeraCrypt
shared_ptr<Pkcs5Kdf> kdf;
if (currentHash)
{
- kdf = Pkcs5Kdf::GetAlgorithm (*currentHash, truecryptMode);
+ kdf = Pkcs5Kdf::GetAlgorithm (*currentHash);
}
while (true)
@@ -475,7 +473,7 @@ namespace VeraCrypt
}
// current PIM
- if (!truecryptMode && !Preferences.NonInteractive && (pim < 0))
+ if (!Preferences.NonInteractive && (pim < 0))
{
pim = AskPim (_("Enter current PIM"));
}
@@ -489,7 +487,7 @@ namespace VeraCrypt
try
{
keyfiles.reset (new KeyfileList);
- volume = Core->OpenVolume (volumePath, Preferences.DefaultMountOptions.PreserveTimestamps, password, pim, kdf, truecryptMode, keyfiles, true);
+ volume = Core->OpenVolume (volumePath, Preferences.DefaultMountOptions.PreserveTimestamps, password, pim, kdf, keyfiles, true);
}
catch (PasswordException&)
{
@@ -499,7 +497,7 @@ namespace VeraCrypt
}
if (!volume.get())
- volume = Core->OpenVolume (volumePath, Preferences.DefaultMountOptions.PreserveTimestamps, password, pim, kdf, truecryptMode, keyfiles, true);
+ volume = Core->OpenVolume (volumePath, Preferences.DefaultMountOptions.PreserveTimestamps, password, pim, kdf, keyfiles, true);
}
catch (PasswordException &e)
{
@@ -535,7 +533,7 @@ namespace VeraCrypt
UserEnrichRandomPool();
Core->ChangePassword (volume, newPassword, newPim, newKeyfiles, true,
- newHash ? Pkcs5Kdf::GetAlgorithm (*newHash, false) : shared_ptr <Pkcs5Kdf>());
+ newHash ? Pkcs5Kdf::GetAlgorithm (*newHash) : shared_ptr <Pkcs5Kdf>());
ShowInfo ("PASSWORD_CHANGED");
}
@@ -815,7 +813,7 @@ namespace VeraCrypt
shared_ptr <Hash> selectedHash = hashes[AskSelection (hashes.size(), 1) - 1];
RandomNumberGenerator::SetHash (selectedHash);
- options->VolumeHeaderKdf = Pkcs5Kdf::GetAlgorithm (*selectedHash, false);
+ options->VolumeHeaderKdf = Pkcs5Kdf::GetAlgorithm (*selectedHash);
}
@@ -1266,7 +1264,7 @@ namespace VeraCrypt
if (!options.Password)
options.Password = AskPassword();
- if (!options.TrueCryptMode && (options.Pim < 0))
+ if (options.Pim < 0)
options.Pim = AskPim (_("Enter PIM"));
if (!options.Keyfiles)
@@ -1336,7 +1334,7 @@ namespace VeraCrypt
options.Password = AskPassword (StringFormatter (_("Enter password for {0}"), wstring (*options.Path)));
}
- if (!options.TrueCryptMode && (options.Pim < 0))
+ if (options.Pim < 0)
{
options.Pim = AskPim (StringFormatter (_("Enter PIM for {0}"), wstring (*options.Path)));
}
@@ -1355,7 +1353,7 @@ namespace VeraCrypt
{
if (!options.ProtectionPassword)
options.ProtectionPassword = AskPassword (_("Enter password for hidden volume"));
- if (!options.TrueCryptMode && (options.ProtectionPim < 0))
+ if (options.ProtectionPim < 0)
options.ProtectionPim = AskPim (_("Enter PIM for hidden volume"));
if (!options.ProtectionKeyfiles)
options.ProtectionKeyfiles = AskKeyfiles (_("Enter keyfile for hidden volume"));
@@ -1504,7 +1502,7 @@ namespace VeraCrypt
shared_ptr <Pkcs5Kdf> kdf;
if (CmdLine->ArgHash)
{
- kdf = Pkcs5Kdf::GetAlgorithm (*CmdLine->ArgHash, false);
+ kdf = Pkcs5Kdf::GetAlgorithm (*CmdLine->ArgHash);
}
ShowInfo (LangString["HEADER_RESTORE_EXTERNAL_INTERNAL"]);
@@ -1551,7 +1549,6 @@ namespace VeraCrypt
options.Password,
options.Pim,
kdf,
- false,
options.Keyfiles,
options.EMVSupportEnabled,
options.Protection,
@@ -1660,7 +1657,7 @@ namespace VeraCrypt
// Decrypt header
shared_ptr <VolumePassword> passwordKey = Keyfile::ApplyListToPassword (options.Keyfiles, options.Password, options.EMVSupportEnabled);
- if (layout->GetHeader()->Decrypt (headerBuffer, *passwordKey, options.Pim, kdf, false, layout->GetSupportedKeyDerivationFunctions(false), layout->GetSupportedEncryptionAlgorithms(), layout->GetSupportedEncryptionModes()))
+ if (layout->GetHeader()->Decrypt (headerBuffer, *passwordKey, options.Pim, kdf, layout->GetSupportedKeyDerivationFunctions(), layout->GetSupportedEncryptionAlgorithms(), layout->GetSupportedEncryptionModes()))
{
decryptedLayout = layout;
break;
diff --git a/src/Main/TextUserInterface.h b/src/Main/TextUserInterface.h
index dc16fe97..becb1d59 100644
--- a/src/Main/TextUserInterface.h
+++ b/src/Main/TextUserInterface.h
@@ -35,7 +35,7 @@ namespace VeraCrypt
virtual bool AskYesNo (const wxString &message, bool defaultYes = false, bool warning = false) const;
virtual void BackupVolumeHeaders (shared_ptr <VolumePath> volumePath) const;
virtual void BeginBusyState () const { }
- virtual void ChangePassword (shared_ptr <VolumePath> volumePath = shared_ptr <VolumePath>(), shared_ptr <VolumePassword> password = shared_ptr <VolumePassword>(), int pim = 0, shared_ptr <Hash> currentHash = shared_ptr <Hash>(), bool truecryptMode = false, shared_ptr <KeyfileList> keyfiles = shared_ptr <KeyfileList>(), shared_ptr <VolumePassword> newPassword = shared_ptr <VolumePassword>(), int newPim = 0, shared_ptr <KeyfileList> newKeyfiles = shared_ptr <KeyfileList>(), shared_ptr <Hash> newHash = shared_ptr <Hash>()) const;
+ virtual void ChangePassword (shared_ptr <VolumePath> volumePath = shared_ptr <VolumePath>(), shared_ptr <VolumePassword> password = shared_ptr <VolumePassword>(), int pim = 0, shared_ptr <Hash> currentHash = shared_ptr <Hash>(), shared_ptr <KeyfileList> keyfiles = shared_ptr <KeyfileList>(), shared_ptr <VolumePassword> newPassword = shared_ptr <VolumePassword>(), int newPim = 0, shared_ptr <KeyfileList> newKeyfiles = shared_ptr <KeyfileList>(), shared_ptr <Hash> newHash = shared_ptr <Hash>()) const;
virtual void CreateKeyfile (shared_ptr <FilePath> keyfilePath = shared_ptr <FilePath>()) const;
virtual void CreateVolume (shared_ptr <VolumeCreationOptions> options) const;
virtual void DeleteSecurityTokenKeyfiles () const;
diff --git a/src/Main/UserInterface.cpp b/src/Main/UserInterface.cpp
index 05f254ea..822c53c7 100644
--- a/src/Main/UserInterface.cpp
+++ b/src/Main/UserInterface.cpp
@@ -255,7 +255,7 @@ namespace VeraCrypt
#endif
prop << LangString["MOUNT_POINT"] << L": " << wstring (volume.MountPoint) << L'\n';
prop << LangString["SIZE"] << L": " << SizeToString (volume.Size) << L'\n';
- prop << LangString["TYPE"] << L": " << VolumeTypeToString (volume.Type, volume.TrueCryptMode, volume.Protection) << L'\n';
+ prop << LangString["TYPE"] << L": " << VolumeTypeToString (volume.Type, volume.Protection) << L'\n';
prop << LangString["READ_ONLY"] << L": " << LangString [volume.Protection == VolumeProtection::ReadOnly ? "UISTR_YES" : "UISTR_NO"] << L'\n';
@@ -527,8 +527,6 @@ namespace VeraCrypt
EX2MSG (VolumeEncryptionNotCompleted, LangString["ERR_ENCRYPTION_NOT_COMPLETED"]);
EX2MSG (VolumeHostInUse, LangString["LINUX_EX2MSG_VOLUMEHOSTINUSE"]);
EX2MSG (VolumeSlotUnavailable, LangString["LINUX_EX2MSG_VOLUMESLOTUNAVAILABLE"]);
- EX2MSG (UnsupportedAlgoInTrueCryptMode, LangString["ALGO_NOT_SUPPORTED_FOR_TRUECRYPT_MODE"]);
- EX2MSG (UnsupportedTrueCryptFormat, LangString["UNSUPPORTED_TRUECRYPT_FORMAT"]);
#ifdef TC_MACOSX
EX2MSG (HigherFuseVersionRequired, LangString["LINUX_EX2MSG_HIGHERFUSEVERSIONREQUIRED"]);
@@ -967,10 +965,9 @@ namespace VeraCrypt
cmdLine.ArgMountOptions.Pim = cmdLine.ArgPim;
cmdLine.ArgMountOptions.Keyfiles = cmdLine.ArgKeyfiles;
cmdLine.ArgMountOptions.SharedAccessAllowed = cmdLine.ArgForce;
- cmdLine.ArgMountOptions.TrueCryptMode = cmdLine.ArgTrueCryptMode;
if (cmdLine.ArgHash)
{
- cmdLine.ArgMountOptions.Kdf = Pkcs5Kdf::GetAlgorithm (*cmdLine.ArgHash, cmdLine.ArgTrueCryptMode);
+ cmdLine.ArgMountOptions.Kdf = Pkcs5Kdf::GetAlgorithm (*cmdLine.ArgHash);
}
@@ -1055,7 +1052,7 @@ namespace VeraCrypt
return true;
case CommandId::ChangePassword:
- ChangePassword (cmdLine.ArgVolumePath, cmdLine.ArgPassword, cmdLine.ArgPim, cmdLine.ArgHash, cmdLine.ArgTrueCryptMode, cmdLine.ArgKeyfiles, cmdLine.ArgNewPassword, cmdLine.ArgNewPim, cmdLine.ArgNewKeyfiles, cmdLine.ArgNewHash);
+ ChangePassword (cmdLine.ArgVolumePath, cmdLine.ArgPassword, cmdLine.ArgPim, cmdLine.ArgHash, cmdLine.ArgKeyfiles, cmdLine.ArgNewPassword, cmdLine.ArgNewPim, cmdLine.ArgNewKeyfiles, cmdLine.ArgNewHash);
return true;
case CommandId::CreateKeyfile:
@@ -1068,7 +1065,7 @@ namespace VeraCrypt
if (cmdLine.ArgHash)
{
- options->VolumeHeaderKdf = Pkcs5Kdf::GetAlgorithm (*cmdLine.ArgHash, false);
+ options->VolumeHeaderKdf = Pkcs5Kdf::GetAlgorithm (*cmdLine.ArgHash);
RandomNumberGenerator::SetHash (cmdLine.ArgHash);
}
@@ -1324,11 +1321,6 @@ namespace VeraCrypt
" Use text user interface. Graphical user interface is used by default if\n"
" available. This option must be specified as the first argument.\n"
"\n"
- "-tc, --truecrypt\n"
- " Enable TrueCrypt compatibility mode to enable mounting volumes created\n"
- " by TrueCrypt 6.x or 7.x. This option must be specified as the first\n"
- " argument, or immediately after --text.\n"
- "\n"
"--token-lib=LIB_PATH\n"
" Use specified PKCS #11 security token library.\n"
"\n"
@@ -1600,7 +1592,7 @@ namespace VeraCrypt
return dateStr;
}
- wxString UserInterface::VolumeTypeToString (VolumeType::Enum type, bool truecryptMode, VolumeProtection::Enum protection) const
+ wxString UserInterface::VolumeTypeToString (VolumeType::Enum type, VolumeProtection::Enum protection) const
{
wxString sResult;
switch (type)
@@ -1618,8 +1610,6 @@ namespace VeraCrypt
break;
}
- if (truecryptMode)
- sResult = wxT("TrueCrypt-") + sResult;
return sResult;
}
@@ -1693,8 +1683,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);
diff --git a/src/Main/UserInterface.h b/src/Main/UserInterface.h
index 39c2be61..41415e9d 100644
--- a/src/Main/UserInterface.h
+++ b/src/Main/UserInterface.h
@@ -33,7 +33,7 @@ namespace VeraCrypt
virtual bool AskYesNo (const wxString &message, bool defaultYes = false, bool warning = false) const = 0;
virtual void BackupVolumeHeaders (shared_ptr <VolumePath> volumePath) const = 0;
virtual void BeginBusyState () const = 0;
- virtual void ChangePassword (shared_ptr <VolumePath> volumePath = shared_ptr <VolumePath>(), shared_ptr <VolumePassword> password = shared_ptr <VolumePassword>(), int pim = 0, shared_ptr <Hash> currentHash = shared_ptr <Hash>(), bool truecryptMode = false, shared_ptr <KeyfileList> keyfiles = shared_ptr <KeyfileList>(), shared_ptr <VolumePassword> newPassword = shared_ptr <VolumePassword>(), int newPim = 0, shared_ptr <KeyfileList> newKeyfiles = shared_ptr <KeyfileList>(), shared_ptr <Hash> newHash = shared_ptr <Hash>()) const = 0;
+ virtual void ChangePassword (shared_ptr <VolumePath> volumePath = shared_ptr <VolumePath>(), shared_ptr <VolumePassword> password = shared_ptr <VolumePassword>(), int pim = 0, shared_ptr <Hash> currentHash = shared_ptr <Hash>(), shared_ptr <KeyfileList> keyfiles = shared_ptr <KeyfileList>(), shared_ptr <VolumePassword> newPassword = shared_ptr <VolumePassword>(), int newPim = 0, shared_ptr <KeyfileList> newKeyfiles = shared_ptr <KeyfileList>(), shared_ptr <Hash> newHash = shared_ptr <Hash>()) const = 0;
virtual void CheckRequirementsForMountingVolume () const;
virtual void CloseExplorerWindows (shared_ptr <VolumeInfo> mountedVolume) const;
virtual void CreateKeyfile (shared_ptr <FilePath> keyfilePath = shared_ptr <FilePath>()) const = 0;
@@ -85,7 +85,7 @@ namespace VeraCrypt
virtual WaitThreadUI* GetWaitThreadUI(WaitThreadRoutine *pRoutine) const { return new WaitThreadUI(pRoutine);}
virtual wxDateTime VolumeTimeToDateTime (VolumeTime volumeTime) const { return wxDateTime ((time_t) (volumeTime / 1000ULL / 1000 / 10 - 134774ULL * 24 * 3600)); }
virtual wxString VolumeTimeToString (VolumeTime volumeTime) const;
- virtual wxString VolumeTypeToString (VolumeType::Enum type, bool truecryptMode, VolumeProtection::Enum protection) const;
+ virtual wxString VolumeTypeToString (VolumeType::Enum type, VolumeProtection::Enum protection) const;
Event PreferencesUpdatedEvent;
diff --git a/src/Main/UserPreferences.cpp b/src/Main/UserPreferences.cpp
index ef14b2c8..9dbd35f6 100644
--- a/src/Main/UserPreferences.cpp
+++ b/src/Main/UserPreferences.cpp
@@ -110,8 +110,6 @@ namespace VeraCrypt
TC_CONFIG_SET (WipeCacheOnAutoDismount);
TC_CONFIG_SET (WipeCacheOnClose);
- SetValue (configMap[L"DefaultTrueCryptMode"], DefaultMountOptions.TrueCryptMode);
-
wstring defaultPrf;
SetValue (configMap[L"DefaultPRF"], defaultPrf);
@@ -119,7 +117,7 @@ namespace VeraCrypt
try
{
if (defaultPrf != L"autodetection")
- savedKdf = Pkcs5Kdf::GetAlgorithm (defaultPrf, DefaultMountOptions.TrueCryptMode);
+ savedKdf = Pkcs5Kdf::GetAlgorithm (defaultPrf);
}
catch (ParameterIncorrect&)
{
@@ -225,8 +223,6 @@ namespace VeraCrypt
TC_CONFIG_ADD (WipeCacheOnAutoDismount);
TC_CONFIG_ADD (WipeCacheOnClose);
- formatter.AddEntry (L"DefaultTrueCryptMode", DefaultMountOptions.TrueCryptMode);
-
wstring defaultPrf = L"autodetection";
if (DefaultMountOptions.Kdf)
defaultPrf = DefaultMountOptions.Kdf->GetName ();