diff options
author | Sergii Dmytruk <sergii.dmytruk@3mdeb.com> | 2022-10-22 20:11:35 +0300 |
---|---|---|
committer | Martin L Roth <gaumless@gmail.com> | 2022-11-12 23:16:07 +0000 |
commit | 7221a6cfc5ccc45b188d36815d2b011142f2cf12 (patch) | |
tree | 2811c8ef5a5e1f4777471b6e223009c31f8eba63 /src/security/tpm/tspi | |
parent | 3ff77016da988d37ba0dbe44538c10f92b2704c5 (diff) |
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>
Diffstat (limited to 'src/security/tpm/tspi')
-rw-r--r-- | src/security/tpm/tspi/crtm.c | 2 | ||||
-rw-r--r-- | src/security/tpm/tspi/tspi.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/security/tpm/tspi/crtm.c b/src/security/tpm/tspi/crtm.c index 24133d9f9f..8eefc11a36 100644 --- a/src/security/tpm/tspi/crtm.c +++ b/src/security/tpm/tspi/crtm.c @@ -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" diff --git a/src/security/tpm/tspi/tspi.c b/src/security/tpm/tspi/tspi.c index 7bf8d6c293..54ba343ce3 100644 --- a/src/security/tpm/tspi/tspi.c +++ b/src/security/tpm/tspi/tspi.c @@ -233,7 +233,7 @@ uint32_t tpm_extend_pcr(int pcr, enum vb2_hash_algorithm digest_algo, } printk(BIOS_DEBUG, "TPM: Extending digest for `%s` into PCR %d\n", name, pcr); - result = tlcl_extend(pcr, digest, NULL); + result = tlcl_extend(pcr, digest, digest_algo); if (result != TPM_SUCCESS) { printk(BIOS_ERR, "TPM: Extending hash for `%s` into PCR %d failed.\n", name, pcr); |