zkey: Fix auto-detection of clear key bitsize for XTS keys

When 'zkey generate' is used with options '--clearkey <file>' and
'--xts', but without the '--keybits <bitsize>' option, then the
auto-detection of the bitsize of the specified clear key fails.

Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Ingo Franzki
2019-07-25 12:33:23 +02:00
committed by Jan Höppner
parent 784ac7d190
commit 99ab2db6ad

View File

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