summaryrefslogtreecommitdiff
path: root/lib/tpm-v2.c
diff options
context:
space:
mode:
authorIlias Apalodimas <ilias.apalodimas@linaro.org>2020-11-06 00:58:43 +0300
committerHeinrich Schuchardt <xypron.glpk@gmx.de>2020-11-09 19:28:18 +0300
commita322f54f50cfb2e8e7a68968c060b2fd3dbd934d (patch)
tree5a1da7557ca17a3a7c253d1a6f8fd72bb2b6d44e /lib/tpm-v2.c
parentb1aa6fcf274cb655ffb56eadcb9518fbb57e47b5 (diff)
downloadu-boot-a322f54f50cfb2e8e7a68968c060b2fd3dbd934d.tar.xz
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 <xypron.glpk@gmx.de> Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Diffstat (limited to 'lib/tpm-v2.c')
-rw-r--r--lib/tpm-v2.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/tpm-v2.c b/lib/tpm-v2.c
index a4c352e3ef..91759068cf 100644
--- a/lib/tpm-v2.c
+++ b/lib/tpm-v2.c
@@ -184,10 +184,10 @@ u32 tpm2_get_capability(struct udevice *dev, u32 capability, u32 property,
/*
* In the response buffer, the properties are located after the:
* tag (u16), response size (u32), response code (u32),
- * YES/NO flag (u8), TPM_CAP (u32) and TPMU_CAPABILITIES (u32).
+ * YES/NO flag (u8), TPM_CAP (u32).
*/
properties_off = sizeof(u16) + sizeof(u32) + sizeof(u32) +
- sizeof(u8) + sizeof(u32) + sizeof(u32);
+ sizeof(u8) + sizeof(u32);
memcpy(buf, &response[properties_off], response_len - properties_off);
return 0;