Retain original error code when reading data from keyring.

If key description is not available we expect -ENOENT.
-EINVAL usually aborts all following effort to unlock
device/keyslot.
This commit is contained in:
Ondrej Kozina
2024-10-14 15:38:42 +02:00
parent 66c1523163
commit 4de453d6a5

View File

@@ -410,8 +410,8 @@ static int get_key_by_vk_in_keyring(struct crypt_device *cd,
&key, &key_size);
if (r < 0) {
log_err(cd, _("Failed to read volume key candidate from keyring."));
kc->error = -EINVAL;
return -EINVAL;
kc->error = r;
return r;
}
*r_vk = crypt_alloc_volume_key(key_size, key);