U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Ilias Apalodimas <ilias.apalodimas@linaro.org>
To: Benjamin BARATTE <benjamin.baratte@st.com>
Cc: "u-boot@lists.denx.de" <u-boot@lists.denx.de>,
	"eajames@linux.ibm.com" <eajames@linux.ibm.com>,
	"xypron.glpk@gmx.de" <xypron.glpk@gmx.de>,
	"sjg@chromium.org" <sjg@chromium.org>,
	"tharvey@gateworks.com" <tharvey@gateworks.com>,
	"trini@konsulko.com" <trini@konsulko.com>
Subject: Re: [PATCH 2/3] tpm: remove check on pcr bank count
Date: Mon, 29 Jul 2024 17:05:39 +0300	[thread overview]
Message-ID: <Zqehs3kedwXDeCU7@hera> (raw)
In-Reply-To: <DU0PR10MB52447C746D35B2C948CD2003E1A12@DU0PR10MB5244.EURPRD10.PROD.OUTLOOK.COM>

On Mon, Jul 15, 2024 at 01:33:18PM +0000, Benjamin BARATTE wrote:
> The number of PCR banks return by the tpm2_get_pcr_info() is related to
> TPM supported list of hash algorithm that could be greater than thus
> supported by U-Boot. This is not an issue as long as the PCR active bank
> hash an hash algorithm supported by U-Boot.
> Therefore, checking the number of PCR bank supported by the dTPM and
> thus supported by U-Boot doesn't make sense.
> This test shall be removed or shall reflect the maximum hash algorithm
> defined by the TPM2.0 spec 1.59 which is 8 hash algorithms.
>
> Signed-off-by: Benjamin BARATTE <benjamin.baratte@st.com>
> ---
>
>  lib/tpm-v2.c | 8 --------
>  1 file changed, 8 deletions(-)
>
> diff --git a/lib/tpm-v2.c b/lib/tpm-v2.c
> index 59e6cbafaf..64a2f15fee 100644
> --- a/lib/tpm-v2.c
> +++ b/lib/tpm-v2.c
> @@ -413,14 +413,6 @@ int tpm2_get_pcr_info(struct udevice *dev, struct tpml_pcr_selection *pcrs)
>                 return ret;
>
>         pcrs->count = get_unaligned_be32(response);
> -       /*
> -        * We only support 4 algorithms for now so check against that
> -        * instead of TPM2_NUM_PCR_BANKS
> -        */
> -       if (pcrs->count > 4 || pcrs->count < 1) {
> -               printf("%s: too many pcrs: %u\n", __func__, pcrs->count);
> -               return -EMSGSIZE;
> -       }
>
>         ret = tpm2_get_num_pcr(dev, &num_pcr);
>         if (ret)
> --
> 2.34.1
>

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>

> ST Restricted

      reply	other threads:[~2024-07-29 14:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-15 13:33 [PATCH 2/3] tpm: remove check on pcr bank count Benjamin BARATTE
2024-07-29 14:05 ` Ilias Apalodimas [this message]

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=Zqehs3kedwXDeCU7@hera \
    --to=ilias.apalodimas@linaro.org \
    --cc=benjamin.baratte@st.com \
    --cc=eajames@linux.ibm.com \
    --cc=sjg@chromium.org \
    --cc=tharvey@gateworks.com \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=xypron.glpk@gmx.de \
    /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