mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-20 07:10:08 +01:00
Drop duplicate type check in LUKS2 encryption.
This commit is contained in:
@@ -2807,7 +2807,7 @@ static int action_encrypt_luks2(struct crypt_device **cd)
|
|||||||
type = crypt_get_default_type();
|
type = crypt_get_default_type();
|
||||||
|
|
||||||
if (!isLUKS2(type)) {
|
if (!isLUKS2(type)) {
|
||||||
log_err(_("Invalid LUKS device type."));
|
log_err(_("Encryption is supported only for LUKS2 format."));
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2829,11 +2829,6 @@ static int action_encrypt_luks2(struct crypt_device **cd)
|
|||||||
log_std(_("Adjusting --reduce-device-size value to twice the --offset %" PRIu64 " (sectors).\n"), ARG_UINT64(OPT_OFFSET_ID) * 2);
|
log_std(_("Adjusting --reduce-device-size value to twice the --offset %" PRIu64 " (sectors).\n"), ARG_UINT64(OPT_OFFSET_ID) * 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strncmp(type, CRYPT_LUKS2, strlen(CRYPT_LUKS2))) {
|
|
||||||
log_err(_("Encryption is supported only for LUKS2 format."));
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ARG_SET(OPT_UUID_ID) && uuid_parse(ARG_STR(OPT_UUID_ID), uuid) == -1) {
|
if (ARG_SET(OPT_UUID_ID) && uuid_parse(ARG_STR(OPT_UUID_ID), uuid) == -1) {
|
||||||
log_err(_("Wrong LUKS UUID format provided."));
|
log_err(_("Wrong LUKS UUID format provided."));
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|||||||
Reference in New Issue
Block a user