From cbf6fa9d07a7d9c4180ce54c79724176e256fcfb Mon Sep 17 00:00:00 2001 From: Milan Broz Date: Tue, 29 Apr 2025 08:20:07 +0200 Subject: [PATCH] Fix external slot checker to work with LUKS2. --- misc/keyslot_checker/chk_luks_keyslots.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/misc/keyslot_checker/chk_luks_keyslots.c b/misc/keyslot_checker/chk_luks_keyslots.c index 68916fb3..fa73ded1 100644 --- a/misc/keyslot_checker/chk_luks_keyslots.c +++ b/misc/keyslot_checker/chk_luks_keyslots.c @@ -161,7 +161,7 @@ static int check_keyslots(FILE *out, struct crypt_device *cd, int f_luks) crypt_keyslot_info ki; unsigned char buffer[sector_size]; - for (i = 0; i < crypt_keyslot_max(CRYPT_LUKS1) ; i++) { + for (i = 0; i < crypt_keyslot_max(crypt_get_type(cd)) ; i++) { fprintf(out, "- processing keyslot %d:", i); ki = crypt_keyslot_status(cd, i); if (ki == CRYPT_SLOT_INACTIVE) { @@ -338,7 +338,7 @@ int main(int argc, char **argv) * This should also make sure a valid LUKS1 header is on disk * and hence we should be able to skip magic and version checks. */ - res = crypt_load(cd, CRYPT_LUKS1, NULL); + res = crypt_load(cd, CRYPT_LUKS, NULL); if (res < 0) { fprintf(stderr, "crypt_load() failed. LUKS header too broken/absent?\n"); crypt_free(cd);