VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Main/Forms/VolumePasswordPanel.cpp
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2015-01-26 10:14:09 +0100
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2015-02-08 10:07:33 +0100
commitd01fa1198337f0f088c2b61484eb6678bb363598 (patch)
tree1d00add99f768d398265f9e8f5f8fb2211880b93 /src/Main/Forms/VolumePasswordPanel.cpp
parent3d8d088b0646688fe567a36d5ab4a033e2d4505a (diff)
downloadVeraCrypt-d01fa1198337f0f088c2b61484eb6678bb363598.tar.gz
VeraCrypt-d01fa1198337f0f088c2b61484eb6678bb363598.zip
Linux/MacOSX: use command line values of TrueCryptMode and PRF as defaults for the password dialog
Diffstat (limited to 'src/Main/Forms/VolumePasswordPanel.cpp')
-rw-r--r--src/Main/Forms/VolumePasswordPanel.cpp20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/Main/Forms/VolumePasswordPanel.cpp b/src/Main/Forms/VolumePasswordPanel.cpp
index e4582763..deab2803 100644
--- 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, 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, bool disableTruecryptMode, 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)
@@ -67,8 +67,14 @@ namespace VeraCrypt
HeaderWipeCountText->Show (enablePkcs5Prf && !isMountPassword);
HeaderWipeCount->Show (enablePkcs5Prf && !isMountPassword);
+ if (options && !disableTruecryptMode)
+ {
+ TrueCryptModeCheckBox->SetValue (options->TrueCryptMode);
+ }
+
if (enablePkcs5Prf)
{
+ int index, prfInitialIndex = 0;
if (isMountPassword)
{
// case of password for mounting
@@ -78,9 +84,17 @@ namespace VeraCrypt
foreach_ref (const Pkcs5Kdf &kdf, Pkcs5Kdf::GetAvailableAlgorithms(false))
{
if (!kdf.IsDeprecated() || isMountPassword)
- Pkcs5PrfChoice->Append (kdf.GetName());
+ {
+ index = Pkcs5PrfChoice->Append (kdf.GetName());
+ if (isMountPassword && options && options->Kdf
+ && (options->Kdf->GetName() == kdf.GetName())
+ )
+ {
+ prfInitialIndex = index;
+ }
+ }
}
- Pkcs5PrfChoice->Select (0);
+ Pkcs5PrfChoice->Select (prfInitialIndex);
}
if (!enablePkcs5Prf || (!enablePassword && !enableKeyfiles))