diff options
author | Randall Spangler <rspangler@chromium.org> | 2016-06-02 16:05:49 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2016-07-26 19:42:38 -0700 |
commit | 98263a1b17397032b3f7d747d48f8fd914217237 (patch) | |
tree | 5a9ce0f9da372f8a8d3ce49990d2d7de47e96a6a /futility/file_type_bios.c | |
parent | bba272a8776c61f308aafa5ed7d8bbd1f99f5282 (diff) | |
download | vboot-98263a1b17397032b3f7d747d48f8fd914217237.tar.gz |
vboot: Upgrade VerifyFirmwarePreamble() to vboot2.0
This replaces all calls to vboot1 VerifyFirmwarePreamble() with
equivalent vb2.0 functions. No effect on ToT firmware, which already
uses the vboot2.0 functions.
BUG=chromium:611535
BRANCH=none
TEST=make runtests
Change-Id: I5c84e9ed0e0c75e2ea8dbd9bfcde0597bc457f24
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/349322
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Diffstat (limited to 'futility/file_type_bios.c')
-rw-r--r-- | futility/file_type_bios.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/futility/file_type_bios.c b/futility/file_type_bios.c index 247bb3f9..037a007b 100644 --- a/futility/file_type_bios.c +++ b/futility/file_type_bios.c @@ -18,6 +18,7 @@ #include "gbb_header.h" #include "host_common.h" #include "vb1_helper.h" +#include "vb2_common.h" static const char * const fmap_name[] = { "GBB", /* BIOS_FMAP_GBB */ @@ -55,7 +56,7 @@ int ft_show_gbb(const char *name, uint8_t *buf, uint32_t len, void *data) { GoogleBinaryBlockHeader *gbb = (GoogleBinaryBlockHeader *)buf; struct bios_state_s *state = (struct bios_state_s *)data; - VbPublicKey *pubkey; + struct vb2_packed_key *pubkey; BmpBlockHeader *bmp; int retval = 0; uint32_t maxlen = 0; @@ -95,8 +96,8 @@ int ft_show_gbb(const char *name, uint8_t *buf, uint32_t len, void *data) printf(" HWID: %s\n", buf + gbb->hwid_offset); print_hwid_digest(gbb, " digest: ", "\n"); - pubkey = (VbPublicKey *)(buf + gbb->rootkey_offset); - if (PublicKeyLooksOkay(pubkey, gbb->rootkey_size)) { + pubkey = (struct vb2_packed_key *)(buf + gbb->rootkey_offset); + if (packed_key_looks_ok(pubkey, gbb->rootkey_size)) { if (state) { state->rootkey.offset = state->area[BIOS_FMAP_GBB].offset + @@ -112,8 +113,8 @@ int ft_show_gbb(const char *name, uint8_t *buf, uint32_t len, void *data) printf(" Root Key: <invalid>\n"); } - pubkey = (VbPublicKey *)(buf + gbb->recovery_key_offset); - if (PublicKeyLooksOkay(pubkey, gbb->recovery_key_size)) { + pubkey = (struct vb2_packed_key *)(buf + gbb->recovery_key_offset); + if (packed_key_looks_ok(pubkey, gbb->recovery_key_size)) { if (state) { state->recovery_key.offset = state->area[BIOS_FMAP_GBB].offset + |