diff options
author | Wim Vervoorn <wvervoorn@eltan.com> | 2019-10-30 16:46:41 +0100 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2019-11-04 11:30:17 +0000 |
commit | 944fdc477140d874c1c674954044c0c2b540abb2 (patch) | |
tree | ddce8d938bbd37ee409e8289c5b2144e492eed24 /src/vendorcode/eltan/security/verified_boot | |
parent | adf344013d30dc685bab3dbd148bdecb35e833b1 (diff) | |
download | coreboot-944fdc477140d874c1c674954044c0c2b540abb2.tar.xz |
vendorcode/eltan/security: Use custom hash for little endian only
Only use the custom hash routine when we need little endian.
Rename the function as well as it is little endian only now.
BUG=N/A
TEST=tested on fbg1701 board.
Change-Id: I037fa38c5961dab7a81e752c1685da2dc6b33d12
Signed-off-by: Wim Vervoorn <wvervoorn@eltan.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/36482
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Frans Hendriks <fhendriks@eltan.com>
Diffstat (limited to 'src/vendorcode/eltan/security/verified_boot')
-rw-r--r-- | src/vendorcode/eltan/security/verified_boot/vboot_check.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/vendorcode/eltan/security/verified_boot/vboot_check.c b/src/vendorcode/eltan/security/verified_boot/vboot_check.c index 07c69020c8..88519bdd78 100644 --- a/src/vendorcode/eltan/security/verified_boot/vboot_check.c +++ b/src/vendorcode/eltan/security/verified_boot/vboot_check.c @@ -74,7 +74,8 @@ int verified_boot_check_manifest(void) vb2_sig_hdr->sig_size = vb2_rsa_sig_size(VB2_SIG_RSA2048); vb2_sig_hdr->hash_alg = HASH_ALG; vb2_sig_hdr->data_size = CONFIG_VENDORCODE_ELTAN_OEM_MANIFEST_ITEMS * DIGEST_SIZE; - memcpy(&sig_buffer[sizeof(struct vb21_signature)], (uint8_t *)CONFIG_VENDORCODE_ELTAN_OEM_MANIFEST_LOC, size); + memcpy(&sig_buffer[sizeof(struct vb21_signature)], + (uint8_t *)CONFIG_VENDORCODE_ELTAN_OEM_MANIFEST_LOC, size); if (vb21_verify_data(&sig_buffer[sizeof(struct vb21_signature)], vb2_sig_hdr->data_size, (struct vb21_signature *)&sig_buffer, &key, &wb)) { @@ -185,7 +186,7 @@ static void verified_boot_check_buffer(const char *name, void *start, size_t siz else hash_algorithm = VB2_HASH_SHA256; - status = cb_sha_endian(hash_algorithm, (const uint8_t *)start, size, digest); + status = cb_sha_little_endian(hash_algorithm, (const uint8_t *)start, size, digest); if ((CONFIG(VENDORCODE_ELTAN_VBOOT) && memcmp((void *)( (uint8_t *)CONFIG_VENDORCODE_ELTAN_OEM_MANIFEST_LOC + sizeof(digest) * hash_index), digest, sizeof(digest))) || status) { @@ -203,7 +204,8 @@ static void verified_boot_check_buffer(const char *name, void *start, size_t siz printk(BIOS_DEBUG, "%s: measuring %s\n", __func__, name); if (measure_item(pcr, digest, sizeof(digest), (int8_t *)name, 0)) - printk(BIOS_DEBUG, "%s: measuring failed!\n", __func__); + printk(BIOS_DEBUG, "%s: measuring failed!\n", + __func__); } } #endif |