From a557d258c6be49ec1253947a227189de149971df Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Tue, 30 Aug 2022 21:05:32 -0600 Subject: tpm: Require a digest source when extending the PCR This feature is used for measured boot, so we can add a log entry to the TCPA with some information about where the digest comes from. It is not currently supported in the TPM drivers, but add it to the API so that code which expects it can signal its request. Signed-off-by: Simon Glass Reviewed-by: Ilias Apalodimas Signed-off-by: Ilias Apalodimas --- lib/tpm-v2.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/tpm-v2.c') diff --git a/lib/tpm-v2.c b/lib/tpm-v2.c index 1bf6278..6058f2e 100644 --- a/lib/tpm-v2.c +++ b/lib/tpm-v2.c @@ -157,6 +157,8 @@ u32 tpm2_pcr_extend(struct udevice *dev, u32 index, u32 algorithm, }; int ret; + if (!digest) + return -EINVAL; /* * Fill the command structure starting from the first buffer: * - the digest -- cgit v1.1