summaryrefslogtreecommitdiff
path: root/firmware/include
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2018-01-04 16:08:47 -0800
committerchrome-bot <chrome-bot@chromium.org>2018-01-09 14:14:17 -0800
commit98616d79c6b60c719bc3e37f7f82028e77983d94 (patch)
tree3f060169830ac25f0c907d2c88052388805b1714 /firmware/include
parent79c1c6194bc45728a5043443d80506fa1d35c83b (diff)
downloadvboot-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/include')
-rw-r--r--firmware/include/gbb_access.h36
-rw-r--r--firmware/include/region.h55
-rw-r--r--firmware/include/vboot_api.h3
3 files changed, 18 insertions, 76 deletions
diff --git a/firmware/include/gbb_access.h b/firmware/include/gbb_access.h
index 7b11dc85..9b4e0dde 100644
--- a/firmware/include/gbb_access.h
+++ b/firmware/include/gbb_access.h
@@ -10,43 +10,43 @@
#include "vboot_api.h"
-struct BmpBlockHeader;
-struct ImageInfo;
-struct GoogleBinaryBlockHeader;
-struct ScreenLayout;
+struct vb2_context;
struct VbPublicKey;
/**
- * Read the GBB header
- *
- * This accesses the GBB and reads its header.
- *
- * @param cparams Vboot common parameters
- * @param gbb Place to put GBB header
- */
-VbError_t VbGbbReadHeader_static(VbCommonParams *cparams,
- struct GoogleBinaryBlockHeader *gbb);
-
-/**
* Read the root key from the GBB
*
- * @param cparams Vboot common parameters
+ * @param ctx Vboot context
* @param keyp Returns a pointer to the key. The caller must call
* free() on the key when finished with it.
* @return VBERROR_... error, VBERROR_SUCCESS on success,
*/
-VbError_t VbGbbReadRootKey(VbCommonParams *cparams,
+VbError_t VbGbbReadRootKey(struct vb2_context *ctx,
struct VbPublicKey **keyp);
/**
* Read the recovery key from the GBB
*
+ * @param ctx Vboot context
* @param cparams Vboot common parameters
* @param keyp Returns a pointer to the key. The caller must call
* free() on the key when finished with it.
* @return VBERROR_... error, VBERROR_SUCCESS on success,
*/
-VbError_t VbGbbReadRecoveryKey(VbCommonParams *cparams,
+VbError_t VbGbbReadRecoveryKey(struct vb2_context *ctx,
struct VbPublicKey **keyp);
+/**
+ * Read the hardware ID from the GBB
+ *
+ * @param ctx Vboot context
+ * @param hwid Place to put HWID, which will be null-terminated
+ * @param max_size Maximum size of HWID including terminated null
+ * character (suggest 256). If this size is too small
+ * then VBERROR_INVALID_PARAMETER is returned.
+ * @return VBERROR_... error, VBERROR_SUCCESS on success,
+ */
+VbError_t VbGbbReadHWID(struct vb2_context *ctx, char *hwid,
+ uint32_t max_size);
+
#endif
diff --git a/firmware/include/region.h b/firmware/include/region.h
deleted file mode 100644
index 78e1dba0..00000000
--- a/firmware/include/region.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/* Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- *
- * Access to portions of the firmware image, perhaps later to be expanded
- * to other devices.
- */
-
-#ifndef VBOOT_REFERENCE_REGION_H_
-#define VBOOT_REFERENCE_REGION_H_
-
-#include "bmpblk_header.h"
-#include "gbb_header.h"
-#include "vboot_api.h"
-#include "vboot_struct.h"
-
-/* The maximum length of a hardware ID */
-#define VB_REGION_HWID_LEN 256
-
-/**
- * Read data from a region
- *
- * @param cparams Vboot common parameters
- * @param region Region number to read
- * @param offset Offset within region to start reading
- * @param size Size of data to read
- * @param buf Buffer to put the data into
- * @return VBERROR_... error, VBERROR_SUCCESS on success,
- */
-VbError_t VbRegionReadData(VbCommonParams *cparams,
- enum vb_firmware_region region, uint32_t offset,
- uint32_t size, void *buf);
-
-/**
- * Check the version of the GBB and print debug information if valid
- *
- * @param cparams Vboot common parameters
- */
-void VbRegionCheckVersion(VbCommonParams *cparams);
-
-/**
- * Read the hardware ID from the GBB
- *
- * @param cparams Vboot common parameters
- * @param hwid Place to put HWID, which will be null-terminated
- * @param max_size Maximum size of HWID including terminated null
- * character (suggest VB_REGION_HWID_LEN). If this size
- * it too small then VBERROR_INVALID_PARAMETER is
- * returned.
- * @return VBERROR_... error, VBERROR_SUCCESS on success,
- */
-VbError_t VbRegionReadHWID(VbCommonParams *cparams, char *hwid,
- uint32_t max_size);
-
-#endif /* VBOOT_REFERENCE_REGION_H_ */
diff --git a/firmware/include/vboot_api.h b/firmware/include/vboot_api.h
index aa3ba2c9..5edf0a6b 100644
--- a/firmware/include/vboot_api.h
+++ b/firmware/include/vboot_api.h
@@ -193,9 +193,6 @@ typedef struct VbCommonParams {
* the stack.
*/
void *caller_context;
-
- /* For internal use of Vboot - do not examine or modify! */
- struct GoogleBinaryBlockHeader *gbb;
} VbCommonParams;
/* Flags for VbInitParams.flags */