VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common/Wipe.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/Common/Wipe.c')
-rw-r--r--src/Common/Wipe.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/src/Common/Wipe.c b/src/Common/Wipe.c
index 5b07ced5..af3d15db 100644
--- a/src/Common/Wipe.c
+++ b/src/Common/Wipe.c
@@ -3,9 +3,9 @@
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
by the TrueCrypt License 3.0.
Modifications and additions to the original source code (contained in this file)
- and all other portions of this file are Copyright (c) 2013-2016 IDRIX
+ and all other portions of this file are Copyright (c) 2013-2017 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source
code distribution packages.
*/
@@ -13,20 +13,15 @@
#include "Tcdefs.h"
#include "Wipe.h"
-static BOOL Wipe1PseudoRandom (int pass, byte *buffer, size_t size)
-{
- return FALSE;
-}
-
// Fill buffer with wipe patterns defined in "National Industrial Security Program Operating Manual", US DoD 5220.22-M.
// Return: FALSE = buffer must be filled with random data
-static BOOL Wipe3Dod5220 (int pass, byte *buffer, size_t size)
+static BOOL Wipe3Dod5220 (int pass, uint8 *buffer, size_t size)
{
- byte wipeChar;
+ uint8 wipeChar;
switch (pass)
{
case 1:
@@ -45,11 +40,11 @@ static BOOL Wipe3Dod5220 (int pass, byte *buffer, size_t size)
return TRUE;
}
-static BOOL Wipe7Dod5220 (int pass, byte randChars[TC_WIPE_RAND_CHAR_COUNT], byte *buffer, size_t size)
+static BOOL Wipe7Dod5220 (int pass, uint8 randChars[TC_WIPE_RAND_CHAR_COUNT], uint8 *buffer, size_t size)
{
- byte wipeChar;
+ uint8 wipeChar;
switch (pass)
{
case 1:
@@ -83,11 +78,11 @@ static BOOL Wipe7Dod5220 (int pass, byte randChars[TC_WIPE_RAND_CHAR_COUNT], byt
// Fill the buffer with wipe patterns defined in the paper "Secure Deletion of Data from Magnetic and Solid-State Memory" by Peter Gutmann.
// Return: FALSE = buffer must be filled with random data
-static BOOL Wipe35Gutmann (int pass, byte *buffer, size_t size)
+static BOOL Wipe35Gutmann (int pass, uint8 *buffer, size_t size)
{
- byte wipePat3[] = { 0x92, 0x49, 0x24 };
+ uint8 wipePat3[] = { 0x92, 0x49, 0x24 };
int wipePat3Pos;
size_t i;
switch (pass)
@@ -166,15 +161,15 @@ int GetWipePassCount (WipeAlgorithmId algorithm)
return -1; // Prevent compiler warnings
}
-BOOL WipeBuffer (WipeAlgorithmId algorithm, byte randChars[TC_WIPE_RAND_CHAR_COUNT], int pass, byte *buffer, size_t size)
+BOOL WipeBuffer (WipeAlgorithmId algorithm, uint8 randChars[TC_WIPE_RAND_CHAR_COUNT], int pass, uint8 *buffer, size_t size)
{
switch (algorithm)
{
case TC_WIPE_1_RAND:
case TC_WIPE_256:
- return Wipe1PseudoRandom (pass, buffer, size);
+ return FALSE; // Delegate buffer filling to the caller
case TC_WIPE_3_DOD_5220:
return Wipe3Dod5220 (pass, buffer, size);