mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2025-11-12 03:18:26 -06:00
Add option in select the number of passes for volume header over-writing. By default, it is set to 3 but it can be increased to 256 passes (which can lead to a delay of many hours for a single password change operation).
This commit is contained in:
@@ -1396,6 +1396,7 @@ BOOL CALLBACK PasswordChangeDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
|
||||
LPARAM nIndex;
|
||||
HWND hComboBox = GetDlgItem (hwndDlg, IDC_PKCS5_PRF_ID);
|
||||
int i;
|
||||
WipeAlgorithmId headerWipeMode = TC_WIPE_3_DOD_5220;
|
||||
|
||||
ZeroMemory (&newKeyFilesParam, sizeof (newKeyFilesParam));
|
||||
|
||||
@@ -1427,6 +1428,9 @@ BOOL CALLBACK PasswordChangeDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
|
||||
|
||||
SendMessage (hComboBox, CB_SETCURSEL, 0, 0);
|
||||
|
||||
PopulateWipeModeCombo (GetDlgItem (hwndDlg, IDC_WIPE_MODE), FALSE, FALSE, TRUE);
|
||||
SelectAlgo (GetDlgItem (hwndDlg, IDC_WIPE_MODE), (int *) &headerWipeMode);
|
||||
|
||||
switch (pwdChangeDlgMode)
|
||||
{
|
||||
case PCDM_CHANGE_PKCS5_PRF:
|
||||
@@ -1751,6 +1755,11 @@ BOOL CALLBACK PasswordChangeDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
|
||||
HWND hParent = GetParent (hwndDlg);
|
||||
Password oldPassword;
|
||||
Password newPassword;
|
||||
WipeAlgorithmId headerWiperMode = (WipeAlgorithmId) SendMessage (
|
||||
GetDlgItem (hwndDlg, IDC_WIPE_MODE),
|
||||
CB_GETITEMDATA,
|
||||
SendMessage (GetDlgItem (hwndDlg, IDC_WIPE_MODE), CB_GETCURSEL, 0, 0),
|
||||
0);
|
||||
int nStatus;
|
||||
int pkcs5 = SendMessage (GetDlgItem (hwndDlg, IDC_PKCS5_PRF_ID), CB_GETITEMDATA,
|
||||
SendMessage (GetDlgItem (hwndDlg, IDC_PKCS5_PRF_ID), CB_GETCURSEL, 0, 0), 0);
|
||||
@@ -1813,7 +1822,7 @@ BOOL CALLBACK PasswordChangeDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
|
||||
|
||||
try
|
||||
{
|
||||
nStatus = BootEncObj->ChangePassword (&oldPassword, &newPassword, pkcs5);
|
||||
nStatus = BootEncObj->ChangePassword (&oldPassword, &newPassword, pkcs5, GetWipePassCount(headerWiperMode));
|
||||
}
|
||||
catch (Exception &e)
|
||||
{
|
||||
@@ -1825,14 +1834,14 @@ BOOL CALLBACK PasswordChangeDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
|
||||
{
|
||||
// Non-system
|
||||
|
||||
nStatus = ChangePwd (szFileName, &oldPassword, &newPassword, pkcs5, hwndDlg);
|
||||
nStatus = ChangePwd (szFileName, &oldPassword, &newPassword, pkcs5, GetWipePassCount(headerWiperMode), hwndDlg);
|
||||
|
||||
if (nStatus == ERR_OS_ERROR
|
||||
&& GetLastError () == ERROR_ACCESS_DENIED
|
||||
&& IsUacSupported ()
|
||||
&& IsVolumeDeviceHosted (szFileName))
|
||||
{
|
||||
nStatus = UacChangePwd (szFileName, &oldPassword, &newPassword, pkcs5, hwndDlg);
|
||||
nStatus = UacChangePwd (szFileName, &oldPassword, &newPassword, pkcs5, GetWipePassCount(headerWiperMode), hwndDlg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user