diff --git a/src/Common/Password.c b/src/Common/Password.c index 1c174221..d2449acc 100644 --- a/src/Common/Password.c +++ b/src/Common/Password.c @@ -137,7 +137,7 @@ BOOL CheckPasswordCharEncoding (HWND hPassword, Password *ptrPw) BOOL CheckPasswordLength (HWND hwndDlg, unsigned __int32 passwordLength, int pim, BOOL bForBoot, int bootPRF, BOOL bSkipPasswordWarning, BOOL bSkipPimWarning) { BOOL bootPimCondition = (bForBoot && (bootPRF != SHA512 && bootPRF != WHIRLPOOL))? TRUE : FALSE; - BOOL bCustomPimSmall = ((pim != 0) && (pim < (bootPimCondition? 98 : 485)))? TRUE : FALSE; + BOOL bCustomPimSmall = ((pim != 0) && (pim < (bootPimCondition? 98 : bootPRF == ARGON2? 12 : 485)))? TRUE : FALSE; if (passwordLength < PASSWORD_LEN_WARNING) { if (bCustomPimSmall) @@ -159,7 +159,7 @@ BOOL CheckPasswordLength (HWND hwndDlg, unsigned __int32 passwordLength, int pim } #endif - if ((pim != 0) && (pim > (bootPimCondition? 98 : 485))) + if ((pim != 0) && (pim > (bootPimCondition? 98 : bootPRF == ARGON2? 12 : 485))) { // warn that mount/boot will take more time Warning ("PIM_LARGE_WARNING", hwndDlg); diff --git a/src/Format/Tcformat.c b/src/Format/Tcformat.c index 1f85bf3e..7ee6a6c3 100644 --- a/src/Format/Tcformat.c +++ b/src/Format/Tcformat.c @@ -6434,7 +6434,7 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa if (volumePassword.Length > 0) { // Check password length (check also done for outer volume which is not the case in TrueCrypt). - if (!CheckPasswordLength (NULL, volumePassword.Length, volumePim, FALSE, 0, Silent, Silent)) + if (!CheckPasswordLength (NULL, volumePassword.Length, volumePim, FALSE, hash_algo, Silent, Silent)) { exit (1); } @@ -7699,7 +7699,7 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa return 1; } // Check password length (check also done for outer volume which is not the case in TrueCrypt). - else if (!CheckPasswordLength (hwndDlg, volumePassword.Length, 0, SysEncInEffect(), SysEncInEffect()? hash_algo : 0, FALSE, FALSE)) + else if (!CheckPasswordLength (hwndDlg, volumePassword.Length, 0, SysEncInEffect(), hash_algo, FALSE, FALSE)) { return 1; } @@ -7810,7 +7810,7 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa return 1; } // Check password length (check also done for outer volume which is not the case in TrueCrypt). - else if (!CheckPasswordLength (hwndDlg, volumePassword.Length, volumePim, SysEncInEffect(), SysEncInEffect()? hash_algo : 0, TRUE, FALSE)) + else if (!CheckPasswordLength (hwndDlg, volumePassword.Length, volumePim, SysEncInEffect(), hash_algo, TRUE, FALSE)) { return 1; } diff --git a/src/Mount/Mount.c b/src/Mount/Mount.c index 973e48a8..43133189 100644 --- a/src/Mount/Mount.c +++ b/src/Mount/Mount.c @@ -2860,7 +2860,7 @@ BOOL CALLBACK PasswordChangeDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPAR else if (!(newKeyFilesParam.EnableKeyFiles && newKeyFilesParam.FirstKeyFile != NULL) && pwdChangeDlgMode == PCDM_CHANGE_PASSWORD) { - int bootPRF = 0; + int bootPRF = pkcs5; if (bSysEncPwdChangeDlgMode) { try