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>
This commit is contained in:
Ilias Apalodimas
2020-11-05 23:58:43 +02:00
committed by Heinrich Schuchardt
parent b1aa6fcf27
commit a322f54f50
2 changed files with 4 additions and 4 deletions

View File

@@ -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");
}