aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2022-08-30 21:05:33 -0600
committerIlias Apalodimas <ilias.apalodimas@linaro.org>2022-09-03 16:54:02 +0300
commita0f3804a424d6efa3a9d380c769fbfd6391f9ed9 (patch)
tree9fac3d197f33547c3458e108a5ab9e839cedb12a
parenta557d258c6be49ec1253947a227189de149971df (diff)
downloadu-boot-a0f3804a424d6efa3a9d380c769fbfd6391f9ed9.zip
u-boot-a0f3804a424d6efa3a9d380c769fbfd6391f9ed9.tar.gz
u-boot-a0f3804a424d6efa3a9d380c769fbfd6391f9ed9.tar.bz2
tpm: Correct the permissions command in TPMv1
The offset here is incorrect. Fix it. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
-rw-r--r--lib/tpm-v1.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/tpm-v1.c b/lib/tpm-v1.c
index 22a769c..d0e3ab1 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);