1
0
mirror of https://github.com/veracrypt/VeraCrypt.git synced 2025-11-11 19:08:26 -06:00

Linux/MacOSX: use command line values of TrueCryptMode and PRF as defaults for the password dialog

This commit is contained in:
Mounir IDRASSI
2015-01-26 10:14:09 +01:00
parent 3d8d088b06
commit d01fa11983
6 changed files with 33 additions and 9 deletions

View File

@@ -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))