We do not need to wipe specific keyslot area only.

This commit is contained in:
Ondrej Kozina
2023-09-26 15:50:43 +02:00
parent f0b556b2d4
commit df9976e2a7
3 changed files with 3 additions and 11 deletions

View File

@@ -224,8 +224,7 @@ int LUKS2_keyslot_store(struct crypt_device *cd,
int LUKS2_keyslot_wipe(struct crypt_device *cd,
struct luks2_hdr *hdr,
int keyslot,
int wipe_area_only);
int keyslot);
crypt_keyslot_priority LUKS2_keyslot_priority_get(struct luks2_hdr *hdr, int keyslot);

View File

@@ -678,8 +678,7 @@ int LUKS2_keyslot_store(struct crypt_device *cd,
int LUKS2_keyslot_wipe(struct crypt_device *cd,
struct luks2_hdr *hdr,
int keyslot,
int wipe_area_only)
int keyslot)
{
struct device *device = crypt_metadata_device(cd);
uint64_t area_offset, area_length;
@@ -696,9 +695,6 @@ int LUKS2_keyslot_wipe(struct crypt_device *cd,
if (!jobj_keyslot)
return -ENOENT;
if (wipe_area_only)
log_dbg(cd, "Wiping keyslot %d area only.", keyslot);
r = LUKS2_device_write_lock(cd, hdr, device);
if (r)
return r;
@@ -722,9 +718,6 @@ int LUKS2_keyslot_wipe(struct crypt_device *cd,
}
}
if (wipe_area_only)
goto out;
/* Slot specific wipe */
if (h) {
r = h->wipe(cd, keyslot);

View File

@@ -4537,7 +4537,7 @@ int crypt_keyslot_destroy(struct crypt_device *cd, int keyslot)
return LUKS_del_key(keyslot, &cd->u.luks1.hdr, cd);
}
return LUKS2_keyslot_wipe(cd, &cd->u.luks2.hdr, keyslot, 0);
return LUKS2_keyslot_wipe(cd, &cd->u.luks2.hdr, keyslot);
}
static int _check_header_data_overlap(struct crypt_device *cd, const char *name)