Commit 08c8b893 authored by zhang sanshan's avatar zhang sanshan

MA-11862-2 [Android][MX7ULP1_EVK] The OEM unlock option is not available and...

MA-11862-2 [Android][MX7ULP1_EVK] The OEM unlock option is not available and the device cannot be unlocked in fastboot

The default state is unlocked if the emmc fbmisc partition is set as 0
by default on devices which have no caam.
So system do not call fastboot_set_lock_stat(FASTBOOT_LOCK).
This patch use locked/unlocked to match state FASTBOOT_LOCK/FASTBOOT_UNLOCK

Change-Id: I0e7905384c8557a963262248710e811c37461136
Signed-off-by: 's avatarzhang sanshan <sanshan.zhang@nxp.com>
parent ca9b0a95
......@@ -55,15 +55,22 @@ int fastboot_flash_find_index(const char *name);
/*
* This will return FASTBOOT_LOCK, FASTBOOT_UNLOCK or FASTBOOT_ERROR
*/
static inline unsigned char decrypt_lock_store(unsigned char* bdata) {
if (*bdata >= FASTBOOT_LOCK_NUM)
return FASTBOOT_LOCK_ERROR;
static FbLockState decrypt_lock_store(unsigned char* bdata) {
if (!strncmp(bdata, "locked", strlen("locked")))
return FASTBOOT_LOCK;
else if (!strncmp(bdata, "unlocked", strlen("unlocked")))
return FASTBOOT_UNLOCK;
else
return *bdata;
return FASTBOOT_LOCK_ERROR;
}
static inline int encrypt_lock_store(FbLockState lock, unsigned char* bdata) {
*bdata = lock;
if (FASTBOOT_LOCK == lock)
strncpy(bdata, "locked", strlen("locked"));
else if (FASTBOOT_UNLOCK == lock)
strncpy(bdata, "unlocked", strlen("unlocked"));
else
return -1;
return 0;
}
#else
......@@ -89,7 +96,7 @@ static int generate_salt(unsigned char* salt) {
}
static unsigned char decrypt_lock_store(unsigned char *bdata) {
static FbLockState decrypt_lock_store(unsigned char *bdata) {
unsigned char plain_data[ENDATA_LEN];
int p = 0, ret;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment