VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Main/Forms
diff options
context:
space:
mode:
Diffstat (limited to 'src/Main/Forms')
-rwxr-xr-x[-rw-r--r--]src/Main/Forms/ChangePasswordDialog.cpp4
-rwxr-xr-x[-rw-r--r--]src/Main/Forms/MountOptionsDialog.cpp6
-rw-r--r--src/Main/Forms/VolumeCreationWizard.cpp3
-rw-r--r--src/Main/Forms/VolumeCreationWizard.h1
-rwxr-xr-x[-rw-r--r--]src/Main/Forms/VolumePasswordPanel.cpp14
-rwxr-xr-x[-rw-r--r--]src/Main/Forms/VolumePasswordPanel.h2
-rwxr-xr-x[-rw-r--r--]src/Main/Forms/VolumePasswordWizardPage.cpp2
-rw-r--r--src/Main/Forms/VolumePasswordWizardPage.h1
8 files changed, 22 insertions, 11 deletions
diff --git a/src/Main/Forms/ChangePasswordDialog.cpp b/src/Main/Forms/ChangePasswordDialog.cpp
index 83186c05..e07b7d3b 100644..100755
--- a/src/Main/Forms/ChangePasswordDialog.cpp
+++ b/src/Main/Forms/ChangePasswordDialog.cpp
@@ -47,7 +47,7 @@ namespace VeraCrypt
throw ParameterIncorrect (SRC_POS);
}
- CurrentPasswordPanel = new VolumePasswordPanel (this, password, keyfiles);
+ CurrentPasswordPanel = new VolumePasswordPanel (this, password, keyfiles, false, true, true, false, true, true);
CurrentPasswordPanel->UpdateEvent.Connect (EventConnector <ChangePasswordDialog> (this, &ChangePasswordDialog::OnPasswordPanelUpdate));
CurrentPasswordPanelSizer->Add (CurrentPasswordPanel, 1, wxALL | wxEXPAND);
@@ -125,7 +125,7 @@ namespace VeraCrypt
#endif
wxBusyCursor busy;
Core->ChangePassword (Path, Gui->GetPreferences().DefaultMountOptions.PreserveTimestamps,
- CurrentPasswordPanel->GetPassword(), CurrentPasswordPanel->GetKeyfiles(),
+ CurrentPasswordPanel->GetPassword(), CurrentPasswordPanel->GetPkcs5Kdf(), CurrentPasswordPanel->GetKeyfiles(),
newPassword, newKeyfiles, NewPasswordPanel->GetPkcs5Kdf(), NewPasswordPanel->GetHeaderWipeCount());
}
diff --git a/src/Main/Forms/MountOptionsDialog.cpp b/src/Main/Forms/MountOptionsDialog.cpp
index 69d821c2..1ddb7793 100644..100755
--- a/src/Main/Forms/MountOptionsDialog.cpp
+++ b/src/Main/Forms/MountOptionsDialog.cpp
@@ -30,7 +30,7 @@ namespace VeraCrypt
if (disableMountOptions)
OptionsButton->Show (false);
- PasswordPanel = new VolumePasswordPanel (this, options.Password, options.Keyfiles, !disableMountOptions);
+ PasswordPanel = new VolumePasswordPanel (this, options.Password, options.Keyfiles, !disableMountOptions, true, true, false, true, true);
PasswordPanel->SetCacheCheckBoxValidator (wxGenericValidator (&Options.CachePassword));
PasswordSizer->Add (PasswordPanel, 1, wxALL | wxEXPAND);
@@ -61,7 +61,7 @@ namespace VeraCrypt
OptionsButton->SetLabel (OptionsButtonLabel + L" >");
OptionsPanel->Show (false);
- ProtectionPasswordPanel = new VolumePasswordPanel (OptionsPanel, options.ProtectionPassword, options.ProtectionKeyfiles, false, true, true, false, false, _("P&assword to hidden volume:"));
+ ProtectionPasswordPanel = new VolumePasswordPanel (OptionsPanel, options.ProtectionPassword, options.ProtectionKeyfiles, false, true, true, false, true, true, _("P&assword to hidden volume:"));
ProtectionPasswordSizer->Add (ProtectionPasswordPanel, 1, wxALL | wxEXPAND);
UpdateDialog();
@@ -85,6 +85,7 @@ namespace VeraCrypt
TransferDataFromWindow();
Options.Password = PasswordPanel->GetPassword();
+ Options.Kdf = PasswordPanel->GetPkcs5Kdf();
Options.Keyfiles = PasswordPanel->GetKeyfiles();
if (ReadOnlyCheckBox->IsChecked())
@@ -95,6 +96,7 @@ namespace VeraCrypt
{
Options.Protection = VolumeProtection::HiddenVolumeReadOnly;
Options.ProtectionPassword = ProtectionPasswordPanel->GetPassword();
+ Options.ProtectionKdf = ProtectionPasswordPanel->GetPkcs5Kdf();
Options.ProtectionKeyfiles = ProtectionPasswordPanel->GetKeyfiles();
}
else
diff --git a/src/Main/Forms/VolumeCreationWizard.cpp b/src/Main/Forms/VolumeCreationWizard.cpp
index 597d014a..1dac1315 100644
--- a/src/Main/Forms/VolumeCreationWizard.cpp
+++ b/src/Main/Forms/VolumeCreationWizard.cpp
@@ -699,6 +699,7 @@ namespace VeraCrypt
{
VolumePasswordWizardPage *page = dynamic_cast <VolumePasswordWizardPage *> (GetCurrentPage());
Password = page->GetPassword();
+ Kdf = page->GetPkcs5Kdf();
Keyfiles = page->GetKeyfiles();
if (forward && Password && !Password->IsEmpty())
@@ -937,7 +938,7 @@ namespace VeraCrypt
});
#endif
- shared_ptr <Volume> outerVolume = Core->OpenVolume (make_shared <VolumePath> (SelectedVolumePath), true, Password, Keyfiles, VolumeProtection::ReadOnly);
+ shared_ptr <Volume> outerVolume = Core->OpenVolume (make_shared <VolumePath> (SelectedVolumePath), true, Password, Kdf, Keyfiles, VolumeProtection::ReadOnly);
MaxHiddenVolumeSize = Core->GetMaxHiddenVolumeSize (outerVolume);
// Add a reserve (in case the user mounts the outer volume and creates new files
diff --git a/src/Main/Forms/VolumeCreationWizard.h b/src/Main/Forms/VolumeCreationWizard.h
index abbf64cb..3a87c4cb 100644
--- a/src/Main/Forms/VolumeCreationWizard.h
+++ b/src/Main/Forms/VolumeCreationWizard.h
@@ -73,6 +73,7 @@ namespace VeraCrypt
VolumeHostType::Enum SelectedVolumeHostType;
VolumeType::Enum SelectedVolumeType;
shared_ptr <VolumePassword> Password;
+ shared_ptr <Pkcs5Kdf> Kdf;
uint32 SectorSize;
shared_ptr <Hash> SelectedHash;
uint64 VolumeSize;
diff --git a/src/Main/Forms/VolumePasswordPanel.cpp b/src/Main/Forms/VolumePasswordPanel.cpp
index 5b1b9db6..50f3eca2 100644..100755
--- a/src/Main/Forms/VolumePasswordPanel.cpp
+++ b/src/Main/Forms/VolumePasswordPanel.cpp
@@ -14,7 +14,7 @@
namespace VeraCrypt
{
- VolumePasswordPanel::VolumePasswordPanel (wxWindow* parent, shared_ptr <VolumePassword> password, shared_ptr <KeyfileList> keyfiles, bool enableCache, bool enablePassword, bool enableKeyfiles, bool enableConfirmation, bool enablePkcs5Prf, const wxString &passwordLabel)
+ VolumePasswordPanel::VolumePasswordPanel (wxWindow* parent, 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), Keyfiles (new KeyfileList)
{
if (keyfiles)
@@ -63,14 +63,20 @@ namespace VeraCrypt
Pkcs5PrfStaticText->Show (enablePkcs5Prf);
Pkcs5PrfChoice->Show (enablePkcs5Prf);
- HeaderWipeCountText->Show (enablePkcs5Prf);
- HeaderWipeCount->Show (enablePkcs5Prf);
+ HeaderWipeCountText->Show (enablePkcs5Prf && !isMountPassword);
+ HeaderWipeCount->Show (enablePkcs5Prf && !isMountPassword);
if (enablePkcs5Prf)
{
+ if (isMountPassword)
+ {
+ // case of password for mounting
+ Pkcs5PrfChoice->Delete (0);
+ Pkcs5PrfChoice->Append (LangString["AUTODETECTION"]);
+ }
foreach_ref (const Pkcs5Kdf &kdf, Pkcs5Kdf::GetAvailableAlgorithms())
{
- if (!kdf.IsDeprecated())
+ if (!kdf.IsDeprecated() || isMountPassword)
Pkcs5PrfChoice->Append (kdf.GetName());
}
Pkcs5PrfChoice->Select (0);
diff --git a/src/Main/Forms/VolumePasswordPanel.h b/src/Main/Forms/VolumePasswordPanel.h
index f7f6e7cb..465a430a 100644..100755
--- a/src/Main/Forms/VolumePasswordPanel.h
+++ b/src/Main/Forms/VolumePasswordPanel.h
@@ -18,7 +18,7 @@ namespace VeraCrypt
class VolumePasswordPanel : public VolumePasswordPanelBase
{
public:
- VolumePasswordPanel (wxWindow* parent, shared_ptr <VolumePassword> password, shared_ptr <KeyfileList> keyfiles, bool enableCache = false, bool enablePassword = true, bool enableKeyfiles = true, bool enableConfirmation = false, bool enablePkcs5Prf = false, const wxString &passwordLabel = wxString());
+ VolumePasswordPanel (wxWindow* parent, 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);
diff --git a/src/Main/Forms/VolumePasswordWizardPage.cpp b/src/Main/Forms/VolumePasswordWizardPage.cpp
index 1034c220..61ff999f 100644..100755
--- a/src/Main/Forms/VolumePasswordWizardPage.cpp
+++ b/src/Main/Forms/VolumePasswordWizardPage.cpp
@@ -15,7 +15,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, password, keyfiles, false, true, true, enableConfirmation);
+ PasswordPanel = new VolumePasswordPanel (this, 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 8aaf30d6..13a98c62 100644
--- a/src/Main/Forms/VolumePasswordWizardPage.h
+++ b/src/Main/Forms/VolumePasswordWizardPage.h
@@ -22,6 +22,7 @@ namespace VeraCrypt
shared_ptr <KeyfileList> GetKeyfiles () const { return PasswordPanel->GetKeyfiles(); }
shared_ptr <VolumePassword> GetPassword () const { return PasswordPanel->GetPassword(); }
+ 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); }