Fix key-size descriptions

For compatibility reasons, cryptsetup uses key size in BITS
while integritysetup in BYTES.

The help is confusing here, this patch fixes it.

Thanks Daniel Tang for notification.
This commit is contained in:
Milan Broz
2025-11-20 13:09:20 +01:00
parent 8a3e16fa25
commit 153aed3d16
3 changed files with 6 additions and 4 deletions

View File

@@ -1914,6 +1914,7 @@ static int reencrypt_luks2_init(struct crypt_device *cd, const char *data_device
new_key_size = ARG_UINT32(OPT_NEW_KEY_SIZE_ID);
if (new_key_size || new_cipher)
/* This will convert new key size to bytes from bits */
new_key_size = get_adjusted_key_size(cipher, mode, new_key_size,
DEFAULT_LUKS1_KEYBITS, 0);
else