summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/ec_sync_tests.c1
-rw-r--r--tests/futility/test_not_really.c8
-rw-r--r--tests/vboot_api_devmode_tests.c1
-rw-r--r--tests/vboot_api_kernel2_tests.c1
-rw-r--r--tests/vboot_api_kernel4_tests.c9
-rw-r--r--tests/vboot_api_kernel5_tests.c14
-rw-r--r--tests/vboot_api_kernel_tests.c1
-rw-r--r--tests/vboot_detach_menu_tests.c17
-rw-r--r--tests/vboot_display_tests.c12
-rw-r--r--tests/vboot_kernel_tests.c9
10 files changed, 33 insertions, 40 deletions
diff --git a/tests/ec_sync_tests.c b/tests/ec_sync_tests.c
index fb043460..45764048 100644
--- a/tests/ec_sync_tests.c
+++ b/tests/ec_sync_tests.c
@@ -14,7 +14,6 @@
#include "2misc.h"
#include "2nvstorage.h"
#include "ec_sync.h"
-#include "gbb_header.h"
#include "host_common.h"
#include "load_kernel_fw.h"
#include "rollback_index.h"
diff --git a/tests/futility/test_not_really.c b/tests/futility/test_not_really.c
index 91756ac3..1d69d44d 100644
--- a/tests/futility/test_not_really.c
+++ b/tests/futility/test_not_really.c
@@ -4,14 +4,14 @@
* found in the LICENSE file.
*/
#include <stdio.h>
-#include "gbb_header.h"
+#include "2struct.h"
#include "test_common.h"
int main(int argc, char *argv[])
{
- TEST_EQ(sizeof(GoogleBinaryBlockHeader),
- GBB_HEADER_SIZE,
- "sizeof(GoogleBinaryBlockHeader)");
+ TEST_EQ(sizeof(struct vb2_gbb_header),
+ EXPECTED_VB2_GBB_HEADER_SIZE,
+ "sizeof(struct vb2_gbb_header)");
TEST_EQ(0, 0, "Not Really A");
diff --git a/tests/vboot_api_devmode_tests.c b/tests/vboot_api_devmode_tests.c
index 286972c2..ccd4c617 100644
--- a/tests/vboot_api_devmode_tests.c
+++ b/tests/vboot_api_devmode_tests.c
@@ -15,7 +15,6 @@
#include "2misc.h"
#include "2nvstorage.h"
#include "crc32.h"
-#include "gbb_header.h"
#include "host_common.h"
#include "load_kernel_fw.h"
#include "rollback_index.h"
diff --git a/tests/vboot_api_kernel2_tests.c b/tests/vboot_api_kernel2_tests.c
index 2d0a7ab5..3203bf05 100644
--- a/tests/vboot_api_kernel2_tests.c
+++ b/tests/vboot_api_kernel2_tests.c
@@ -13,7 +13,6 @@
#include "2api.h"
#include "2misc.h"
#include "2nvstorage.h"
-#include "gbb_header.h"
#include "host_common.h"
#include "load_kernel_fw.h"
#include "rollback_index.h"
diff --git a/tests/vboot_api_kernel4_tests.c b/tests/vboot_api_kernel4_tests.c
index fdf51da6..a4bc6bec 100644
--- a/tests/vboot_api_kernel4_tests.c
+++ b/tests/vboot_api_kernel4_tests.c
@@ -14,7 +14,6 @@
#include "2misc.h"
#include "2nvstorage.h"
#include "ec_sync.h"
-#include "gbb_header.h"
#include "host_common.h"
#include "load_kernel_fw.h"
#include "rollback_index.h"
@@ -33,7 +32,7 @@ static VbCommonParams cparams;
static VbSelectAndLoadKernelParams kparams;
static uint8_t shared_data[VB_SHARED_DATA_MIN_SIZE];
static VbSharedDataHeader *shared = (VbSharedDataHeader *)shared_data;
-static GoogleBinaryBlockHeader gbb;
+static struct vb2_gbb_header gbb;
static uint32_t rkr_version;
static uint32_t new_version;
@@ -57,8 +56,8 @@ static void ResetMocks(void)
memset(&kparams, 0, sizeof(kparams));
memset(&gbb, 0, sizeof(gbb));
- gbb.major_version = GBB_MAJOR_VER;
- gbb.minor_version = GBB_MINOR_VER;
+ gbb.major_version = VB2_GBB_MAJOR_VER;
+ gbb.minor_version = VB2_GBB_MINOR_VER;
gbb.flags = 0;
/* ctx.workbuf will be initialized by VbSelectAndLoadKernel. */
@@ -212,7 +211,7 @@ static void VbSlkTest(void)
/* Same if shared->flags asks for sync, but it's overridden by GBB */
ResetMocks();
shared->flags |= VBSD_EC_SOFTWARE_SYNC;
- gbb.flags |= GBB_FLAG_DISABLE_EC_SOFTWARE_SYNC;
+ gbb.flags |= VB2_GBB_FLAG_DISABLE_EC_SOFTWARE_SYNC;
test_slk(0, 0, "EC sync disabled by GBB");
/* Rollback kernel version */
diff --git a/tests/vboot_api_kernel5_tests.c b/tests/vboot_api_kernel5_tests.c
index 8d3281be..a0f89466 100644
--- a/tests/vboot_api_kernel5_tests.c
+++ b/tests/vboot_api_kernel5_tests.c
@@ -16,7 +16,7 @@
#include "2misc.h"
#include "2nvstorage.h"
#include "2rsa.h"
-#include "gbb_header.h"
+#include "2struct.h"
#include "host_common.h"
#include "load_kernel_fw.h"
#include "test_common.h"
@@ -35,7 +35,7 @@ static VbSelectAndLoadKernelParams kparams;
static uint8_t shared_data[VB_SHARED_DATA_MIN_SIZE];
static VbSharedDataHeader *shared = (VbSharedDataHeader *)shared_data;
static uint8_t gbb_buf[4096];
-static GoogleBinaryBlockHeader *gbb = (GoogleBinaryBlockHeader *)gbb_buf;
+static struct vb2_gbb_header *gbb = (struct vb2_gbb_header *)gbb_buf;
static uint8_t kernel_buffer[80000];
static int key_block_verify_fail; /* 0=ok, 1=sig, 2=hash */
@@ -62,8 +62,8 @@ static void ResetMocks(void)
memset(&kparams, 0, sizeof(kparams));
memset(gbb_buf, 0, sizeof(gbb_buf));
- gbb->major_version = GBB_MAJOR_VER;
- gbb->minor_version = GBB_MINOR_VER;
+ gbb->major_version = VB2_GBB_MAJOR_VER;
+ gbb->minor_version = VB2_GBB_MINOR_VER;
gbb->flags = 0;
gbb->rootkey_offset = sizeof(*gbb);
gbb->rootkey_size = sizeof(VbPublicKey);
@@ -234,7 +234,7 @@ static void VerifyMemoryBootImageTest(void)
/* Key Block Hash Failure */
ResetMocks();
shared->flags = VBSD_BOOT_DEV_SWITCH_ON;
- gbb->flags = GBB_FLAG_FORCE_DEV_BOOT_FASTBOOT_FULL_CAP;
+ gbb->flags = VB2_GBB_FLAG_FORCE_DEV_BOOT_FASTBOOT_FULL_CAP;
key_block_verify_fail = 1;
TEST_EQ(VbVerifyMemoryBootImage(&ctx, &cparams, &kparams, kernel_buffer,
kernel_buffer_size),
@@ -267,7 +267,7 @@ static void VerifyMemoryBootImageTest(void)
kbh.key_block_flags = KEY_BLOCK_FLAG_DEVELOPER_0 |
KEY_BLOCK_FLAG_RECOVERY_1;
copy_kbh();
- gbb->flags = GBB_FLAG_FORCE_DEV_BOOT_FASTBOOT_FULL_CAP;
+ gbb->flags = VB2_GBB_FLAG_FORCE_DEV_BOOT_FASTBOOT_FULL_CAP;
shared->flags = VBSD_BOOT_DEV_SWITCH_ON;
TEST_EQ(VbVerifyMemoryBootImage(&ctx, &cparams, &kparams, kernel_buffer,
kernel_buffer_size),
@@ -280,7 +280,7 @@ static void VerifyMemoryBootImageTest(void)
KEY_BLOCK_FLAG_RECOVERY_0;
copy_kbh();
shared->flags = VBSD_BOOT_DEV_SWITCH_ON;
- gbb->flags = GBB_FLAG_FORCE_DEV_BOOT_FASTBOOT_FULL_CAP;
+ gbb->flags = VB2_GBB_FLAG_FORCE_DEV_BOOT_FASTBOOT_FULL_CAP;
TEST_EQ(VbVerifyMemoryBootImage(&ctx, &cparams, &kparams, kernel_buffer,
kernel_buffer_size),
VBERROR_SUCCESS,
diff --git a/tests/vboot_api_kernel_tests.c b/tests/vboot_api_kernel_tests.c
index 92f6dcc9..fc0d3893 100644
--- a/tests/vboot_api_kernel_tests.c
+++ b/tests/vboot_api_kernel_tests.c
@@ -13,7 +13,6 @@
#include "2sysincludes.h"
#include "2common.h"
#include "2nvstorage.h"
-#include "gbb_header.h"
#include "load_kernel_fw.h"
#include "rollback_index.h"
#include "test_common.h"
diff --git a/tests/vboot_detach_menu_tests.c b/tests/vboot_detach_menu_tests.c
index bf71a5f4..05785848 100644
--- a/tests/vboot_detach_menu_tests.c
+++ b/tests/vboot_detach_menu_tests.c
@@ -13,7 +13,6 @@
#include "2api.h"
#include "2misc.h"
#include "2nvstorage.h"
-#include "gbb_header.h"
#include "host_common.h"
#include "load_kernel_fw.h"
#include "rollback_index.h"
@@ -280,8 +279,8 @@ static void VbBootDevTest(void)
/* Proceed to legacy after timeout if GBB flag set */
ResetMocksForDeveloper();
- sd->gbb_flags |= GBB_FLAG_DEFAULT_DEV_BOOT_LEGACY |
- GBB_FLAG_FORCE_DEV_BOOT_LEGACY;
+ sd->gbb_flags |= VB2_GBB_FLAG_DEFAULT_DEV_BOOT_LEGACY |
+ VB2_GBB_FLAG_FORCE_DEV_BOOT_LEGACY;
TEST_EQ(VbBootDeveloperMenu(&ctx), vbtlk_retval_fixed,
"default legacy GBB");
TEST_EQ(vbexlegacy_called, 1, " try legacy");
@@ -466,7 +465,7 @@ static void VbBootDevTest(void)
/* ENTER functionality is unaffected by GBB flag in detachable UI. */
ResetMocksForDeveloper();
- sd->gbb_flags |= GBB_FLAG_ENTER_TRIGGERS_TONORM;
+ sd->gbb_flags |= VB2_GBB_FLAG_ENTER_TRIGGERS_TONORM;
mock_keypress[0] = VB_KEY_ENTER;
TEST_EQ(VbBootDeveloperMenu(&ctx), VBERROR_SHUTDOWN_REQUESTED,
"dev warning menu: ENTER unaffected by GBB");
@@ -521,7 +520,7 @@ static void VbBootDevTest(void)
/* Tonorm ignored if GBB forces dev switch on */
ResetMocksForDeveloper();
shared->flags |= VBSD_BOOT_DEV_SWITCH_ON;
- sd->gbb_flags |= GBB_FLAG_FORCE_DEV_SWITCH_ON;
+ sd->gbb_flags |= VB2_GBB_FLAG_FORCE_DEV_SWITCH_ON;
mock_keypress[0] = VB_BUTTON_VOL_UP_SHORT_PRESS;
mock_keypress[1] = VB_BUTTON_POWER_SHORT_PRESS;
mock_keypress[2] = VB_BUTTON_POWER_SHORT_PRESS;
@@ -582,7 +581,7 @@ static void VbBootDevTest(void)
/* Ctrl+D doesn't boot legacy even if GBB flag is set */
ResetMocksForDeveloper();
mock_keypress[0] = VB_KEY_CTRL('D');
- sd->gbb_flags |= GBB_FLAG_DEFAULT_DEV_BOOT_LEGACY;
+ sd->gbb_flags |= VB2_GBB_FLAG_DEFAULT_DEV_BOOT_LEGACY;
TEST_EQ(VbBootDeveloperMenu(&ctx), vbtlk_retval_fixed, "Ctrl+D");
TEST_EQ(vbexlegacy_called, 0, " not legacy");
@@ -622,7 +621,7 @@ static void VbBootDevTest(void)
/* Ctrl+L boots legacy if enabled by GBB flag */
ResetMocksForDeveloper();
- sd->gbb_flags |= GBB_FLAG_FORCE_DEV_BOOT_LEGACY;
+ sd->gbb_flags |= VB2_GBB_FLAG_FORCE_DEV_BOOT_LEGACY;
mock_keypress[0] = VB_KEY_CTRL('L');
mock_keypress[1] = VB_BUTTON_POWER_SHORT_PRESS;
TEST_EQ(VbBootDeveloperMenu(&ctx), vbtlk_retval_fixed,
@@ -737,7 +736,7 @@ static void VbBootDevTest(void)
/* Ctrl+U enabled via GBB */
ResetMocksForDeveloper();
- sd->gbb_flags |= GBB_FLAG_FORCE_DEV_BOOT_USB;
+ sd->gbb_flags |= VB2_GBB_FLAG_FORCE_DEV_BOOT_USB;
mock_keypress[0] = VB_KEY_CTRL('U');
vbtlk_retval[0] = VBERROR_SUCCESS - VB_DISK_FLAG_REMOVABLE;
TEST_EQ(VbBootDeveloperMenu(&ctx), VBERROR_SUCCESS, "Ctrl+U force USB");
@@ -1361,7 +1360,7 @@ static void VbBootRecTest(void)
/* go to INSERT if forced by GBB flag */
ResetMocks();
vbtlk_retval[0] = VBERROR_NO_DISK_FOUND - VB_DISK_FLAG_REMOVABLE;
- sd->gbb_flags |= GBB_FLAG_FORCE_MANUAL_RECOVERY;
+ sd->gbb_flags |= VB2_GBB_FLAG_FORCE_MANUAL_RECOVERY;
TEST_EQ(VbBootRecoveryMenu(&ctx), VBERROR_SHUTDOWN_REQUESTED,
"Shutdown requested in INSERT forced by GBB flag");
TEST_EQ(vb2_nv_get(&ctx, VB2_NV_RECOVERY_REQUEST), 0, " no recovery");
diff --git a/tests/vboot_display_tests.c b/tests/vboot_display_tests.c
index 986bb270..16ccd36e 100644
--- a/tests/vboot_display_tests.c
+++ b/tests/vboot_display_tests.c
@@ -14,8 +14,8 @@
#include "2common.h"
#include "2misc.h"
#include "2nvstorage.h"
+#include "2struct.h"
#include "gbb_access.h"
-#include "gbb_header.h"
#include "host_common.h"
#include "test_common.h"
#include "vboot_common.h"
@@ -25,8 +25,8 @@
/* Mock data */
static uint8_t shared_data[VB_SHARED_DATA_MIN_SIZE];
static VbSharedDataHeader *shared = (VbSharedDataHeader *)shared_data;
-static char gbb_data[4096 + sizeof(GoogleBinaryBlockHeader)];
-static GoogleBinaryBlockHeader *gbb = (GoogleBinaryBlockHeader *)gbb_data;
+static char gbb_data[4096 + sizeof(struct vb2_gbb_header)];
+static struct vb2_gbb_header *gbb = (struct vb2_gbb_header *)gbb_data;
static char debug_info[4096];
static struct vb2_context ctx;
struct vb2_shared_data *sd;
@@ -40,10 +40,10 @@ static void ResetMocks(void)
int gbb_used;
memset(gbb_data, 0, sizeof(gbb_data));
- gbb->major_version = GBB_MAJOR_VER;
- gbb->minor_version = GBB_MINOR_VER;
+ gbb->major_version = VB2_GBB_MAJOR_VER;
+ gbb->minor_version = VB2_GBB_MINOR_VER;
gbb->flags = 0;
- gbb_used = sizeof(GoogleBinaryBlockHeader);
+ gbb_used = sizeof(struct vb2_gbb_header);
gbb->hwid_offset = gbb_used;
strcpy(gbb_data + gbb->hwid_offset, "Test HWID");
diff --git a/tests/vboot_kernel_tests.c b/tests/vboot_kernel_tests.c
index e94c5b73..4fd78a82 100644
--- a/tests/vboot_kernel_tests.c
+++ b/tests/vboot_kernel_tests.c
@@ -19,7 +19,6 @@
#include "cgptlib.h"
#include "cgptlib_internal.h"
#include "crc32.h"
-#include "gbb_header.h"
#include "gpt.h"
#include "host_common.h"
#include "load_kernel_fw.h"
@@ -60,8 +59,8 @@ static int verify_data_fail;
static int unpack_key_fail;
static int gpt_flag_external;
-static uint8_t gbb_data[sizeof(GoogleBinaryBlockHeader) + 2048];
-static GoogleBinaryBlockHeader *gbb = (GoogleBinaryBlockHeader*)gbb_data;
+static uint8_t gbb_data[sizeof(struct vb2_gbb_header) + 2048];
+static struct vb2_gbb_header *gbb = (struct vb2_gbb_header*)gbb_data;
static VbExDiskHandle_t handle;
static uint8_t shared_data[VB_SHARED_DATA_MIN_SIZE];
static VbSharedDataHeader *shared = (VbSharedDataHeader *)shared_data;
@@ -139,8 +138,8 @@ static void ResetMocks(void)
gpt_flag_external = 0;
memset(gbb, 0, sizeof(*gbb));
- gbb->major_version = GBB_MAJOR_VER;
- gbb->minor_version = GBB_MINOR_VER;
+ gbb->major_version = VB2_GBB_MAJOR_VER;
+ gbb->minor_version = VB2_GBB_MINOR_VER;
gbb->flags = 0;
memset(&shared_data, 0, sizeof(shared_data));