diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2015-12-29 23:14:22 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2016-01-05 15:05:14 -0500 |
commit | e98fafaa5e68d4fa65f872e522d2f8da10f68363 (patch) | |
tree | 11e71e801880d4cc3771e5f57e845523a18b9e41 /src/tcgbios.c | |
parent | 71479612401b794e6cb5025f61e5352c51f35877 (diff) | |
download | seabios-hppa-e98fafaa5e68d4fa65f872e522d2f8da10f68363.zip seabios-hppa-e98fafaa5e68d4fa65f872e522d2f8da10f68363.tar.gz seabios-hppa-e98fafaa5e68d4fa65f872e522d2f8da10f68363.tar.bz2 |
tpm: Don't return a status from external bios measurement functions
The callers of the measurements don't care what happens, so no need to
return a status.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/tcgbios.c')
-rw-r--r-- | src/tcgbios.c | 58 |
1 files changed, 28 insertions, 30 deletions
diff --git a/src/tcgbios.c b/src/tcgbios.c index e6512e8..506626e 100644 --- a/src/tcgbios.c +++ b/src/tcgbios.c @@ -552,43 +552,41 @@ err_exit: /* * Add measurement to the log about an option rom */ -u32 +void tpm_option_rom(const void *addr, u32 len) { if (!tpm_is_working()) - return TCG_GENERAL_ERROR; + return; - u32 rc; struct pcctes_romex pcctes = { .eventid = 7, .eventdatasize = sizeof(u16) + sizeof(u16) + SHA1_BUFSIZE, }; - - rc = sha1((const u8 *)addr, len, pcctes.digest); + u32 rc = sha1((const u8 *)addr, len, pcctes.digest); if (rc) - return rc; + return; - return tpm_add_measurement_to_log(2, - EV_EVENT_TAG, - (const char *)&pcctes, sizeof(pcctes), - (u8 *)&pcctes, sizeof(pcctes)); + tpm_add_measurement_to_log(2, + EV_EVENT_TAG, + (const char *)&pcctes, sizeof(pcctes), + (u8 *)&pcctes, sizeof(pcctes)); } -u32 +void tpm_add_bcv(u32 bootdrv, const u8 *addr, u32 length) { if (!tpm_is_working()) - return TCG_GENERAL_ERROR; + return; if (length < 0x200) - return TCG_INVALID_INPUT_PARA; + return; const char *string = "Booting BCV device 00h (Floppy)"; if (bootdrv == 0x80) string = "Booting BCV device 80h (HDD)"; u32 rc = tpm_add_action(4, string); if (rc) - return rc; + return; /* specs: see section 'Hard Disk Device or Hard Disk-Like Devices' */ /* equivalent to: dd if=/dev/hda ibs=1 count=440 | sha1sum */ @@ -597,47 +595,47 @@ tpm_add_bcv(u32 bootdrv, const u8 *addr, u32 length) string, strlen(string), addr, 0x1b8); if (rc) - return rc; + return; /* equivalent to: dd if=/dev/hda ibs=1 count=72 skip=440 | sha1sum */ string = "MBR PARTITION_TABLE"; - return tpm_add_measurement_to_log(5, EV_IPL_PARTITION_DATA, - string, strlen(string), - addr + 0x1b8, 0x48); + tpm_add_measurement_to_log(5, EV_IPL_PARTITION_DATA, + string, strlen(string), + addr + 0x1b8, 0x48); } -u32 +void tpm_add_cdrom(u32 bootdrv, const u8 *addr, u32 length) { if (!tpm_is_working()) - return TCG_GENERAL_ERROR; + return; u32 rc = tpm_add_action(4, "Booting from CD ROM device"); if (rc) - return rc; + return; /* specs: see section 'El Torito' */ const char *string = "EL TORITO IPL"; - return tpm_add_measurement_to_log(4, EV_IPL, - string, strlen(string), - addr, length); + tpm_add_measurement_to_log(4, EV_IPL, + string, strlen(string), + addr, length); } -u32 +void tpm_add_cdrom_catalog(const u8 *addr, u32 length) { if (!tpm_is_working()) - return TCG_GENERAL_ERROR; + return; u32 rc = tpm_add_action(4, "Booting from CD ROM device"); if (rc) - return rc; + return; /* specs: see section 'El Torito' */ const char *string = "BOOT CATALOG"; - return tpm_add_measurement_to_log(5, EV_IPL_PARTITION_DATA, - string, strlen(string), - addr, length); + tpm_add_measurement_to_log(5, EV_IPL_PARTITION_DATA, + string, strlen(string), + addr, length); } void |