vendorcode/eltan/security: Address layout issues

Corrected several layout issues in the mboot.c file.

BUG=N/A
TEST=build

Change-Id: I1599c7be075130345f018a08bede3eb849129a1c
Signed-off-by: Wim Vervoorn <wvervoorn@eltan.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/36485
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Frans Hendriks <fhendriks@eltan.com>
This commit is contained in:
Wim Vervoorn 2019-10-30 17:14:58 +01:00 committed by Patrick Georgi
parent be820b3911
commit d1fb78dbfc
1 changed files with 12 additions and 17 deletions

View File

@ -335,11 +335,11 @@ int mb_measure_log_worker(EFI_TCG2_EVENT_ALGORITHM_BITMAP activePcr,
* *
*mb_entry *mb_entry
* *
* initializes measured boot mechanism, initializes the * initializes measured boot mechanism, initializes the tpm library and starts the tpm called
* tpm library and starts the tpm called by mb_measure * by mb_measure
* *
* The function can be overridden at the mainboard level my simply creating a * The function can be overridden at the mainboard level my simply creating a function with the
* function with the same name there. * same name there.
* *
* @param[in] wake_from_s3 1 if we are waking from S3, 0 standard boot * @param[in] wake_from_s3 1 if we are waking from S3, 0 standard boot
* *
@ -354,8 +354,7 @@ int __attribute__((weak)) mb_entry(int wake_from_s3)
/* Initialize TPM driver. */ /* Initialize TPM driver. */
printk(BIOS_DEBUG, "%s: tlcl_lib_init\n", __func__); printk(BIOS_DEBUG, "%s: tlcl_lib_init\n", __func__);
if (tlcl_lib_init() != VB2_SUCCESS) { if (tlcl_lib_init() != VB2_SUCCESS) {
printk(BIOS_ERR, "%s: TPM driver initialization failed.\n", printk(BIOS_ERR, "%s: TPM driver initialization failed.\n", __func__);
__func__);
return TPM_E_IOERROR; return TPM_E_IOERROR;
} }
@ -368,8 +367,7 @@ int __attribute__((weak)) mb_entry(int wake_from_s3)
} }
if (status) if (status)
printk(BIOS_ERR, "%s: StartUp failed 0x%x!\n", __func__, printk(BIOS_ERR, "%s: StartUp failed 0x%x!\n", __func__, status);
status);
return status; return status;
} }
@ -402,18 +400,16 @@ int __attribute__((weak))mb_measure(int wake_from_s3)
printk(BIOS_DEBUG, "%s: StartUp, successful!\n", __func__); printk(BIOS_DEBUG, "%s: StartUp, successful!\n", __func__);
status = mb_measure_log_start(); status = mb_measure_log_start();
if (status == TPM_SUCCESS) { if (status == TPM_SUCCESS) {
printk(BIOS_DEBUG, "%s: Measuring, successful!\n", printk(BIOS_DEBUG, "%s: Measuring, successful!\n", __func__);
__func__);
} else { } else {
invalidate_pcrs(); invalidate_pcrs();
printk(BIOS_ERR, "%s: Measuring returned 0x%x " printk(BIOS_ERR, "%s: Measuring returned 0x%x unsuccessful! PCRs invalidated.\n",
"unsuccessful! PCRs invalidated.\n",
__func__, status); __func__, status);
} }
} else { } else {
invalidate_pcrs(); invalidate_pcrs();
printk(BIOS_ERR, "%s: StartUp returned 0x%x, unsuccessful!" printk(BIOS_ERR, "%s: StartUp returned 0x%x, unsuccessful! PCRs invalidated.\n", __func__,
"PCRs invalidated.\n", __func__, status); status);
} }
return status; return status;
} }
@ -519,8 +515,7 @@ int __attribute__((weak))mb_crtm(EFI_TCG2_EVENT_ALGORITHM_BITMAP activePcr)
tcgEventHdr.eventSize, &tcgEventHdr, (uint8_t *)crtm_version, tcgEventHdr.eventSize, &tcgEventHdr, (uint8_t *)crtm_version,
0); 0);
if (status) { if (status) {
printk(BIOS_DEBUG, "Measure CRTM Version returned 0x%x\n", printk(BIOS_DEBUG, "Measure CRTM Version returned 0x%x\n", status);
status);
return status; return status;
} }