From: Kevin O'Connor Date: Sun, 22 Nov 2015 23:51:31 +0000 (-0500) Subject: tpm: Merge tpm_log_event() and tpm_extend_acpi_log() X-Git-Tag: rel-1.10.0~141 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=4e7cf9c1275fd86a75072cafb3edf463f91897c0;p=seabios.git 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 --- 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); }