Make CRYPT_WIPE_ENCRYPTED_ZERO obsolete.

It was never implemented (the idea was to speed up wipe), but
with the recent RNG performance changes it makes no longer sense.
This commit is contained in:
Milan Broz
2022-05-05 14:05:26 +02:00
parent 4d6e9e7c32
commit 5d9e362553
2 changed files with 3 additions and 7 deletions

View File

@@ -1996,7 +1996,7 @@ int crypt_keyfile_read(struct crypt_device *cd,
typedef enum { typedef enum {
CRYPT_WIPE_ZERO, /**< Fill with zeroes */ CRYPT_WIPE_ZERO, /**< Fill with zeroes */
CRYPT_WIPE_RANDOM, /**< Use RNG to fill data */ CRYPT_WIPE_RANDOM, /**< Use RNG to fill data */
CRYPT_WIPE_ENCRYPTED_ZERO, /**< Add encryption and fill with zeroes as plaintext */ CRYPT_WIPE_ENCRYPTED_ZERO, /**< Obsolete, same as CRYPT_WIPE_RANDOM */
CRYPT_WIPE_SPECIAL, /**< Compatibility only, do not use (Gutmann method) */ CRYPT_WIPE_SPECIAL, /**< Compatibility only, do not use (Gutmann method) */
} crypt_wipe_pattern; } crypt_wipe_pattern;

View File

@@ -135,12 +135,8 @@ static int wipe_block(struct crypt_device *cd, int devfd, crypt_wipe_pattern pat
memset(sf, 0, wipe_block_size); memset(sf, 0, wipe_block_size);
*need_block_init = false; *need_block_init = false;
r = 0; r = 0;
} else if (pattern == CRYPT_WIPE_RANDOM) { } else if (pattern == CRYPT_WIPE_RANDOM ||
r = crypt_random_get(cd, sf, wipe_block_size, pattern == CRYPT_WIPE_ENCRYPTED_ZERO) {
CRYPT_RND_NORMAL) ? -EIO : 0;
*need_block_init = true;
} else if (pattern == CRYPT_WIPE_ENCRYPTED_ZERO) {
// FIXME
r = crypt_random_get(cd, sf, wipe_block_size, r = crypt_random_get(cd, sf, wipe_block_size,
CRYPT_RND_NORMAL) ? -EIO : 0; CRYPT_RND_NORMAL) ? -EIO : 0;
*need_block_init = true; *need_block_init = true;