mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-05 16:00:05 +01:00
We do not need to wipe specific keyslot area only.
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user