diff options
Diffstat (limited to 'src/Common/Wipe.c')
-rw-r--r-- | src/Common/Wipe.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/Common/Wipe.c b/src/Common/Wipe.c index d68b517b..af3d15db 100644 --- a/src/Common/Wipe.c +++ b/src/Common/Wipe.c @@ -1,51 +1,46 @@ /* Derived from source code of TrueCrypt 7.1a, which is 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-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. */ #include "Tcdefs.h" #include "Wipe.h" -static BOOL Wipe1PseudoRandom (int pass, uint8 *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, uint8 *buffer, size_t size) { uint8 wipeChar; switch (pass) { case 1: wipeChar = 0; break; case 2: wipeChar = 0xff; break; default: return FALSE; } memset (buffer, wipeChar, size); return TRUE; } static BOOL Wipe7Dod5220 (int pass, uint8 randChars[TC_WIPE_RAND_CHAR_COUNT], uint8 *buffer, size_t size) { uint8 wipeChar; @@ -146,53 +141,53 @@ wipe3: int GetWipePassCount (WipeAlgorithmId algorithm) { switch (algorithm) { case TC_WIPE_1_RAND: return 1; case TC_WIPE_3_DOD_5220: return 3; case TC_WIPE_7_DOD_5220: return 7; case TC_WIPE_35_GUTMANN: return 35; case TC_WIPE_256: return 256; } return -1; // Prevent compiler warnings } 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); case TC_WIPE_7_DOD_5220: return Wipe7Dod5220 (pass, randChars, buffer, size); case TC_WIPE_35_GUTMANN: return Wipe35Gutmann (pass, buffer, size); /* we will never reach here because all calls to WipeBuffer are preceeded * by a call to GetWipePassCount that already checks the same algorithm * parameters and in case of unsupported value an error is returned before * calling WipeBuffer */ /* default: TC_THROW_FATAL_EXCEPTION;*/ } return FALSE; // Prevent compiler warnings } |