aboutsummaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorRuchika Gupta2021-11-29 13:09:45 +0530
committerHeinrich Schuchardt2021-11-30 09:23:49 +0100
commit2957a1e22407a84a2cc7c4ea5a8136af1d0278d9 (patch)
tree7f4cc42de253c761e6d94906a6f777e3216b8174 /cmd
parent34287efdaf6ed186a64445f65227b5407a1dcd63 (diff)
tpm: use more algorithms than sha256 on pcr_read
The current tpm2_pcr_read is hardcoded using SHA256. Make the actual command to TPM configurable to use wider range of algorithms. The current command line is kept as is i.e limited to SHA-256 only. Signed-off-by: Ruchika Gupta <ruchika.gupta@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.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 daae91100a2..4ea5f9f094f 100644
--- a/cmd/tpm-v2.c
+++ b/cmd/tpm-v2.c
@@ -151,7 +151,8 @@ static int do_tpm_pcr_read(struct cmd_tbl *cmdtp, int flag, int argc,
data = map_sysmem(simple_strtoul(argv[2], NULL, 0), 0);
- rc = tpm2_pcr_read(dev, index, priv->pcr_select_min, data, &updates);
+ rc = tpm2_pcr_read(dev, index, priv->pcr_select_min, TPM2_ALG_SHA256,
+ data, TPM2_DIGEST_LEN, &updates);
if (!rc) {
printf("PCR #%u content (%u known updates):\n", index, updates);
print_byte_string(data, TPM2_DIGEST_LEN);