diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2015-11-22 18:51:31 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2015-11-23 22:54:33 -0500 |
commit | 4e7cf9c1275fd86a75072cafb3edf463f91897c0 (patch) | |
tree | 37b4de82c96cc0260208133e358453adb1b849a7 | |
parent | 7ba0568234c91432f54c9a65511c7d02b3b51eb0 (diff) | |
download | seabios-hppa-4e7cf9c1275fd86a75072cafb3edf463f91897c0.zip seabios-hppa-4e7cf9c1275fd86a75072cafb3edf463f91897c0.tar.gz seabios-hppa-4e7cf9c1275fd86a75072cafb3edf463f91897c0.tar.bz2 |
tpm: Merge tpm_log_event() and tpm_extend_acpi_log()
Merge tpm_extend_acpi_log() and tpm_log_event(). Move error checking
and handling to callers. Don't shutdown the TPM on a failure from the
16bit BIOS interface.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
-rw-r--r-- | src/tcgbios.c | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/src/tcgbios.c b/src/tcgbios.c index e5cb9eb..704993f 100644 --- a/src/tcgbios.c +++ b/src/tcgbios.c @@ -280,7 +280,7 @@ reset_acpi_log(void) * Returns an error code in case of faiure, 0 in case of success */ static u32 -tpm_extend_acpi_log(struct pcpes *pcpes, const void *event) +tpm_log_event(struct pcpes *pcpes, const void *event) { dprintf(DEBUG_tcg, "TCGBIOS: LASA = %p, next entry = %p\n", tpm_state.log_area_start_address, tpm_state.log_area_next_entry); @@ -468,26 +468,19 @@ tpm_extend(u8 *hash, u32 pcrindex) } static u32 -tpm_log_event(struct pcpes *pcpes, const void *event) +tpm_log_extend_event(struct pcpes *pcpes, const void *event) { - if (pcpes->pcrindex >= 24) - return TCG_INVALID_INPUT_PARA; - if (!has_working_tpm()) return TCG_GENERAL_ERROR; - u32 rc = tpm_extend_acpi_log(pcpes, event); - if (rc) - tpm_set_failure(); - return rc; -} + if (pcpes->pcrindex >= 24) + return TCG_INVALID_INPUT_PARA; -static u32 -tpm_log_extend_event(struct pcpes *pcpes, const void *event) -{ u32 rc = tpm_log_event(pcpes, event); - if (rc) + if (rc) { + tpm_set_failure(); return rc; + } return tpm_extend(pcpes->digest, pcpes->pcrindex); } |