[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2c54d52208b1f5b3c628e6a52f5fbd0af3fff6f3.camel@linux.ibm.com>
Date: Mon, 28 Mar 2022 09:50:37 -0400
From: Mimi Zohar <zohar@...ux.ibm.com>
To: "Guozihua (Scott)" <guozihua@...wei.com>,
linux-integrity@...r.kernel.org
Cc: Eric Biggers <ebiggers@...nel.org>,
Stefan Berger <stefanb@...ux.ibm.com>,
linux-fscrypt@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v7 2/5] ima: define a new template field named 'd-ngv2'
and templates
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;
> >
Powered by blists - more mailing lists