summaryrefslogtreecommitdiff
path: root/lib/tpm-v2.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2022-08-30 21:05:32 -0600
committerIlias Apalodimas <ilias.apalodimas@linaro.org>2022-09-03 16:53:58 +0300
commita557d258c6be49ec1253947a227189de149971df (patch)
tree0ebddc51dc00db955a9c3335a8836f1e6447383e /lib/tpm-v2.c
parent67fe8cc0016756f3479288b3f67d59a517e512d5 (diff)
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 <sjg@chromium.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Diffstat (limited to 'lib/tpm-v2.c')
-rw-r--r--lib/tpm-v2.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/tpm-v2.c b/lib/tpm-v2.c
index 1bf627853a..6058f2e1e4 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