mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-05 16:00:05 +01:00
Add check to LUKS1 convert for segments count.
This commit is contained in:
@@ -752,6 +752,11 @@ int LUKS2_luks2_to_luks1(struct crypt_device *cd, struct luks2_hdr *hdr2, struct
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (json_segments_count(LUKS2_get_segments_jobj(hdr2)) != 1) {
|
||||
log_err(cd, _("Cannot convert to LUKS1 format - device uses more segments."));
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
r = LUKS2_tokens_count(hdr2);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
Reference in New Issue
Block a user