mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-18 14:20:09 +01:00
Do not init LUKS2 decryption for devices with data offset.
Currently LUKS2 decryption cannot perform data decryption with data shift. Even though we can decrypt devices with data offset > 0 in LUKS2 metadata it does not make much sense. Such devices cannot be easily mounted after decryption is finished due to said data offset (fs superblock is moved typicaly by 16MiBs).
This commit is contained in:
@@ -3050,8 +3050,9 @@ static int action_decrypt_luks2(struct crypt_device *cd)
|
||||
};
|
||||
size_t passwordLen;
|
||||
|
||||
if (!crypt_get_metadata_device_name(cd) || crypt_header_is_detached(cd) <= 0) {
|
||||
log_err(_("LUKS2 decryption is supported with detached header device only."));
|
||||
if (!crypt_get_metadata_device_name(cd) || crypt_header_is_detached(cd) <= 0 ||
|
||||
crypt_get_data_offset(cd) > 0) {
|
||||
log_err(_("LUKS2 decryption is supported with detached header device only (with data offset set to 0)."));
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user