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

Use "KDF" instead of "PKCS5 PRF" for UI selection of KDF to use

This commit is contained in:
Mounir IDRASSI
2025-08-08 22:53:04 +09:00
parent 04648bc5ee
commit 54c39e4eb2
65 changed files with 244 additions and 189 deletions

View File

@@ -5375,7 +5375,7 @@ namespace VeraCrypt
return status;
}
// Change the PKCS-5 PRF if requested by user
// Change the KDF if requested by user
if (pkcs5 != 0)
{
cryptoInfo->pkcs5 = pkcs5;

View File

@@ -93,7 +93,7 @@ BEGIN
LTEXT "What is hidden volume protection?",IDC_LINK_HIDVOL_PROTECTION_INFO,16,220,279,10,SS_NOTIFY
RTEXT "P&assword to hidden volume:\n(if empty, cache is used)",IDT_HIDDEN_PROT_PASSWD,15,132,115,17,0,WS_EX_RIGHT
GROUPBOX "Hidden Volume Protection",IDT_HIDDEN_VOL_PROTECTION,6,101,299,136
RTEXT "PKCS-5 PRF:",IDT_PKCS5_PRF,15,155,115,17
RTEXT "KDF:",IDT_KDF,15,155,115,17
RTEXT "Volume PIM:",IDT_PIM,15,177,115,17,NOT WS_VISIBLE
LTEXT "Volume Label in Windows:",IDT_VOLUME_LABEL,12,85,115,8
CONTROL "Only create virtual device without mounting on selected drive letter",IDC_DISABLE_MOUNT_MANAGER,

View File

@@ -6507,7 +6507,7 @@ static BOOL PerformBenchmark(HWND hBenchDlg, HWND hwndDlg)
}
}
}
StringCbPrintfW (benchmarkTable[benchmarkTotalItems].name, sizeof(benchmarkTable[benchmarkTotalItems].name),L"%s", get_pkcs5_prf_name (thid));
StringCbPrintfW (benchmarkTable[benchmarkTotalItems].name, sizeof(benchmarkTable[benchmarkTotalItems].name),L"%s", get_kdf_name (thid));
benchmarkTotalItems++;
}
@@ -6687,7 +6687,7 @@ BOOL CALLBACK BenchmarkDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
nIndex = SendMessageW (hCboxList, CB_ADDSTRING, 0, (LPARAM) GetString ("ENCRYPTION_ALGORITHM"));
SendMessage (hCboxList, CB_SETITEMDATA, nIndex, (LPARAM) 0);
nIndex = SendMessageW (hCboxList, CB_ADDSTRING, 0, (LPARAM) GetString ("PKCS5_PRF"));
nIndex = SendMessageW (hCboxList, CB_ADDSTRING, 0, (LPARAM) GetString ("KDF"));
SendMessage (hCboxList, CB_SETITEMDATA, nIndex, (LPARAM) 0);
nIndex = SendMessageW (hCboxList, CB_ADDSTRING, 0, (LPARAM) GetString ("IDT_HASH_ALGO"));

View File

@@ -291,8 +291,8 @@
<entry lang="en" key="IDT_NEW_PASSWORD">Password:</entry>
<entry lang="en" key="IDT_PARALLELIZATION_OPTIONS">Thread-Based Parallelization</entry>
<entry lang="en" key="IDT_PKCS11_LIB_PATH">PKCS #11 Library Path</entry>
<entry lang="en" key="IDT_PKCS5_PRF">PKCS-5 PRF:</entry>
<entry lang="en" key="IDT_NEW_PKCS5_PRF">PKCS-5 PRF:</entry>
<entry lang="en" key="IDT_KDF">KDF:</entry>
<entry lang="en" key="IDT_NEW_KDF">KDF:</entry>
<entry lang="en" key="IDT_PW_CACHE_OPTIONS">Password Cache</entry>
<entry lang="en" key="IDT_SECURITY_OPTIONS">Security Options</entry>
<entry lang="en" key="IDT_EMV_OPTIONS">EMV Options</entry>
@@ -813,7 +813,7 @@
<entry lang="en" key="SECONDARY_KEY_SIZE_LRW">Tweak Key Size (LRW Mode)</entry>
<entry lang="en" key="BITS">bits</entry>
<entry lang="en" key="BLOCK_SIZE">Block Size</entry>
<entry lang="en" key="PKCS5_PRF">PKCS-5 PRF</entry>
<entry lang="en" key="KDF">KDF</entry>
<entry lang="en" key="PKCS5_ITERATIONS">PKCS-5 Iteration Count</entry>
<entry lang="en" key="VOLUME_CREATE_DATE">Volume Created</entry>
<entry lang="en" key="VOLUME_HEADER_DATE">Header Last Modified</entry>
@@ -1647,6 +1647,7 @@
<entry lang="en" key="IDC_DISABLE_SCREEN_PROTECTION">Disable protection against screenshots and screen recording</entry>
<entry lang="en" key="DISABLE_SCREEN_PROTECTION_WARNING">WARNING: Disabling screen protection significantly reduces security. Enable this option ONLY if you have a specific need to capture VeraCrypt's interface. This may expose sensitive data to screenshot tools and screen recording features such as Windows 11 Recall.</entry>
<entry lang="en" key="MEMORY_COST">Memory Cost</entry>
<entry lang="en" key="IDT_KDF_ALGO">KDF Algorithm</entry>
</localization>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="VeraCrypt">

