The pcrindex is already in pcpes->pcrindex, so no need to pass it as a parameter.
Signed-off-by: Kevin O'Connor kevin@koconnor.net --- src/tcgbios.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/src/tcgbios.c b/src/tcgbios.c index 5461a54..1fb8e5c 100644 --- a/src/tcgbios.c +++ b/src/tcgbios.c @@ -540,8 +540,7 @@ hash_log_event(const void *hashdata, u32 hashdata_length, static u32 hash_log_extend_event(const void *hashdata, u32 hashdata_length, struct pcpes *pcpes, - const char *event, u32 event_length, - u32 pcrindex) + const char *event, u32 event_length) { u32 rc;
@@ -550,7 +549,7 @@ hash_log_extend_event(const void *hashdata, u32 hashdata_length, if (rc) return rc;
- return tpm_extend(pcpes->digest, pcrindex); + return tpm_extend(pcpes->digest, pcpes->pcrindex); }
/* @@ -575,7 +574,7 @@ tpm_add_measurement_to_log(u32 pcrindex, u32 event_type, .eventtype = event_type, }; return hash_log_extend_event(hashdata, hashdata_length, &pcpes, - event, event_length, pcrindex); + event, event_length); }
@@ -994,8 +993,7 @@ hash_log_extend_event_int(const struct hleei_short *hleei_s,
rc = hash_log_extend_event(hleei_s->hashdataptr, hleei_s->hashdatalen, pcpes, - (char *)&pcpes->event, pcpes->eventdatasize, - pcrindex); + (char *)&pcpes->event, pcpes->eventdatasize); if (rc) goto err_exit;
@@ -1169,8 +1167,7 @@ compact_hash_log_extend_event_int(u8 *buffer,
rc = hash_log_extend_event(buffer, length, &pcpes, - (char *)&pcpes.event, pcpes.eventdatasize, - pcpes.pcrindex); + (char *)&pcpes.event, pcpes.eventdatasize);
if (rc == 0) *edx_ptr = tpm_state.entry_count;