From: Stefan Berger <stefanb@linux.ibm.com>
To: Mimi Zohar <zohar@linux.ibm.com>, linux-integrity@vger.kernel.org
Cc: Eric Biggers <ebiggers@kernel.org>,
linux-fscrypt@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v6 2/5] ima: define a new template field named 'd-ngv2' and templates
Date: Mon, 21 Mar 2022 16:46:57 -0400 [thread overview]
Message-ID: <ed3ea52c-a59f-358c-4753-125225bc39f2@linux.ibm.com> (raw)
In-Reply-To: <31254e743b73a43f6f27679678318d0d8744a355.camel@linux.ibm.com>
On 3/21/22 15:48, Mimi Zohar wrote:
> On Mon, 2022-03-21 at 08:53 -0400, Stefan Berger wrote:
>>> +
>>> +/*
>>> + * This function writes the digest of an event (without size limit),
>>> + * prefixed with both the hash type and algorithm.
>>> + */
>>> +int ima_eventdigest_ngv2_init(struct ima_event_data *event_data,
>>> + struct ima_field_data *field_data)
>>> +{
>>> + u8 *cur_digest = NULL, hash_algo = HASH_ALGO_SHA1;
>>> + u32 cur_digestsize = 0;
>>> + u8 digest_type = 0;
>>
>> What does '0' mean? I think this should definitely be an enum or at
>> least #define.
>
> The first element of the array is "ima". Should I define two macros
> similar to kernel_read_file_id and kernel_read_file_str for just two
> strings?
I would introduce an enum like enum hash_algo:
https://elixir.bootlin.com/linux/latest/source/include/uapi/linux/hash_info.h#L38
And an array like hash_algo_name:
https://elixir.bootlin.com/linux/latest/source/crypto/hash_info.c#L12
>
> thanks,
>
> Mimi
>
next prev parent reply other threads:[~2022-03-21 20:47 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-18 18:21 [PATCH v6 0/5] ima: support fs-verity digests and signatures Mimi Zohar
2022-03-18 18:21 ` [PATCH v6 1/5] fs-verity: define a function to return the integrity protected file digest Mimi Zohar
2022-03-18 18:21 ` [PATCH v6 2/5] ima: define a new template field named 'd-ngv2' and templates Mimi Zohar
2022-03-21 12:53 ` Stefan Berger
2022-03-21 19:48 ` Mimi Zohar
2022-03-21 20:46 ` Stefan Berger [this message]
2022-03-18 18:21 ` [PATCH v6 3/5] ima: permit fsverity's file digests in the IMA measurement list Mimi Zohar
2022-03-21 12:59 ` Stefan Berger
2022-03-21 19:54 ` Mimi Zohar
2022-03-18 18:21 ` [PATCH v6 4/5] ima: support fs-verity file digest based version 3 signatures Mimi Zohar
2022-03-21 13:10 ` Stefan Berger
2022-03-25 12:31 ` Mimi Zohar
2022-03-25 13:49 ` Stefan Berger
2022-03-18 18:21 ` [PATCH v6 5/5] fsverity: update the documentation Mimi Zohar
2022-03-18 20:55 ` Stefan Berger
2022-03-21 12:55 ` Mimi Zohar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ed3ea52c-a59f-358c-4753-125225bc39f2@linux.ibm.com \
--to=stefanb@linux.ibm.com \
--cc=ebiggers@kernel.org \
--cc=linux-fscrypt@vger.kernel.org \
--cc=linux-integrity@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=zohar@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox