app: aboot: Remove verified state
Updated verified boot contains only two states which is
locked and unlocked. Verified state is removed.
Change-Id: Iac2fee5c1cad68c81e5d868e701ef0d7c1547b73
diff --git a/app/aboot/aboot.c b/app/aboot/aboot.c
index 575e8e4..88ba62d 100644
--- a/app/aboot/aboot.c
+++ b/app/aboot/aboot.c
@@ -178,7 +178,7 @@
/* Assuming unauthorized kernel image by default */
static int auth_kernel_img = 0;
-static device_info device = {DEVICE_MAGIC, 0, 0, 0, 0, {0}, {0},{0}};
+static device_info device = {DEVICE_MAGIC, 0, 0, 0, {0}, {0},{0}};
static bool is_allow_unlock = 0;
static char frp_ptns[2][8] = {"config","frp"};
@@ -2155,19 +2155,11 @@
#if VERIFIED_BOOT
if (target_build_variant_user())
{
- if(!device.is_unlocked && !device.is_verified)
+ if(!device.is_unlocked)
{
fastboot_fail("device is locked. Cannot erase");
return;
}
- if(!device.is_unlocked && device.is_verified)
- {
- if(!boot_verify_flash_allowed(arg))
- {
- fastboot_fail("cannot flash this partition in verified state");
- return;
- }
- }
}
#endif
@@ -2624,14 +2616,6 @@
fastboot_fail("device is locked. Cannot flash images");
return;
}
- if(!device.is_unlocked && device.is_verified)
- {
- if(!boot_verify_flash_allowed(arg))
- {
- fastboot_fail("cannot flash this partition in verified state");
- return;
- }
- }
}
#endif
@@ -2798,7 +2782,7 @@
void cmd_oem_unlock_go(const char *arg, void *data, unsigned sz)
{
- if(!device.is_unlocked || device.is_verified)
+ if(!device.is_unlocked)
{
if(!is_allow_unlock) {
fastboot_fail("oem unlock is not allowed");
@@ -2806,7 +2790,6 @@
}
device.is_unlocked = 1;
- device.is_verified = 0;
write_device_info(&device);
struct recovery_message msg;
@@ -2821,23 +2804,9 @@
void cmd_oem_lock(const char *arg, void *data, unsigned sz)
{
- /* TODO: Wipe user data */
- if(device.is_unlocked || device.is_verified)
+ if(device.is_unlocked)
{
device.is_unlocked = 0;
- device.is_verified = 0;
- write_device_info(&device);
- }
- fastboot_okay("");
-}
-
-void cmd_oem_verified(const char *arg, void *data, unsigned sz)
-{
- /* TODO: Wipe user data */
- if(device.is_unlocked || !device.is_verified)
- {
- device.is_unlocked = 0;
- device.is_verified = 1;
write_device_info(&device);
}
fastboot_okay("");
@@ -3127,7 +3096,6 @@
{"oem unlock", cmd_oem_unlock},
{"oem unlock-go", cmd_oem_unlock_go},
{"oem lock", cmd_oem_lock},
- {"oem verified", cmd_oem_verified},
{"oem device-info", cmd_oem_devinfo},
{"preflash", cmd_preflash},
{"oem enable-charger-screen", cmd_oem_enable_charger_screen},
diff --git a/app/aboot/devinfo.h b/app/aboot/devinfo.h
index 7eee69b..0c65559 100644
--- a/app/aboot/devinfo.h
+++ b/app/aboot/devinfo.h
@@ -42,7 +42,6 @@
unsigned char magic[DEVICE_MAGIC_SIZE];
bool is_unlocked;
bool is_tampered;
- bool is_verified;
bool charger_screen_enabled;
char display_panel[MAX_PANEL_ID_LEN];
char bootloader_version[MAX_VERSION_LEN];