Hi,
There is a logical error in function(bool evtlog_append(uint8_t pcr,
hash_list_t *hl, uint32_t type)).
In function evtlog_append,here always returns true whether it's TPM1.2 or
TPM2.0.
Signed-off-by: Shi Wangyi<shiwan...@gohighsec.com>
diff -r 4fbb0a7d2f57 -r 950c7f260cfe tboot/txt/txt.c
--- a/tboot/txt/txt.c Tue Jul 11 17:25:43 2017 -0700
+++ b/tboot/txt/txt.c Thu Jul 13 04:33:49 2017 +0800
@@ -430,12 +430,15 @@
{
switch (g_tpm->major) {
case TPM12_VER_MAJOR:
- evtlog_append_tpm12(pcr, &hl->entries[0].hash, type);
+ if ( !evtlog_append_tpm12(pcr, &hl->entries[0].hash, type) )
+ return false;
break;
case TPM20_VER_MAJOR:
- for (unsigned int i=0; i<hl->count; i++)
- evtlog_append_tpm20(pcr, hl->entries[i].alg,
- &hl->entries[i].hash, type);
+ for (unsigned int i=0; i<hl->count; i++) {
+ if ( !evtlog_append_tpm20(pcr, hl->entries[i].alg,
+ &hl->entries[i].hash, type) )
+ return false;
+ }
break;
default:
return false;
Thanks,
Wangyi
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
tboot-devel mailing list
tboot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tboot-devel