VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common/Password.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/Common/Password.c')
-rw-r--r--src/Common/Password.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Common/Password.c b/src/Common/Password.c
index ca86f9c4..c23bd4fa 100644
--- a/src/Common/Password.c
+++ b/src/Common/Password.c
@@ -119,7 +119,7 @@ BOOL CheckPasswordLength (HWND hwndDlg, HWND hwndItem)
119 return TRUE; 119 return TRUE;
120} 120}
121 121
122int ChangePwd (const char *lpszVolume, Password *oldPassword, Password *newPassword, int pkcs5, HWND hwndDlg) 122int ChangePwd (const char *lpszVolume, Password *oldPassword, Password *newPassword, int pkcs5, int wipePassCount, HWND hwndDlg)
123{ 123{
124 int nDosLinkCreated = 1, nStatus = ERR_OS_ERROR; 124 int nDosLinkCreated = 1, nStatus = ERR_OS_ERROR;
125 char szDiskFile[TC_MAX_PATH], szCFDevice[TC_MAX_PATH]; 125 char szDiskFile[TC_MAX_PATH], szCFDevice[TC_MAX_PATH];
@@ -323,7 +323,7 @@ int ChangePwd (const char *lpszVolume, Password *oldPassword, Password *newPassw
323 323
324 while (TRUE) 324 while (TRUE)
325 { 325 {
326 /* The header will be re-encrypted PRAND_DISK_WIPE_PASSES times to prevent adversaries from using 326 /* The header will be re-encrypted wipePassCount times to prevent adversaries from using
327 techniques such as magnetic force microscopy or magnetic force scanning tunnelling microscopy 327 techniques such as magnetic force microscopy or magnetic force scanning tunnelling microscopy
328 to recover the overwritten header. According to Peter Gutmann, data should be overwritten 22 328 to recover the overwritten header. According to Peter Gutmann, data should be overwritten 22
329 times (ideally, 35 times) using non-random patterns and pseudorandom data. However, as users might 329 times (ideally, 35 times) using non-random patterns and pseudorandom data. However, as users might
@@ -335,7 +335,7 @@ int ChangePwd (const char *lpszVolume, Password *oldPassword, Password *newPassw
335 of the header to differ substantially and in a random manner from the versions written during the 335 of the header to differ substantially and in a random manner from the versions written during the
336 other passes. */ 336 other passes. */
337 337
338 for (wipePass = 0; wipePass < PRAND_DISK_WIPE_PASSES; wipePass++) 338 for (wipePass = 0; wipePass < wipePassCount; wipePass++)
339 { 339 {
340 // Prepare new volume header 340 // Prepare new volume header
341 nStatus = CreateVolumeHeaderInMemory (FALSE, 341 nStatus = CreateVolumeHeaderInMemory (FALSE,
@@ -353,7 +353,7 @@ int ChangePwd (const char *lpszVolume, Password *oldPassword, Password *newPassw
353 cryptoInfo->RequiredProgramVersion, 353 cryptoInfo->RequiredProgramVersion,
354 cryptoInfo->HeaderFlags, 354 cryptoInfo->HeaderFlags,
355 cryptoInfo->SectorSize, 355 cryptoInfo->SectorSize,
356 wipePass < PRAND_DISK_WIPE_PASSES - 1); 356 wipePass < wipePassCount - 1);
357 357
358 if (ci != NULL) 358 if (ci != NULL)
359 crypto_close (ci); 359 crypto_close (ci);