Refactor new LUKS2 reencryption code.

It will ease the merge with legacy LUKS1 reencryption
code later.
This commit is contained in:
Ondrej Kozina
2021-10-07 12:42:40 +02:00
parent eb0f9b4f29
commit 7d77e0dcbd
2 changed files with 246 additions and 69 deletions

View File

@@ -3126,10 +3126,6 @@ int main(int argc, const char **argv)
}
/* reencrypt action specific check */
if (ARG_SET(OPT_DECRYPT_ID) && !ARG_SET(OPT_HEADER_ID))
usage(popt_context, EXIT_FAILURE, _("LUKS2 decryption requires option --header."),
poptGetInvocationName(popt_context));
if (ARG_SET(OPT_REDUCE_DEVICE_SIZE_ID) && ARG_SET(OPT_DEVICE_SIZE_ID))
usage(popt_context, EXIT_FAILURE, _("Options --reduce-device-size and --data-size cannot be combined."),
poptGetInvocationName(popt_context));