mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-05 16:00:05 +01:00
Fix reencryption keys loading in kernel keyring.
Manage keys upload in kernel keyring (internal logon type for dm-crypt segments) in single location in-before device activation.
This commit is contained in:
@@ -4506,22 +4506,11 @@ int LUKS2_reencrypt_locked_recovery_by_vks(struct crypt_device *cd,
|
||||
uint64_t minimal_size, device_size;
|
||||
int r = -EINVAL;
|
||||
struct luks2_hdr *hdr = crypt_get_hdr(cd, CRYPT_LUKS2);
|
||||
struct volume_key *vk = NULL;
|
||||
|
||||
log_dbg(cd, "Entering reencryption crash recovery.");
|
||||
|
||||
if (LUKS2_get_data_size(hdr, &minimal_size, NULL))
|
||||
return r;
|
||||
|
||||
if (crypt_use_keyring_for_vk(cd))
|
||||
vk = vks;
|
||||
while (vk) {
|
||||
r = LUKS2_volume_key_load_in_keyring_by_digest(cd, vk, crypt_volume_key_get_id(vk));
|
||||
if (r < 0)
|
||||
goto out;
|
||||
vk = crypt_volume_key_next(vk);
|
||||
}
|
||||
|
||||
if (LUKS2_reencrypt_check_device_size(cd, hdr, minimal_size, &device_size, true, false))
|
||||
goto out;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user