From 99ab2db6ad3f79c4e3a7287f4c724d1c635ebd2f Mon Sep 17 00:00:00 2001 From: Ingo Franzki Date: Thu, 25 Jul 2019 12:33:23 +0200 Subject: [PATCH] zkey: Fix auto-detection of clear key bitsize for XTS keys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When 'zkey generate' is used with options '--clearkey ' and '--xts', but without the '--keybits ' option, then the auto-detection of the bitsize of the specified clear key fails. Signed-off-by: Ingo Franzki Signed-off-by: Jan Höppner --- zkey/pkey.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zkey/pkey.c b/zkey/pkey.c index a88c4e90..046a2ba9 100644 --- a/zkey/pkey.c +++ b/zkey/pkey.c @@ -267,7 +267,7 @@ static u8 *read_clear_key(const char *keyfile, size_t keybits, bool xts, return NULL; } } else { - keybits = DOUBLE_KEYSIZE_FOR_XTS(size * 8, xts); + keybits = HALF_KEYSIZE_FOR_XTS(size * 8, xts); } switch (keybits) {