security/tpm: improve tlcl_extend() signature

Until now tcg-2.0/tss.c was just assuming certain buffer size and
hash algorithm. Change it to accept digest type, which the call sites
know.

Also drop `uint8_t *out_digest` parameter which was always `NULL`
and was handled only by tcg-1.2 code.

Change-Id: I944302b502e3424c5041b17c713a867b0fc535c4
Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/68745
Reviewed-by: Julius Werner <jwerner@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Frans Hendriks <fhendriks@eltan.com>
This commit is contained in:
Sergii Dmytruk
2022-10-22 20:11:35 +03:00
committed by Martin L Roth
parent 3ff77016da
commit 7221a6cfc5
6 changed files with 42 additions and 26 deletions

View File

@@ -171,7 +171,7 @@ int tspi_measure_cache_to_pcr(void)
tce->name, tce->pcr);
int result = tlcl_extend(tce->pcr,
tce->digest,
NULL);
TPM_MEASURE_ALGO);
if (result != TPM_SUCCESS) {
printk(BIOS_ERR, "TPM: Writing digest"
" of %s into PCR failed with error"