/* Check authenticatedAttributes are provided or not provided consistently.  */
static int pkcs7_check_authattrs(struct pkcs7_message *msg)
/* Check authenticatedAttributes are provided or not provided consistently.  */
static int pkcs7_check_authattrs(struct pkcs7_message *msg)
{
	struct pkcs7_signed_info *sinfo;
	bool want = false;
	sinfo = msg->signed_infos;
	if (!sinfo)
		goto inconsistent;
	if (sinfo->authattrs) {
		want = true;
		msg->have_authattrs = true;
	}
	for (sinfo = sinfo->next; sinfo; sinfo = sinfo->next)
		if (!!sinfo->authattrs != want)
			goto inconsistent;
	return 0;
inconsistent:
	pr_warn("Inconsistently supplied authAttrs\n");
	return -EINVAL;
}