From: Mimi Zohar <zohar@linux.ibm.com>
To: "Guozihua (Scott)" <guozihua@huawei.com>,
linux-integrity@vger.kernel.org
Cc: Eric Biggers <ebiggers@kernel.org>,
Stefan Berger <stefanb@linux.ibm.com>,
linux-fscrypt@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v7 2/5] ima: define a new template field named 'd-ngv2' and templates
Date: Mon, 28 Mar 2022 09:50:37 -0400 [thread overview]
Message-ID: <2c54d52208b1f5b3c628e6a52f5fbd0af3fff6f3.camel@linux.ibm.com> (raw)
In-Reply-To: <889cca45-4697-6edb-41f5-83cf6340bf32@huawei.com>
On Mon, 2022-03-28 at 14:14 +0800, Guozihua (Scott) wrote:
> > @@ -265,26 +285,39 @@ int ima_parse_buf(void *bufstartp, void *bufendp, void **bufcurp,
> > }
> >
> > static int ima_eventdigest_init_common(const u8 *digest, u32 digestsize,
> > - u8 hash_algo,
> > + u8 digest_type, u8 hash_algo,
> > struct ima_field_data *field_data)
> > {
> > /*
> > * digest formats:
> > * - DATA_FMT_DIGEST: digest
> > * - DATA_FMT_DIGEST_WITH_ALGO: [<hash algo>] + ':' + '\0' + digest,
> > + * - DATA_FMT_DIGEST_WITH_TYPE_AND_ALGO:
> > + * [<digest type> + ':' + <hash algo>] + ':' + '\0' + digest,
> > + * where <hash type> is either "ima" or "verity",
> > * where <hash algo> is provided if the hash algorithm is not
> > * SHA1 or MD5
> > */
> > - u8 buffer[CRYPTO_MAX_ALG_NAME + 2 + IMA_MAX_DIGEST_SIZE] = { 0 };
> > + u8 buffer[DIGEST_TYPE_NAME_LEN_MAX + CRYPTO_MAX_ALG_NAME + 2 +
> > + IMA_MAX_DIGEST_SIZE] = { 0 };
>
> Hi Mimi,
>
> Shouldn't this contains an additional ":", Thus should +1 again?
The length of the CRYPTO_MAX_ALG_NAME includes room for the terminating
NULL. In this case, the terminating NULL isn't needed. It's replaced
with the ':'.
thanks,
Mimi
>
> > enum data_formats fmt = DATA_FMT_DIGEST;
> > u32 offset = 0;
> >
next prev parent reply other threads:[~2022-03-28 13:50 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-25 22:38 [PATCH v7 0/5] ima: support fs-verity digests and signatures Mimi Zohar
2022-03-25 22:38 ` [PATCH v7 1/5] fs-verity: define a function to return the integrity protected file digest Mimi Zohar
2022-03-28 3:45 ` Guozihua (Scott)
2022-03-28 13:51 ` Mimi Zohar
2022-03-25 22:38 ` [PATCH v7 2/5] ima: define a new template field named 'd-ngv2' and templates Mimi Zohar
2022-03-28 6:14 ` Guozihua (Scott)
2022-03-28 13:50 ` Mimi Zohar [this message]
2022-04-05 19:11 ` Eric Biggers
2022-04-28 2:03 ` Mimi Zohar
2022-03-25 22:38 ` [PATCH v7 3/5] ima: permit fsverity's file digests in the IMA measurement list Mimi Zohar
2022-04-05 19:28 ` Eric Biggers
2022-04-28 2:03 ` Mimi Zohar
2022-03-25 22:38 ` [PATCH v7 4/5] ima: support fs-verity file digest based version 3 signatures Mimi Zohar
2022-04-05 20:31 ` Eric Biggers
2022-04-28 2:05 ` Mimi Zohar
2022-03-25 22:38 ` [PATCH v7 5/5] fsverity: update the documentation Mimi Zohar
2022-04-05 20:35 ` Eric Biggers
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=2c54d52208b1f5b3c628e6a52f5fbd0af3fff6f3.camel@linux.ibm.com \
--to=zohar@linux.ibm.com \
--cc=ebiggers@kernel.org \
--cc=guozihua@huawei.com \
--cc=linux-fscrypt@vger.kernel.org \
--cc=linux-integrity@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stefanb@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