From 1c4ea8f496b42c5c34634d78524937476539a8bd Mon Sep 17 00:00:00 2001 From: Miquel Raynal Date: Tue, 15 May 2018 11:57:16 +0200 Subject: tpm: add TPM2_PCR_Read command support Add support for the TPM2_PCR_Read command. Change the command file and the help accordingly. Signed-off-by: Miquel Raynal Reviewed-by: Simon Glass Reviewed-by: Tom Rini --- include/tpm-v2.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'include') diff --git a/include/tpm-v2.h b/include/tpm-v2.h index 25bb15a..2b8600a 100644 --- a/include/tpm-v2.h +++ b/include/tpm-v2.h @@ -164,4 +164,17 @@ u32 tpm2_clear(u32 handle, const char *pw, const ssize_t pw_sz); */ u32 tpm2_pcr_extend(u32 index, const uint8_t *digest); +/** + * Issue a TPM2_PCR_Read command. + * + * @idx Index of the PCR + * @idx_min_sz Minimum size in bytes of the pcrSelect array + * @data Output buffer for contents of the named PCR + * @updates Optional out parameter: number of updates for this PCR + * + * @return code of the operation + */ +u32 tpm2_pcr_read(u32 idx, unsigned int idx_min_sz, void *data, + unsigned int *updates); + #endif /* __TPM_V2_H */ -- cgit v1.1