mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-12 03:10:08 +01:00
Simplify LUKS2_wipe_header_areas.
For LUKS2 headers with non zero data offset LUKS2_wipe_header_areas will always erase the smallest from following: - metadata device size - data offset value - maximal LUKS2 metadata size (twice 2 MiBs json area including 128 MiB for binary keyslot areas) even with detached header. For zero value data offset (LUKS2 header can not be restored back to data device), we erase up to smallest from the following values: - metadata device size - maximal LUKS2 metadata size (twice 2 MiBs json area including 128 MiB for
This commit is contained in:
@@ -2139,7 +2139,7 @@ static int _crypt_format_luks2(struct crypt_device *cd,
|
||||
|
||||
device_set_block_size(crypt_data_device(cd), sector_size);
|
||||
|
||||
r = LUKS2_wipe_header_areas(cd, &cd->u.luks2.hdr, cd->metadata_device != NULL);
|
||||
r = LUKS2_wipe_header_areas(cd, &cd->u.luks2.hdr);
|
||||
if (r < 0) {
|
||||
log_err(cd, _("Cannot wipe header on device %s."),
|
||||
mdata_device_path(cd));
|
||||
@@ -2544,7 +2544,7 @@ int crypt_format_luks2_opal(struct crypt_device *cd,
|
||||
|
||||
device_set_block_size(crypt_data_device(cd), sector_size);
|
||||
|
||||
r = LUKS2_wipe_header_areas(cd, &cd->u.luks2.hdr, cd->metadata_device != NULL);
|
||||
r = LUKS2_wipe_header_areas(cd, &cd->u.luks2.hdr);
|
||||
if (r < 0) {
|
||||
log_err(cd, _("Cannot wipe header on device %s."),
|
||||
mdata_device_path(cd));
|
||||
|
||||
Reference in New Issue
Block a user