mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-05 16:00:05 +01:00
Improve debug output for kernel keyring.
Add more context to possibly failing kernel keyring routines in log debug output. Mostly split debug output for errors while trying to search the kernel key by description and errors while trying to read/unlink the key by its id.
This commit is contained in:
committed by
Milan Broz
parent
cdce1d96f0
commit
6296e8d4f8
@@ -328,7 +328,8 @@ static int get_passphrase_by_keyring(struct crypt_device *cd,
|
||||
assert(r_passphrase_size);
|
||||
|
||||
if (!kc->i_passphrase) {
|
||||
r = keyring_get_user_key(kc->u.kr.key_description, &kc->i_passphrase, &kc->i_passphrase_size);
|
||||
r = crypt_keyring_get_user_key(cd, kc->u.kr.key_description,
|
||||
&kc->i_passphrase, &kc->i_passphrase_size);
|
||||
if (r < 0) {
|
||||
log_err(cd, _("Failed to read passphrase from keyring."));
|
||||
kc->error = -EINVAL;
|
||||
@@ -416,9 +417,10 @@ static int get_key_by_vk_in_keyring(struct crypt_device *cd,
|
||||
assert(kc && kc->type == CRYPT_KC_TYPE_VK_KEYRING);
|
||||
assert(r_vk);
|
||||
|
||||
r = keyring_find_and_get_key_by_name(kc->u.vk_kr.key_description, &kc->i_volume_key, &kc->i_volume_key_size);
|
||||
r = crypt_keyring_get_key_by_name(cd, kc->u.vk_kr.key_description,
|
||||
&kc->i_volume_key, &kc->i_volume_key_size);
|
||||
if (r < 0) {
|
||||
log_err(cd, _("Failed to read volume key from keyring."));
|
||||
log_err(cd, _("Failed to read volume key candidate from keyring."));
|
||||
kc->error = -EINVAL;
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user