Joel Kitching has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/32455
Change subject: vboot: remove use of GoogleBinaryBlockHeader ......................................................................
vboot: remove use of GoogleBinaryBlockHeader
Remove use of deprecated GoogleBinaryBlockHeader struct, and replace with vb2_gbb_header.
BUG=b:124141368, chromium:954774 TEST=make clean && make test-abuild BRANCH=none
Change-Id: Iee3bd877cb1791a689efdeabda324f43f7d0c6f2 Signed-off-by: Joel Kitching kitching@google.com --- M src/security/vboot/gbb.c M src/security/vboot/gbb.h M src/security/vboot/vboot_common.c 3 files changed, 11 insertions(+), 8 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/55/32455/1
diff --git a/src/security/vboot/gbb.c b/src/security/vboot/gbb.c index 8f57c79..5293033 100644 --- a/src/security/vboot/gbb.c +++ b/src/security/vboot/gbb.c @@ -13,17 +13,19 @@ * GNU General Public License for more details. */
+#define NEED_VB20_INTERNALS /* Peeking into vb2_gbb_header */ + #include <commonlib/region.h> #include <console/console.h> #include <fmap.h> -#include <gbb_header.h> #include <security/vboot/gbb.h> #include <string.h> +#include <vb2_api.h>
#define GBB_FMAP_REGION_NAME "GBB"
/* Copy of GBB header read from boot media. */ -static GoogleBinaryBlockHeader gbb_header; +static struct vb2_gbb_header gbb_header;
/* * Read "GBB" region from SPI flash to obtain GBB header and validate @@ -45,13 +47,14 @@ return 1;
if (rdev_readat(&gbb_rdev, &gbb_header, 0, - sizeof(GoogleBinaryBlockHeader)) != - sizeof(GoogleBinaryBlockHeader)) { + sizeof(struct vb2_gbb_header)) != + sizeof(struct vb2_gbb_header)) { printk(BIOS_ERR, "%s: Failure to read GBB header!\n", __func__); return 1; }
- if (memcmp(gbb_header.signature, GBB_SIGNATURE, GBB_SIGNATURE_SIZE)) { + if (memcmp(gbb_header.signature, VB2_GBB_SIGNATURE, + VB2_GBB_SIGNATURE_SIZE)) { printk(BIOS_ERR, "%s: Signature check failed!\n", __func__); return 1; } diff --git a/src/security/vboot/gbb.h b/src/security/vboot/gbb.h index 550548d..389242a 100644 --- a/src/security/vboot/gbb.h +++ b/src/security/vboot/gbb.h @@ -18,7 +18,7 @@
#include <stdint.h>
-/* In order to use GBB_FLAG_* macros from vboot, include gbb_header.h. */ +/* In order to use VB2_GBB_FLAG_* macros from vboot, include vb2_api.h. */
/* * Read flags field from GBB header. diff --git a/src/security/vboot/vboot_common.c b/src/security/vboot/vboot_common.c index 5e95c62..b434f8d 100644 --- a/src/security/vboot/vboot_common.c +++ b/src/security/vboot/vboot_common.c @@ -18,12 +18,12 @@ #include <cbmem.h> #include <console/cbmem_console.h> #include <fmap.h> -#include <gbb_header.h> #include <reset.h> #include <stddef.h> #include <security/vboot/gbb.h> #include <security/vboot/vboot_common.h> #include <security/vboot/vbnv.h> +#include <vb2_api.h>
int vboot_named_region_device(const char *name, struct region_device *rdev) { @@ -42,7 +42,7 @@ if (!vboot_developer_mode_enabled()) return 0; /* Enable if GBB flag is set */ - if (gbb_is_flag_set(GBB_FLAG_ENABLE_UDC)) + if (gbb_is_flag_set(VB2_GBB_FLAG_ENABLE_UDC)) return 1; /* Enable if VBNV flag is set */ if (vbnv_udc_enable_flag())