View File

@@ -400,7 +400,7 @@ int ChangePwd (const wchar_t *lpszVolume, Password *oldPassword, int old_pkcs5,
goto error;
}
// Change the PKCS-5 PRF if requested by user
// Change the KDF if requested by user
if (pkcs5 != 0)
cryptoInfo->pkcs5 = pkcs5;

View File

@@ -1235,24 +1235,24 @@ cancelled:
burn (key, sizeof(key));
}
wchar_t *get_pkcs5_prf_name (int pkcs5_prf_id)
wchar_t *get_kdf_name (int kdf_id)
{
switch (pkcs5_prf_id)
switch (kdf_id)
{
case SHA512:
return L"HMAC-SHA-512";
return L"SHA512-PBKDF2";
case SHA256:
return L"HMAC-SHA-256";
return L"SHA256-PBKDF2";
case BLAKE2S:
return L"HMAC-BLAKE2s-256";
return L"BLAKE2S-PBKDF2";
case WHIRLPOOL:
return L"HMAC-Whirlpool";
return L"Whirlpool-PBKDF2";
case STREEBOG:
return L"HMAC-STREEBOG";
return L"STREEBOG-PBKDF2";
case ARGON2:
return L"Argon2";
@@ -1335,7 +1335,7 @@ void derive_key_argon2(const unsigned char *pwd, int pwd_len, const unsigned cha
#if defined (DEVICE_DRIVER) && !defined(_M_ARM64)
NTSTATUS saveStatus = STATUS_INVALID_PARAMETER;
XSTATE_SAVE SaveState;
if (IsCpuIntel() && HasSAVX())
if (HasSAVX2())
saveStatus = KeSaveExtendedProcessorState(XSTATE_MASK_GSSE, &SaveState);
#endif
if (0 != argon2id_hash_raw(

View File

@@ -42,7 +42,7 @@ void hmac_streebog (unsigned char *k, int lk, unsigned char *d, int ld);
void derive_key_streebog (const unsigned char *pwd, int pwd_len, const unsigned char *salt, int salt_len, uint32 iterations, unsigned char *dk, int dklen, long volatile *pAbortKeyDerivation);
int get_pkcs5_iteration_count (int pkcs5_prf_id, int pim, BOOL bBoot, int* pMemoryCost);
wchar_t *get_pkcs5_prf_name (int pkcs5_prf_id);
wchar_t *get_kdf_name (int kdf_id);
void derive_key_argon2(const unsigned char *pwd, int pwd_len, const unsigned char *salt, int salt_len, uint32 iterations, uint32 memcost, unsigned char *dk, int dklen, long volatile *pAbortKeyDerivation);
void get_argon2_params(int pim, int* pIterations, int* pMemcost);

View File

@@ -202,7 +202,7 @@
#define IDT_STATIC_MODAL_WAIT_DLG_INFO 5125
#define IDC_WAIT_PROGRESS_BAR 5126
#define IDC_PKCS5_PRF_ID 5127
#define IDT_PKCS5_PRF 5128
#define IDT_KDF 5128
#define IDT_PIM 5129
#define IDC_PIM 5130
#define IDC_PIM_HELP 5131

View File

@@ -2029,8 +2029,16 @@ void GetBootEncryptionAlgorithmName (PIRP irp)
wchar_t BootEncryptionAlgorithmNameW[256];
wchar_t BootPrfAlgorithmNameW[256];
GetBootEncryptionAlgorithmNameRequest *request = (GetBootEncryptionAlgorithmNameRequest *) irp->AssociatedIrp.SystemBuffer;
int prfId = BootDriveFilterExtension->Queue.CryptoInfo->pkcs5;
EAGetName (BootEncryptionAlgorithmNameW, 256, BootDriveFilterExtension->Queue.CryptoInfo->ea, 0);
HashGetName2 (BootPrfAlgorithmNameW, 256, BootDriveFilterExtension->Queue.CryptoInfo->pkcs5);
// for compatibility with old versions, we continue using hash algorithms name for PBKDF2 PRFs
// for Argon2, we use the actual name
if (prfId == ARGON2)
{
RtlStringCbCopyW (BootPrfAlgorithmNameW, sizeof (BootPrfAlgorithmNameW), L"Argon2");
}
else
HashGetName2 (BootPrfAlgorithmNameW, 256, prfId);
RtlStringCbPrintfA (request->BootEncryptionAlgorithmName, sizeof (request->BootEncryptionAlgorithmName), "%S", BootEncryptionAlgorithmNameW);
RtlStringCbPrintfA (request->BootPrfAlgorithmName, sizeof (request->BootPrfAlgorithmName), "%S", BootPrfAlgorithmNameW);

View File

@@ -95,7 +95,7 @@ BEGIN
DEFPUSHBUTTON "OK",IDOK,243,8,64,14
PUSHBUTTON "Cancel",IDCANCEL,243,25,64,14
RTEXT "Password:",IDT_PASSWORD,0,10,65,13
RTEXT "PKCS-5 PRF:",IDT_PKCS5_PRF,0,27,65,13
RTEXT "KDF:",IDT_KDF,0,27,65,13
RTEXT "Volume PIM:",IDT_PIM,0,46,65,13,NOT WS_VISIBLE
LTEXT "(Empty or 0 for default iterations)",IDC_PIM_HELP,115,46,189,8,NOT WS_VISIBLE
END

View File

@@ -459,7 +459,7 @@ BOOL CALLBACK ExtcvPasswordDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
for (i = FIRST_PRF_ID; i <= LAST_PRF_ID; i++)
{
nIndex = (int) SendMessage (hComboBox, CB_ADDSTRING, 0, (LPARAM) get_pkcs5_prf_name(i));
nIndex = (int) SendMessage (hComboBox, CB_ADDSTRING, 0, (LPARAM) get_kdf_name(i));
SendMessage (hComboBox, CB_SETITEMDATA, (WPARAM) nIndex, (LPARAM) i);
}
@@ -535,7 +535,7 @@ BOOL CALLBACK ExtcvPasswordDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
{
if (bIsGPT || HashForSystemEncryption(i))
{
nIndex = (int) SendMessage (hComboBox, CB_ADDSTRING, 0, (LPARAM) get_pkcs5_prf_name(i));
nIndex = (int) SendMessage (hComboBox, CB_ADDSTRING, 0, (LPARAM) get_kdf_name(i));
SendMessage (hComboBox, CB_SETITEMDATA, (WPARAM) nIndex, (LPARAM) i);
}
}

View File

@@ -105,7 +105,7 @@ BEGIN
COMBOBOX IDC_COMBO_BOX_HASH_ALGO,7,169,95,126,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
LTEXT "",IDC_BOX_HELP,7,40,266,78
GROUPBOX "Encryption Algorithm",IDT_ENCRYPTION_ALGO,0,10,273,131
GROUPBOX "Hash Algorithm",IDT_HASH_ALGO,0,156,273,35
GROUPBOX "KDF Algorithm",IDT_KDF_ALGO,0,156,273,35
LTEXT "More information",IDC_LINK_MORE_INFO_ABOUT_CIPHER,7,124,176,10,SS_NOTIFY
LTEXT "Information on hash algorithms",IDC_LINK_HASH_INFO,121,171,148,8,SS_NOTIFY
END
@@ -236,7 +236,7 @@ BEGIN
PUSHBUTTON "&Keyfiles...",IDC_KEY_FILES,188,54,85,14
LTEXT "",IDC_BOX_HELP,0,74,273,119
RTEXT "Password:",IDT_PASSWORD,0,6,71,8
RTEXT "PKCS-5 PRF:",IDT_PKCS5_PRF,0,19,71,8
RTEXT "KDF:",IDT_KDF,0,19,71,8
RTEXT "Volume PIM:",IDT_PIM,0,35,71,8,NOT WS_VISIBLE
CONTROL "Use P&IM",IDC_PIM_ENABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,75,35,97,10
END

View File

@@ -147,6 +147,7 @@
#define IDC_SKIP_RESCUE_VERIFICATION 1108
#define SPARSE_FILE 1109
#define IDC_FORMAT_TYPE 1110
#define IDT_KDF_ALGO 1111
// Next default values for new objects
//
@@ -155,7 +156,7 @@
#define _APS_NO_MFC 1
#define _APS_NEXT_RESOURCE_VALUE 134
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1111
#define _APS_NEXT_CONTROL_VALUE 1112
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

View File

@@ -4218,7 +4218,7 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
for (hid = FIRST_PRF_ID; hid <= LAST_PRF_ID; hid++)
{
if ((!HashIsDeprecated (hid)) && (bSystemIsGPT || HashForSystemEncryption (hid)) && (hid != ARGON2)) // We don't support Argon2 for system encryption
AddComboPair (GetDlgItem (hwndDlg, IDC_COMBO_BOX_HASH_ALGO), HashGetName(hid), hid);
AddComboPair (GetDlgItem (hwndDlg, IDC_COMBO_BOX_HASH_ALGO), get_kdf_name(hid), hid);
}
}
else
@@ -4227,7 +4227,7 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
for (hid = FIRST_PRF_ID; hid <= LAST_PRF_ID; hid++)
{
if (!HashIsDeprecated (hid))
AddComboPair (GetDlgItem (hwndDlg, IDC_COMBO_BOX_HASH_ALGO), HashGetName(hid), hid);
AddComboPair (GetDlgItem (hwndDlg, IDC_COMBO_BOX_HASH_ALGO), get_kdf_name(hid), hid);
}
}
@@ -4355,7 +4355,7 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
for (i = FIRST_PRF_ID; i <= LAST_PRF_ID; i++)
{
nIndex = (int) SendMessage (hComboBox, CB_ADDSTRING, 0, (LPARAM) get_pkcs5_prf_name(i));
nIndex = (int) SendMessage (hComboBox, CB_ADDSTRING, 0, (LPARAM) get_kdf_name(i));
SendMessage (hComboBox, CB_SETITEMDATA, nIndex, (LPARAM) i);
}
@@ -9312,6 +9312,8 @@ void ExtractCommandLine (HWND hwndDlg, wchar_t *lpszCommandLine)
CmdVolumePkcs5 = SHA256;
else if ((_wcsicmp(szTmp, L"blake2s") == 0) || (_wcsicmp(szTmp, L"blake2s-256") == 0))
CmdVolumePkcs5 = BLAKE2S;
else if ((_wcsicmp(szTmp, L"argon2") == 0))
CmdVolumePkcs5 = ARGON2;
else
{
/* match using internal hash names */

View File

@@ -109,6 +109,7 @@ static int MapHashAlgorithm(const wchar_t* hashName)
if (_wcsicmp(hashName, L"BLAKE2s") == 0) return BLAKE2S;
if (_wcsicmp(hashName, L"sha256") == 0) return SHA256;
if (_wcsicmp(hashName, L"sha512") == 0) return SHA512;
if (_wcsicmp(hashName, L"argon2") == 0) return ARGON2;
return 0; // Not found
}

View File

@@ -769,7 +769,7 @@ BenchmarkDialogBase::BenchmarkDialogBase( wxWindow* parent, wxWindowID id, const
m_staticText70->Wrap( -1 );
fgSizer9->Add( m_staticText70, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
wxString BenchmarkChoiceChoices[] = { _("ENCRYPTION_ALGORITHM"), _("PKCS5_PRF"), _("IDT_HASH_ALGO") };
wxString BenchmarkChoiceChoices[] = { _("ENCRYPTION_ALGORITHM"), _("KDF"), _("IDT_HASH_ALGO") };
int BenchmarkChoiceNChoices = sizeof( BenchmarkChoiceChoices ) / sizeof( wxString );
BenchmarkChoice = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, BenchmarkChoiceNChoices, BenchmarkChoiceChoices, 0 );
BenchmarkChoice->SetSelection( 0 );
@@ -1913,7 +1913,7 @@ PreferencesDialogBase::PreferencesDialogBase( wxWindow* parent, wxWindowID id, c
wxBoxSizer* bSizer163;
bSizer163 = new wxBoxSizer( wxHORIZONTAL );
Pkcs5PrfStaticText = new wxStaticText( sbSizer15->GetStaticBox(), wxID_ANY, _("PKCS5_PRF"), wxDefaultPosition, wxDefaultSize, 0 );
Pkcs5PrfStaticText = new wxStaticText( sbSizer15->GetStaticBox(), wxID_ANY, _("KDF"), wxDefaultPosition, wxDefaultSize, 0 );
Pkcs5PrfStaticText->Wrap( -1 );
bSizer163->Add( Pkcs5PrfStaticText, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
@@ -2694,7 +2694,7 @@ EncryptionOptionsWizardPageBase::EncryptionOptionsWizardPageBase( wxWindow* pare
bSizer95->Add( sbSizer29, 1, wxEXPAND|wxALL, 5 );
wxStaticBoxSizer* sbSizer30;
sbSizer30 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("IDT_HASH_ALGO") ), wxHORIZONTAL );
sbSizer30 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("KDF") ), wxHORIZONTAL );
wxArrayString HashChoiceChoices;
HashChoice = new wxChoice( sbSizer30->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, HashChoiceChoices, 0 );
@@ -3412,7 +3412,7 @@ VolumePasswordPanelBase::VolumePasswordPanelBase( wxWindow* parent, wxWindowID i
GridBagSizer->Add( Pkcs5PrfSizer, wxGBPosition( 8, 1 ), wxGBSpan( 1, 1 ), wxEXPAND|wxTOP|wxBOTTOM, 5 );
Pkcs5PrfStaticText = new wxStaticText( this, wxID_ANY, _("IDT_NEW_PKCS5_PRF"), wxDefaultPosition, wxDefaultSize, 0 );
Pkcs5PrfStaticText = new wxStaticText( this, wxID_ANY, _("IDT_NEW_KDF"), wxDefaultPosition, wxDefaultSize, 0 );
Pkcs5PrfStaticText->Wrap( -1 );
GridBagSizer->Add( Pkcs5PrfStaticText, wxGBPosition( 9, 0 ), wxGBSpan( 1, 1 ), wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );

View File

@@ -3595,7 +3595,7 @@
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="choices">&quot;ENCRYPTION_ALGORITHM&quot; &quot;PKCS5_PRF&quot; &quot;IDT_HASH_ALGO&quot;</property>
<property name="choices">&quot;ENCRYPTION_ALGORITHM&quot; &quot;KDF&quot; &quot;IDT_HASH_ALGO&quot;</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
@@ -11973,7 +11973,7 @@
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">PKCS5_PRF</property>
<property name="label">KDF</property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
@@ -21959,7 +21959,7 @@
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">IDT_NEW_PKCS5_PRF</property>
<property name="label">IDT_NEW_KDF</property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>

View File

@@ -62,9 +62,9 @@ namespace VeraCrypt
AppendToList ("BLOCK_SIZE", blockSize.str() + L" " + LangString ["BITS"]);
AppendToList ("MODE_OF_OPERATION", volumeInfo.EncryptionModeName);
if (volumeInfo.Pim <= 0)
AppendToList ("PKCS5_PRF", volumeInfo.Pkcs5PrfName);
AppendToList ("KDF", volumeInfo.Pkcs5PrfName);
else
AppendToList ("PKCS5_PRF", StringFormatter (L"{0} (Dynamic)", volumeInfo.Pkcs5PrfName));
AppendToList ("KDF", StringFormatter (L"{0} (Dynamic)", volumeInfo.Pkcs5PrfName));
#if 0
AppendToList ("PKCS5_ITERATIONS", StringConverter::FromNumber (volumeInfo.Pkcs5IterationCount));

View File

@@ -290,7 +290,7 @@ namespace VeraCrypt
prop << LangString["BLOCK_SIZE"] << L": " << blockSize.str() + L" " + LangString ["BITS"] << L'\n';
prop << LangString["MODE_OF_OPERATION"] << L": " << volume.EncryptionModeName << L'\n';
prop << LangString["PKCS5_PRF"] << L": " << volume.Pkcs5PrfName << L'\n';
prop << LangString["KDF"] << L": " << volume.Pkcs5PrfName << L'\n';
prop << LangString["VOLUME_FORMAT_VERSION"] << L": " << (volume.MinRequiredProgramVersion < 0x10b ? 1 : 2) << L'\n';
prop << LangString["BACKUP_HEADER"] << L": " << LangString[volume.MinRequiredProgramVersion >= 0x10b ? "UISTR_YES" : "UISTR_NO"] << L'\n';
@@ -1184,7 +1184,7 @@ const FileManager fileManagers[] = {
"\n"
"-C, --change [VOLUME_PATH]\n"
" Change a password and/or keyfile(s) of a volume. Most options are requested\n"
" from the user if not specified on command line. PKCS-5 PRF HMAC hash\n"
" from the user if not specified on command line. KDF hash\n"
" algorithm can be changed with option --hash. See also options -k,\n"
" --new-keyfiles, --new-password, -p, --random-source.\n"
"\n"

View File

@@ -950,7 +950,7 @@ namespace VeraCrypt
for (i = FIRST_PRF_ID; i <= LAST_PRF_ID; i++)
{
nIndex = (int) SendMessage (hComboBox, CB_ADDSTRING, 0, (LPARAM) get_pkcs5_prf_name(i));
nIndex = (int) SendMessage (hComboBox, CB_ADDSTRING, 0, (LPARAM) get_kdf_name(i));
SendMessage (hComboBox, CB_SETITEMDATA, nIndex, (LPARAM) i);
if (favorite.Pkcs5 == i)
nSelected = nIndex;
@@ -985,7 +985,7 @@ namespace VeraCrypt
EnableWindow (GetDlgItem (hwndDlg, IDC_FAVORITE_MOVE_UP), enable);
EnableWindow (GetDlgItem (hwndDlg, IDC_FAVORITE_MOVE_DOWN), enable);
EnableWindow (GetDlgItem (hwndDlg, IDC_FAVORITE_REMOVE), enable);
EnableWindow (GetDlgItem (hwndDlg, IDT_PKCS5_PRF), enable && !favorite.SystemEncryption);
EnableWindow (GetDlgItem (hwndDlg, IDT_KDF), enable && !favorite.SystemEncryption);
EnableWindow (GetDlgItem (hwndDlg, IDC_PKCS5_PRF_ID), enable && !favorite.SystemEncryption);
EnableWindow (GetDlgItem (hwndDlg, IDT_PIM), enable);
EnableWindow (GetDlgItem (hwndDlg, IDC_PIM), enable);

View File

@@ -2220,7 +2220,7 @@ void CALLBACK ChangePwdWaitThreadProc(void* pArg, HWND hwndDlg)
catch(...)
{}
pThreadParam->pkcs5 = 0; // PKCS-5 PRF unchanged (currently we can't change PRF of system encryption)
pThreadParam->pkcs5 = 0; // KDF unchanged (currently we can't change PRF of system encryption)
try
{
@@ -2361,7 +2361,7 @@ BOOL CALLBACK PasswordChangeDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
for (i = FIRST_PRF_ID; i <= LAST_PRF_ID; i++)
{
nIndex = SendMessage (hComboBox, CB_ADDSTRING, 0, (LPARAM) get_pkcs5_prf_name(i));
nIndex = SendMessage (hComboBox, CB_ADDSTRING, 0, (LPARAM) get_kdf_name(i));
SendMessage (hComboBox, CB_SETITEMDATA, nIndex, (LPARAM) i);
if (i == EffectiveVolumePkcs5)
{
@@ -2393,7 +2393,7 @@ BOOL CALLBACK PasswordChangeDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
{
if (!HashIsDeprecated (i))
{
nIndex = SendMessage (hComboBox, CB_ADDSTRING, 0, (LPARAM) get_pkcs5_prf_name(i));
nIndex = SendMessage (hComboBox, CB_ADDSTRING, 0, (LPARAM) get_kdf_name(i));
SendMessage (hComboBox, CB_SETITEMDATA, nIndex, (LPARAM) i);
}
}
@@ -2434,7 +2434,7 @@ BOOL CALLBACK PasswordChangeDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
EnableWindow (GetDlgItem (hwndDlg, IDC_SHOW_PASSWORD_CHPWD_NEW), FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDT_NEW_PASSWORD), FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDT_CONFIRM_PASSWORD), FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDT_NEW_PKCS5_PRF), FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDT_NEW_KDF), FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDC_PKCS5_PRF_ID), FALSE);
break;
@@ -2457,7 +2457,7 @@ BOOL CALLBACK PasswordChangeDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
EnableWindow (GetDlgItem (hwndDlg, IDC_NEW_KEYFILES), FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDT_NEW_PASSWORD), FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDT_CONFIRM_PASSWORD), FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDT_NEW_PKCS5_PRF), FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDT_NEW_KDF), FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDC_PKCS5_PRF_ID), FALSE);
break;
@@ -2489,8 +2489,8 @@ BOOL CALLBACK PasswordChangeDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
/* for system encryption, we can't change the PRF */
EnableWindow (GetDlgItem (hwndDlg, IDT_PKCS5_PRF), FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDT_NEW_PKCS5_PRF), FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDT_KDF), FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDT_NEW_KDF), FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDC_PKCS5_PRF_ID), FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDC_PKCS5_OLD_PRF_ID), FALSE);
@@ -3047,7 +3047,7 @@ BOOL CALLBACK PasswordDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPa
for (i = FIRST_PRF_ID; i <= LAST_PRF_ID; i++)
{
nIndex = (int) SendMessage (hComboBox, CB_ADDSTRING, 0, (LPARAM) get_pkcs5_prf_name(i));
nIndex = (int) SendMessage (hComboBox, CB_ADDSTRING, 0, (LPARAM) get_kdf_name(i));
SendMessage (hComboBox, CB_SETITEMDATA, nIndex, (LPARAM) i);
if (*pkcs5 && (*pkcs5 == i))
defaultPrfIndex = nIndex;
@@ -3134,7 +3134,7 @@ BOOL CALLBACK PasswordDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPa
{
if ((bSystemIsGPT || HashForSystemEncryption(i)) && (i != ARGON2))
{
nIndex = (int) SendMessage (hComboBox, CB_ADDSTRING, 0, (LPARAM) get_pkcs5_prf_name(i));
nIndex = (int) SendMessage (hComboBox, CB_ADDSTRING, 0, (LPARAM) get_kdf_name(i));
SendMessage (hComboBox, CB_SETITEMDATA, nIndex, (LPARAM) i);
if (*pkcs5 && (*pkcs5 == i))
defaultPrfIndex = nIndex;
@@ -3738,7 +3738,7 @@ BOOL CALLBACK MountOptionsDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
for (i = FIRST_PRF_ID; i <= LAST_PRF_ID; i++)
{
nIndex = (int) SendMessage (hComboBox, CB_ADDSTRING, 0, (LPARAM) get_pkcs5_prf_name(i));
nIndex = (int) SendMessage (hComboBox, CB_ADDSTRING, 0, (LPARAM) get_kdf_name(i));
SendMessage (hComboBox, CB_SETITEMDATA, nIndex, (LPARAM) i);
/* if a PRF was selected previously, select it */
if (i == pMountOptions->ProtectedHidVolPkcs5Prf)
@@ -3756,7 +3756,7 @@ BOOL CALLBACK MountOptionsDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
EnableWindow (GetDlgItem (hwndDlg, IDT_HIDDEN_PROT_PASSWD), protect);
EnableWindow (GetDlgItem (hwndDlg, IDC_KEYFILES_HIDVOL_PROT), protect);
EnableWindow (GetDlgItem (hwndDlg, IDC_KEYFILES_ENABLE_HIDVOL_PROT), protect);
EnableWindow (GetDlgItem (hwndDlg, IDT_PKCS5_PRF), protect);
EnableWindow (GetDlgItem (hwndDlg, IDT_KDF), protect);
EnableWindow (GetDlgItem (hwndDlg, IDC_PKCS5_PRF_ID), protect);
EnableWindow (GetDlgItem (hwndDlg, IDT_PIM), protect);
EnableWindow (GetDlgItem (hwndDlg, IDC_PIM), protect);
@@ -3952,7 +3952,7 @@ BOOL CALLBACK MountOptionsDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
EnableWindow (GetDlgItem (hwndDlg, IDC_SHOW_PASSWORD_MO), protect);
EnableWindow (GetDlgItem (hwndDlg, IDC_KEYFILES_HIDVOL_PROT), protect);
EnableWindow (GetDlgItem (hwndDlg, IDC_KEYFILES_ENABLE_HIDVOL_PROT), protect);
EnableWindow (GetDlgItem (hwndDlg, IDT_PKCS5_PRF), protect);
EnableWindow (GetDlgItem (hwndDlg, IDT_KDF), protect);
EnableWindow (GetDlgItem (hwndDlg, IDC_PKCS5_PRF_ID), protect);
EnableWindow (GetDlgItem (hwndDlg, IDT_PIM), protect);
EnableWindow (GetDlgItem (hwndDlg, IDC_PIM), protect);
@@ -4316,12 +4316,12 @@ BOOL CALLBACK VolumePropertiesDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LP
ListSubItemSet (list, i++, 1, EAGetModeName (prop.mode));
// PKCS 5 PRF
ListItemAdd (list, i, GetString ("PKCS5_PRF"));
ListItemAdd (list, i, GetString ("KDF"));
if (prop.volumePim == 0)
ListSubItemSet (list, i++, 1, get_pkcs5_prf_name (prop.pkcs5));
ListSubItemSet (list, i++, 1, get_kdf_name (prop.pkcs5));
else
{
StringCbPrintfW (szTmp, sizeof(szTmp), L"%s (Dynamic)", get_pkcs5_prf_name (prop.pkcs5));
StringCbPrintfW (szTmp, sizeof(szTmp), L"%s (Dynamic)", get_kdf_name (prop.pkcs5));
ListSubItemSet (list, i++, 1, szTmp);
}
@@ -12338,7 +12338,7 @@ static BOOL CALLBACK DefaultMountParametersDlgProc (HWND hwndDlg, UINT msg, WPAR
for (i = FIRST_PRF_ID; i <= LAST_PRF_ID; i++)
{
nIndex = (int) SendMessage (hComboBox, CB_ADDSTRING, 0, (LPARAM) get_pkcs5_prf_name(i));
nIndex = (int) SendMessage (hComboBox, CB_ADDSTRING, 0, (LPARAM) get_kdf_name(i));
SendMessage (hComboBox, CB_SETITEMDATA, nIndex, (LPARAM) i);
if (DefaultVolumePkcs5 && (DefaultVolumePkcs5 == i))
defaultPrfIndex = nIndex;

View File

@@ -142,11 +142,11 @@ BEGIN
RTEXT "Password:",IDT_PASSWORD,12,16,72,8
RTEXT "Password:",IDT_NEW_PASSWORD,8,124,76,8
RTEXT "Confirm Password:",IDT_CONFIRM_PASSWORD,9,140,75,16
RTEXT "PKCS-5 PRF:",IDT_NEW_PKCS5_PRF,9,200,74,10,SS_CENTERIMAGE
RTEXT "KDF:",IDT_NEW_KDF,9,200,74,10,SS_CENTERIMAGE
GROUPBOX "Current",IDT_CURRENT,6,3,270,97
GROUPBOX "New",IDT_NEW,6,108,270,130
RTEXT "Wipe mode:",IDT_WIPE_MODE,9,220,74,8,0,WS_EX_RIGHT
RTEXT "PKCS-5 PRF:",IDT_PKCS5_PRF,12,34,74,10,SS_CENTERIMAGE
RTEXT "KDF:",IDT_KDF,12,34,74,10,SS_CENTERIMAGE
RTEXT "Volume PIM:",IDT_OLD_PIM,12,54,74,10,NOT WS_VISIBLE
LTEXT "(Empty or 0 for default iterations)",IDC_OLD_PIM_HELP,135,54,196,8,NOT WS_VISIBLE
RTEXT "Volume PIM:",IDT_PIM,9,157,75,16,NOT WS_VISIBLE
@@ -202,7 +202,7 @@ BEGIN
DEFPUSHBUTTON "OK",IDOK,252,8,69,14
PUSHBUTTON "Cancel",IDCANCEL,252,25,69,14
RTEXT "Password:",IDT_PASSWORD,0,10,65,13
RTEXT "PKCS-5 PRF:",IDT_PKCS5_PRF,0,27,65,11
RTEXT "KDF:",IDT_KDF,0,27,65,11
RTEXT "Volume PIM:",IDT_PIM,0,46,65,8,NOT WS_VISIBLE
END
@@ -399,7 +399,7 @@ BEGIN
CONTROL "Use Volume ID to mount favorite",IDC_FAVORITE_USE_VOLUME_ID,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,148,337,10
COMBOBOX IDC_PKCS5_PRF_ID,87,166,96,90,CBS_DROPDOWNLIST | WS_TABSTOP
LTEXT "PKCS-5 PRF:",IDT_PKCS5_PRF,19,168,63,10
LTEXT "KDF:",IDT_KDF,19,168,63,10
END
IDD_DEFAULT_MOUNT_PARAMETERS DIALOGEX 0, 0, 167, 65
@@ -410,7 +410,7 @@ BEGIN
COMBOBOX IDC_PKCS5_PRF_ID,57,24,103,90,CBS_DROPDOWNLIST | WS_TABSTOP
DEFPUSHBUTTON "OK",IDOK,57,44,50,14
PUSHBUTTON "Cancel",IDCANCEL,111,44,50,14
LTEXT "PKCS-5 PRF:",IDT_PKCS5_PRF,8,26,44,11
LTEXT "KDF:",IDT_KDF,8,26,44,11
END
IDD_SYSENC_SETTINGS DIALOGEX 0, 0, 371, 344

View File

@@ -158,7 +158,7 @@
#define IDC_FAVORITES_HELP_LINK 1135
#define IDC_FAV_VOL_OPTIONS_GLOBAL_SETTINGS_BOX 1136
#define IDC_PREF_UNMOUNT_SESSION_LOCKED 1137
#define IDT_NEW_PKCS5_PRF 1138
#define IDT_NEW_KDF 1138
#define IDC_PKCS5_OLD_PRF_ID 1139
#define IDC_PREF_TEMP_CACHE_ON_MULTIPLE_MOUNT 1141
#define IDT_OLD_PIM 1142