From bfe0c7fc5f269e16cbba1d7a38ddc40591410a30 Mon Sep 17 00:00:00 2001 From: Vojtech Trefny Date: Tue, 13 Jul 2021 07:21:43 +0200 Subject: [PATCH] Fix error message for invalid key slot with LUKS2 Fixes: #651 --- lib/setup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/setup.c b/lib/setup.c index b46e4ce1..715e520c 100644 --- a/lib/setup.c +++ b/lib/setup.c @@ -429,7 +429,7 @@ static int keyslot_verify_or_find_empty(struct crypt_device *cd, int *keyslot) switch (ki) { case CRYPT_SLOT_INVALID: log_err(cd, _("Key slot %d is invalid, please select between 0 and %d."), - *keyslot, LUKS_NUMKEYS - 1); + *keyslot, crypt_keyslot_max(cd->type) - 1); return -EINVAL; case CRYPT_SLOT_INACTIVE: break;