diff options
author | Randall Spangler <rspangler@chromium.org> | 2018-01-04 16:08:47 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-01-09 14:14:17 -0800 |
commit | 98616d79c6b60c719bc3e37f7f82028e77983d94 (patch) | |
tree | 3f060169830ac25f0c907d2c88052388805b1714 /firmware/lib/vboot_display.c | |
parent | 79c1c6194bc45728a5043443d80506fa1d35c83b (diff) | |
download | vboot-98616d79c6b60c719bc3e37f7f82028e77983d94.tar.gz |
firmware: Prune down old region API
The region API was a way for firmware and kernel verification to get
at various blocks of caller-provided data. In practice, we only used
it internally as a way to get at parts of the GBB. Prune it down to
access only the bits of GBB we still need, from the buffer we already
know we have.
In the long run we should use the same vb2ex_read_resource() API that
vb2 firmware verification does, but that should be done in a follow-up
CL since it'll need to be coordinated with support in depthcharge.
No change in functionality.
BUG=chromium:611535
BRANCH=none
TEST=make -j runtests; build bob firmware and boot it
Change-Id: I5715cb8d88274164a1a73ed4a56bbd93af46f9bf
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/852798
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Reviewed-by: Stefan Reinauer <reinauer@chromium.org>
Diffstat (limited to 'firmware/lib/vboot_display.c')
-rw-r--r-- | firmware/lib/vboot_display.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/firmware/lib/vboot_display.c b/firmware/lib/vboot_display.c index d3e3a6a2..ea36c1f1 100644 --- a/firmware/lib/vboot_display.c +++ b/firmware/lib/vboot_display.c @@ -15,7 +15,6 @@ #include "bmpblk_font.h" #include "gbb_access.h" #include "gbb_header.h" -#include "region.h" #include "utility.h" #include "vboot_api.h" #include "vboot_common.h" @@ -274,7 +273,7 @@ const char *RecoveryReasonString(uint8_t code) #define DEBUG_INFO_SIZE 512 -VbError_t VbDisplayDebugInfo(struct vb2_context *ctx, VbCommonParams *cparams) +VbError_t VbDisplayDebugInfo(struct vb2_context *ctx) { struct vb2_shared_data *sd = vb2_get_sd(ctx); VbSharedDataHeader *shared = sd->vbsd; @@ -296,7 +295,7 @@ VbError_t VbDisplayDebugInfo(struct vb2_context *ctx, VbCommonParams *cparams) disp_current_index, disp_disabled_idx_mask); /* Add hardware ID */ - VbRegionReadHWID(cparams, hwid, sizeof(hwid)); + VbGbbReadHWID(ctx, hwid, sizeof(hwid)); used += StrnAppend(buf + used, "HWID: ", DEBUG_INFO_SIZE - used); used += StrnAppend(buf + used, hwid, DEBUG_INFO_SIZE - used); @@ -371,7 +370,7 @@ VbError_t VbDisplayDebugInfo(struct vb2_context *ctx, VbCommonParams *cparams) sd->gbb_flags, 16, 8); /* Add sha1sum for Root & Recovery keys */ - ret = VbGbbReadRootKey(cparams, &key); + ret = VbGbbReadRootKey(ctx, &key); if (!ret) { FillInSha1Sum(sha1sum, key); free(key); @@ -381,7 +380,7 @@ VbError_t VbDisplayDebugInfo(struct vb2_context *ctx, VbCommonParams *cparams) DEBUG_INFO_SIZE - used); } - ret = VbGbbReadRecoveryKey(cparams, &key); + ret = VbGbbReadRecoveryKey(ctx, &key); if (!ret) { FillInSha1Sum(sha1sum, key); free(key); @@ -413,8 +412,7 @@ VbError_t VbDisplayDebugInfo(struct vb2_context *ctx, VbCommonParams *cparams) #define MAGIC_WORD "xyzzy" static uint8_t MagicBuffer[MAGIC_WORD_LEN]; -VbError_t VbCheckDisplayKey(struct vb2_context *ctx, VbCommonParams *cparams, - uint32_t key) +VbError_t VbCheckDisplayKey(struct vb2_context *ctx, uint32_t key) { int i; @@ -426,7 +424,7 @@ VbError_t VbCheckDisplayKey(struct vb2_context *ctx, VbCommonParams *cparams, if ('\t' == key) { /* Tab = display debug info */ - return VbDisplayDebugInfo(ctx, cparams); + return VbDisplayDebugInfo(ctx); } else if (VB_KEY_LEFT == key || VB_KEY_RIGHT == key || VB_KEY_DOWN == key || VB_KEY_UP == key) { /* Arrow keys = change localization */ |