Fail if integrity option is used with LUKS1 format.

This commit is contained in:
Milan Broz
2017-10-17 10:37:17 +02:00
parent 961e65424e
commit 702bcb8684

View File

@@ -999,7 +999,10 @@ static int action_luksFormat(void)
goto out;
}
if (luks_version == 2 && opt_integrity) {
if (luks_version != 2 && opt_integrity) {
log_err(_("Integrity option can be used only for LUKS2 format.\n"));
goto out;
} if (opt_integrity) {
r = crypt_parse_integrity_mode(opt_integrity, integrity, &integrity_keysize);
if (r < 0) {
log_err(_("No known integrity specification pattern detected.\n"));