From: Simon Glass Date: Wed, 31 Aug 2022 03:05:33 +0000 (-0600) Subject: tpm: Correct the permissions command in TPMv1 X-Git-Url: http://git.dujemihanovic.xyz/img/sics.gif?a=commitdiff_plain;h=a0f3804a424d6efa3a9d380c769fbfd6391f9ed9;p=u-boot.git tpm: Correct the permissions command in TPMv1 The offset here is incorrect. Fix it. Signed-off-by: Simon Glass Acked-by: Ilias Apalodimas Signed-off-by: Ilias Apalodimas --- diff --git a/lib/tpm-v1.c b/lib/tpm-v1.c index 22a769c587..d0e3ab1b21 100644 --- a/lib/tpm-v1.c +++ b/lib/tpm-v1.c @@ -456,12 +456,13 @@ u32 tpm1_get_permissions(struct udevice *dev, u32 index, u32 *perm) 0x0, 0x0, 0x0, 0x4, }; const size_t index_offset = 18; - const size_t perm_offset = 60; + const size_t perm_offset = 74; u8 buf[COMMAND_BUFFER_SIZE], response[COMMAND_BUFFER_SIZE]; size_t response_length = sizeof(response); u32 err; - if (pack_byte_string(buf, sizeof(buf), "d", 0, command, sizeof(command), + if (pack_byte_string(buf, sizeof(buf), "sd", + 0, command, sizeof(command), index_offset, index)) return TPM_LIB_ERROR; err = tpm_sendrecv_command(dev, buf, response, &response_length);