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:
Ondrej Kozina
2025-05-20 12:36:10 +02:00
parent 4d5aa29955
commit 5689fb46e7
2 changed files with 4 additions and 0 deletions

View File

@@ -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 {