mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-06 00:10:04 +01:00
Explicitly print error message if keyslot open failed.
The only quiet message now is EPERM (wrong password) that is processed by the caller. Fixes #488.
This commit is contained in:
@@ -547,6 +547,11 @@ out:
|
|||||||
if (r < 0) {
|
if (r < 0) {
|
||||||
crypt_free_volume_key(*vks);
|
crypt_free_volume_key(*vks);
|
||||||
*vks = NULL;
|
*vks = NULL;
|
||||||
|
|
||||||
|
if (r == -ENOMEM)
|
||||||
|
log_err(cd, _("Not enough available memory to open a keyslot."));
|
||||||
|
else if (r != -EPERM)
|
||||||
|
log_err(cd, _("Keyslot open failed."));
|
||||||
}
|
}
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
@@ -579,6 +584,13 @@ int LUKS2_keyslot_open(struct crypt_device *cd,
|
|||||||
} else
|
} else
|
||||||
r = LUKS2_open_and_verify(cd, hdr, keyslot, segment, password, password_len, vk);
|
r = LUKS2_open_and_verify(cd, hdr, keyslot, segment, password, password_len, vk);
|
||||||
|
|
||||||
|
if (r < 0) {
|
||||||
|
if (r == -ENOMEM)
|
||||||
|
log_err(cd, _("Not enough available memory to open a keyslot."));
|
||||||
|
else if (r != -EPERM)
|
||||||
|
log_err(cd, _("Keyslot open failed."));
|
||||||
|
}
|
||||||
|
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user