Fail early if OPAL is selected with LUKS1.

This commit is contained in:
Ondrej Kozina
2023-10-27 15:05:18 +02:00
parent e6590e808a
commit 52b2dc5148

View File

@@ -1468,6 +1468,11 @@ int luksFormat(struct crypt_device **r_cd, char **r_password, size_t *r_password
log_err(_("Unsupported LUKS2 metadata size options."));
return -EINVAL;
}
if (ARG_SET(OPT_HW_OPAL_ID) || ARG_SET(OPT_HW_OPAL_ONLY_ID)) {
log_err(_("OPAL is supported only for LUKS2 format."));
return -EINVAL;
}
} else
return -EINVAL;