VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Mount/Mount.c
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2014-07-27 02:36:23 +0200
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2014-11-08 23:21:43 +0100
commit1c11ee428d9e06be1440133f6d1163ce6c709410 (patch)
treed593910f3e6e3d2441bfd4bfe25d6e58c508a0b0 /src/Mount/Mount.c
parent97154aaf51efe787dd1678c8e1baeeb65ce46fe1 (diff)
downloadVeraCrypt-1c11ee428d9e06be1440133f6d1163ce6c709410.tar.gz
VeraCrypt-1c11ee428d9e06be1440133f6d1163ce6c709410.zip
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).
Diffstat (limited to 'src/Mount/Mount.c')
-rw-r--r--src/Mount/Mount.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/Mount/Mount.c b/src/Mount/Mount.c
index 380cd04a..6b11c178 100644
--- a/src/Mount/Mount.c
+++ b/src/Mount/Mount.c
@@ -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);
}
}