return log_syntax(NULL, LOG_ERR, path, 1, SYNTHETIC_ERRNO(EINVAL),
"Encrypting verity hash/data partitions is not supported.");
- if (p->verity == VERITY_SIG && !arg_private_key && !partition_type_defer(&p->type))
- return log_syntax(NULL, LOG_ERR, path, 1, SYNTHETIC_ERRNO(EINVAL),
- "Verity signature partition requested but no private key provided (--private-key=).");
-
- if (p->verity == VERITY_SIG && !arg_certificate && !partition_type_defer(&p->type))
- return log_syntax(NULL, LOG_ERR, path, 1, SYNTHETIC_ERRNO(EINVAL),
- "Verity signature partition requested but no PEM certificate provided (--certificate=).");
-
if (p->verity == VERITY_SIG && (p->size_min != UINT64_MAX || p->size_max != UINT64_MAX))
return log_syntax(NULL, LOG_ERR, path, 1, SYNTHETIC_ERRNO(EINVAL),
"SizeMinBytes=/SizeMaxBytes= cannot be used with Verity=%s.",
if (PARTITION_EXISTS(p))
return 0;
+ if (!context->private_key)
+ return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
+ "Verity signature partition signing requested but no private key provided (--private-key=).");
+
+ if (!context->certificate)
+ return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
+ "Verity signature partition signing requested but no PEM certificate provided (--certificate=).");
+
(void) partition_hint(p, context->node, &hint);
assert_se(hp = p->siblings[VERITY_HASH]);