Commit c377b407 authored by Arie Peterson's avatar Arie Peterson 🐚
Browse files

Remove safety margin when zeroing header on selfdestruct

parent 86b05279
......@@ -76,14 +76,11 @@ int callback_encryption_selfdestruct_post(const struct _u_request * request,
destroy_active_keyslots();
// Overwrite start of data partition with zeroes.
// We take twice the size of the luks header and keyslot area
// as a safety margin.
int bytes_to_zero = 2 * LUKS_HEADER_SIZE;
y_log_message(Y_LOG_LEVEL_DEBUG,
"Overwriting start of data partition with zeroes");
char * command = NULL;
asprintf(&command, "head -c %d /dev/zero > %s; sync",
bytes_to_zero, DATA_PARTITION_DEVICE);
LUKS_HEADER_SIZE, DATA_PARTITION_DEVICE);
r = system(command);
if (r != 0)
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment