From a322f54f50cfb2e8e7a68968c060b2fd3dbd934d Mon Sep 17 00:00:00 2001 From: Ilias Apalodimas Date: Thu, 5 Nov 2020 23:58:43 +0200 Subject: tpm: Change response length of tpm2_get_capability() For implementing the EFI_TCG2_PROTOCOL we need the count field returned by the TPM when reading capabilities via tpm2_get_capability(). Adjust the implementation of the 'tpm2 get_capability' command accordingly. Suggested-by: Heinrich Schuchardt Signed-off-by: Ilias Apalodimas Reviewed-by: Heinrich Schuchardt --- cmd/tpm-v2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cmd') diff --git a/cmd/tpm-v2.c b/cmd/tpm-v2.c index e6742656f57..5fa4788a72d 100644 --- a/cmd/tpm-v2.c +++ b/cmd/tpm-v2.c @@ -191,10 +191,10 @@ static int do_tpm_get_capability(struct cmd_tbl *cmdtp, int flag, int argc, for (i = 0; i < count; i++) { printf("Property 0x"); for (j = 0; j < 4; j++) - printf("%02x", data[(i * 8) + j]); + printf("%02x", data[(i * 8) + j + sizeof(u32)]); printf(": 0x"); for (j = 4; j < 8; j++) - printf("%02x", data[(i * 8) + j]); + printf("%02x", data[(i * 8) + j + sizeof(u32)]); printf("\n"); } -- cgit v1.2.3