From 8f350f9b9fae6409336612ff37feacb3b3480275 Mon Sep 17 00:00:00 2001 From: Milan Broz Date: Fri, 12 Oct 2018 12:34:43 +0200 Subject: [PATCH] Print error message if crypt_load() detects unsupported version of LUKS. --- lib/setup.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/setup.c b/lib/setup.c index 9607bed6..cbf53356 100644 --- a/lib/setup.c +++ b/lib/setup.c @@ -782,8 +782,11 @@ static int _crypt_load_luks(struct crypt_device *cd, const char *requested_type, * perform repair. */ r = _crypt_load_luks2(cd, cd->type != NULL, repair); - } else + } else { + if (version > 2) + log_err(cd, _("Unsupported LUKS version %d."), version); r = -EINVAL; + } out: crypt_memzero(&hdr, sizeof(hdr));