Do not drop keys from keyring on successfull reencryption recovery.

The key might be needed in activation of ordinary LUKS2 device
provided the recovery took place in before device activation
and actually finished LUKS2 device reencryption.

Fixes: #863.
This commit is contained in:
Ondrej Kozina
2024-01-22 12:06:34 +01:00
parent de1cd97fde
commit 135ed491d1

View File

@@ -4463,6 +4463,7 @@ int LUKS2_reencrypt_locked_recovery_by_vks(struct crypt_device *cd,
r = reencrypt_recovery(cd, hdr, device_size, vks);
out:
if (r < 0)
crypt_drop_keyring_key(cd, vks);
return r;
}