summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--firmware/2lib/2misc.c11
-rw-r--r--firmware/2lib/include/2api.h6
-rw-r--r--tests/vb2_ui_action_tests.c1
-rw-r--r--tests/vb2_ui_tests.c1
4 files changed, 6 insertions, 13 deletions
diff --git a/firmware/2lib/2misc.c b/firmware/2lib/2misc.c
index 03766b44..efa33a8a 100644
--- a/firmware/2lib/2misc.c
+++ b/firmware/2lib/2misc.c
@@ -579,10 +579,9 @@ void vb2_fill_dev_boot_flags(struct vb2_context *ctx)
{
struct vb2_gbb_header *gbb = vb2_get_gbb(ctx);
- if (vb2_secdata_fwmp_get_flag(ctx, VB2_SECDATA_FWMP_DEV_DISABLE_BOOT) &&
- !(gbb->flags & VB2_GBB_FLAG_FORCE_DEV_SWITCH_ON))
- ctx->flags &= ~(uint64_t)VB2_CONTEXT_DEV_BOOT_ALLOWED;
- else
+ if (!vb2_secdata_fwmp_get_flag(ctx,
+ VB2_SECDATA_FWMP_DEV_DISABLE_BOOT) ||
+ (gbb->flags & VB2_GBB_FLAG_FORCE_DEV_SWITCH_ON))
ctx->flags |= VB2_CONTEXT_DEV_BOOT_ALLOWED;
if (vb2_nv_get(ctx, VB2_NV_DEV_BOOT_EXTERNAL) ||
@@ -590,15 +589,11 @@ void vb2_fill_dev_boot_flags(struct vb2_context *ctx)
vb2_secdata_fwmp_get_flag(ctx,
VB2_SECDATA_FWMP_DEV_ENABLE_EXTERNAL))
ctx->flags |= VB2_CONTEXT_DEV_BOOT_EXTERNAL_ALLOWED;
- else
- ctx->flags &= ~(uint64_t)VB2_CONTEXT_DEV_BOOT_EXTERNAL_ALLOWED;
if (vb2_nv_get(ctx, VB2_NV_DEV_BOOT_ALTFW) ||
(gbb->flags & VB2_GBB_FLAG_FORCE_DEV_BOOT_ALTFW) ||
vb2_secdata_fwmp_get_flag(ctx, VB2_SECDATA_FWMP_DEV_ENABLE_ALTFW))
ctx->flags |= VB2_CONTEXT_DEV_BOOT_ALTFW_ALLOWED;
- else
- ctx->flags &= ~(uint64_t)VB2_CONTEXT_DEV_BOOT_ALTFW_ALLOWED;
}
int vb2api_use_short_dev_screen_delay(struct vb2_context *ctx)
diff --git a/firmware/2lib/include/2api.h b/firmware/2lib/include/2api.h
index 66594035..b973417d 100644
--- a/firmware/2lib/include/2api.h
+++ b/firmware/2lib/include/2api.h
@@ -242,19 +242,19 @@ enum vb2_context_flags {
VB2_CONTEXT_EC_TRUSTED = (1 << 24),
/*
- * Boot into developer mode is allowed by FWMP and GBB flags.
+ * Boot into developer mode is allowed by FWMP or GBB flags.
*/
VB2_CONTEXT_DEV_BOOT_ALLOWED = (1 << 25),
/*
* Boot into developer mode from external disk is allowed by nvdata,
- * FWMP and GBB flags.
+ * FWMP or GBB flags.
*/
VB2_CONTEXT_DEV_BOOT_EXTERNAL_ALLOWED = (1 << 26),
/*
* Boot into developer mode from alternate bootloader is allowed by
- * nvdata, FWMP and GBB flags.
+ * nvdata, FWMP or GBB flags.
*/
VB2_CONTEXT_DEV_BOOT_ALTFW_ALLOWED = (1 << 27),
};
diff --git a/tests/vb2_ui_action_tests.c b/tests/vb2_ui_action_tests.c
index 001d6c2e..514340b4 100644
--- a/tests/vb2_ui_action_tests.c
+++ b/tests/vb2_ui_action_tests.c
@@ -315,7 +315,6 @@ static void reset_common_data(void)
sd = vb2_get_sd(ctx);
ctx->flags |= VB2_CONTEXT_DEV_BOOT_ALLOWED;
- ctx->flags &= ~(uint64_t)VB2_CONTEXT_DEV_BOOT_ALTFW_ALLOWED;
/* For check_shutdown_request */
mock_calls_until_shutdown = 10;
diff --git a/tests/vb2_ui_tests.c b/tests/vb2_ui_tests.c
index 95d22900..54f76037 100644
--- a/tests/vb2_ui_tests.c
+++ b/tests/vb2_ui_tests.c
@@ -279,7 +279,6 @@ static void reset_common_data(enum reset_type t)
}
ctx->flags |= VB2_CONTEXT_DEV_BOOT_ALLOWED;
- ctx->flags &= ~(uint64_t)VB2_CONTEXT_DEV_BOOT_ALTFW_ALLOWED;
ctx->flags |= VB2_CONTEXT_DEV_BOOT_EXTERNAL_ALLOWED;
/* Mock ui_context based on real screens */