diff options
author | Philipp Deppenwiese <zaolin.daisuki@gmail.com> | 2018-11-10 00:35:02 +0100 |
---|---|---|
committer | Philipp Deppenwiese <zaolin.daisuki@gmail.com> | 2019-03-07 12:47:01 +0000 |
commit | c9b7d1fb57787d7037a5bce031a1300d13f5df40 (patch) | |
tree | 57788b70b069229693dae5727cb8acc54eee3c14 /util/cbmem/cbmem.c | |
parent | 7a732b4781e7b83abda3230055d7110e1db730f3 (diff) |
security/tpm: Fix TCPA log feature
Until now the TCPA log wasn't working correctly.
* Refactor TCPA log code.
* Add TCPA log dump fucntion.
* Make TCPA log available in bootblock.
* Fix TCPA log formatting.
* Add x86 and Cavium memory for early log.
Change-Id: Ic93133531b84318f48940d34bded48cbae739c44
Signed-off-by: Philipp Deppenwiese <zaolin.daisuki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/29563
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Rudolph <siro@das-labor.org>
Diffstat (limited to 'util/cbmem/cbmem.c')
-rw-r--r-- | util/cbmem/cbmem.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/util/cbmem/cbmem.c b/util/cbmem/cbmem.c index fc2dcdcc75..ae1d2127fb 100644 --- a/util/cbmem/cbmem.c +++ b/util/cbmem/cbmem.c @@ -690,8 +690,6 @@ static void dump_tcpa_log(void) const struct tcpa_table *tclt_p; size_t size; struct mapping tcpa_mapping; - char log_string[TCPA_LOG_STRING_LENGTH]; - char hash[TCPA_FORMAT_HASH_LENGTH]; if (tcpa_log.tag != LB_TAG_TCPA_LOG) { fprintf(stderr, "No tcpa log found in coreboot table.\n"); @@ -716,13 +714,12 @@ static void dump_tcpa_log(void) for (i = 0; i < tclt_p->num_entries; i++) { const struct tcpa_entry *tce = &tclt_p->entries[i]; - memset(log_string, 0, TCPA_LOG_STRING_LENGTH); + printf(" PCR-%u ", tce->pcr); + for (j = 0; j < tce->digest_length; j++) - sprintf((char *)&(hash[j * 2]), "%02x", tce->digest[j]); + printf("%02x", tce->digest[j]); - snprintf(log_string, TCPA_LOG_STRING_LENGTH, "%u %s 00 [%s]\n", - tce->pcr, hash, tce->name); - printf("%s", log_string); + printf(" %s [%s]\n", tce->digest_type, tce->name); } unmap_memory(&tcpa_mapping); |