app: aboot: disable FRP feature and replace with stub code.
FRP system, currently uses static password to authenticate, which
is not safe.
Disable and replace frp_unlock with a stub code, that will take no action.
OEMs to implement their own authentication check to allow factory reset.
Change-Id: I2bf002a8167994ca087df2945c617396b59c695a
diff --git a/app/aboot/aboot.c b/app/aboot/aboot.c
index 2738c68..7852e4a 100755
--- a/app/aboot/aboot.c
+++ b/app/aboot/aboot.c
@@ -2716,14 +2716,6 @@
cmd_erase_nand(arg, data, sz);
}
-static uint32_t aboot_get_secret_key()
-{
- /* 0 is invalid secret key, update this implementation to return
- * device specific unique secret key
- */
- return 0;
-}
-
void cmd_flash_mmc_img(const char *arg, void *data, unsigned sz)
{
unsigned long long ptn = 0;
@@ -3491,20 +3483,24 @@
static int aboot_frp_unlock(char *pname, void *data, unsigned sz)
{
- int ret = 1;
- uint32_t secret_key;
- char seckey_buffer[MAX_RSP_SIZE];
+ int ret=1;
+ bool authentication_success=false;
- secret_key = aboot_get_secret_key();
- if (secret_key)
+ /*
+ Authentication method not implemented.
+
+ OEM to implement, authentication system which on successful validataion,
+ calls write_allow_oem_unlock() with is_allow_unlock.
+ */
+#if 0
+ authentication_success = oem_specific_auth_mthd();
+#endif
+
+ if (authentication_success)
{
- snprintf((char *) seckey_buffer, MAX_RSP_SIZE, "%x", secret_key);
- if (!memcmp((void *)data, (void *)seckey_buffer, sz))
- {
- is_allow_unlock = true;
- write_allow_oem_unlock(is_allow_unlock);
- ret = 0;
- }
+ is_allow_unlock = true;
+ write_allow_oem_unlock(is_allow_unlock);
+ ret = 0;
}
return ret;
}