mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-11 19:00:02 +01:00
Add error message for missing volume key.
Add specific error message when user does not provide all necessary volume keys via --volume-key-file or --volume-key-keyring parameters.
This commit is contained in:
@@ -1823,6 +1823,8 @@ static int action_open_luks(void)
|
||||
/* The ordering of kc1 or kc2 does not matter */
|
||||
r = crypt_activate_by_keyslot_context(cd, activated_name, CRYPT_ANY_SLOT,
|
||||
kc1, CRYPT_ANY_SLOT, kc2, activate_flags);
|
||||
if (r == -ESRCH)
|
||||
log_err(_("Device requires two volume keys."));
|
||||
if (r == -EPERM)
|
||||
log_err(_("Volume key does not match the volume."));
|
||||
} else {
|
||||
|
||||
@@ -299,6 +299,8 @@ static int reencrypt_multi_key_unlock(struct crypt_device *cd,
|
||||
r = crypt_activate_by_keyslot_context(cd, NULL, ARG_INT32(OPT_KEY_SLOT_ID),
|
||||
kc1, ARG_INT32(OPT_NEW_KEY_SLOT_ID), kc2,
|
||||
0);
|
||||
if (r == -ESRCH)
|
||||
log_err(_("Device requires two volume keys."));
|
||||
if (r == -EPERM)
|
||||
log_err(_("Volume key does not match the volume."));
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user