security/tpm/tspi/crtm.c: Fix early init

If the early crtm is not initialised there is nothing to write to PCR
in the early tpm init.

Change-Id: I9fa05f04588321163afc817de29c03bd426fc1f0
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/55470
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Johnny Lin <Johnny_Lin@wiwynn.com>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Christian Walter <christian.walter@9elements.com>
Reviewed-by: Julius Werner <jwerner@chromium.org>
This commit is contained in:
Arthur Heymans 2021-06-14 09:18:45 +02:00 committed by Patrick Georgi
parent 8a6907c592
commit d873fa8a8e
1 changed files with 4 additions and 0 deletions

View File

@ -178,6 +178,10 @@ int tspi_measure_cache_to_pcr(void)
enum vb2_hash_algorithm hash_alg;
struct tcpa_table *tclt = tcpa_log_init();
/* This means the table is empty. */
if (!tcpa_log_available())
return VB2_SUCCESS;
if (!tclt) {
printk(BIOS_WARNING, "TCPA: Log non-existent!\n");
return VB2_ERROR_UNKNOWN;