summaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorIlias Apalodimas <ilias.apalodimas@linaro.org>2020-11-26 23:07:22 +0200
committerHeinrich Schuchardt <xypron.glpk@gmx.de>2020-12-03 21:22:40 +0100
commite926136bb29cb9dda00f1b8960db963b6e97124b (patch)
tree6125a0fcda8cb9d079013084754843f21616ce51 /cmd
parentfc364424ac992ddae5779ae3ca8ddcd006a6ea27 (diff)
downloadu-boot-e926136bb29cb9dda00f1b8960db963b6e97124b.tar.gz
u-boot-e926136bb29cb9dda00f1b8960db963b6e97124b.tar.xz
u-boot-e926136bb29cb9dda00f1b8960db963b6e97124b.zip
tpm: use more than sha256 on pcr_extend
The current tpm2_pcr_extend is hardcoded using SHA256. Let's make the actual command to the TPM2 configurable so we can support a wider range of algorithms and keep the current command line as-is i.e limited to SHA256 only Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/tpm-v2.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/cmd/tpm-v2.c b/cmd/tpm-v2.c
index 5fa4788a72..daae91100a 100644
--- a/cmd/tpm-v2.c
+++ b/cmd/tpm-v2.c
@@ -116,7 +116,8 @@ static int do_tpm2_pcr_extend(struct cmd_tbl *cmdtp, int flag, int argc,
if (index >= priv->pcr_count)
return -EINVAL;
- rc = tpm2_pcr_extend(dev, index, digest);
+ rc = tpm2_pcr_extend(dev, index, TPM2_ALG_SHA256, digest,
+ TPM2_DIGEST_LEN);
unmap_sysmem(digest);