Fix LS applet self update failure.
LS self update is successful if status byte 0x6320
is received from LS.
Bug: 109917348
Test: LS self update using encrypted script,
check eSE basic/logical channel open after LS update
Change-Id: If4812076c2465006dac5de841dd538f64ea3049b
diff --git a/ls_client/inc/LsClient.h b/ls_client/inc/LsClient.h
old mode 100644
new mode 100755
index c2e9e01..7c00c02
--- a/ls_client/inc/LsClient.h
+++ b/ls_client/inc/LsClient.h
@@ -24,7 +24,7 @@
typedef enum {
LSCSTATUS_SUCCESS = (0x0000),
LSCSTATUS_FAILED = (0x0003),
- LSCSTATUS_FILE_NOT_FOUND = (0x0005)
+ LSCSTATUS_SELF_UPDATE_DONE = (0x0005)
} LSCSTATUS;
using ::android::hardware::secure_element::V1_0::ISecureElementHalCallback;
diff --git a/ls_client/src/LsLib.cpp b/ls_client/src/LsLib.cpp
old mode 100644
new mode 100755
index 84f1682..719b6ac
--- a/ls_client/src/LsLib.cpp
+++ b/ls_client/src/LsLib.cpp
@@ -439,35 +439,9 @@
status = LSC_SendtoLsc(Os_info, status, pTranscv_Info, LS_Comm);
if (status != LSCSTATUS_SUCCESS) {
/*When the switching of LS 6320 case*/
- if (status == LSCSTATUS_FILE_NOT_FOUND) {
- /*When 6320 occurs close the existing channels*/
- LSC_CloseChannel(Os_info, status, pTranscv_Info);
-
- status = LSCSTATUS_FAILED;
- status = LSC_OpenChannel(Os_info, status, pTranscv_Info);
- if (status == LSCSTATUS_SUCCESS) {
- ALOGD_IF(ese_debug_enabled,
- "%s: SUCCESS:Post Switching LS open channel", fn);
- status = LSCSTATUS_FAILED;
- status = LSC_SelectLsc(Os_info, status, pTranscv_Info);
- if (status == LSCSTATUS_SUCCESS) {
- ALOGD_IF(ese_debug_enabled,
- "%s: SUCCESS:Post Switching LS select", fn);
- status = LSCSTATUS_FAILED;
- status = LSC_StoreData(Os_info, status, pTranscv_Info);
- if (status == LSCSTATUS_SUCCESS) {
- /*Enable certificate and signature verification*/
- tag40_found = LSCSTATUS_SUCCESS;
- gsLsExecuteResp[2] = 0x90;
- gsLsExecuteResp[3] = 0x00;
- reachEOFCheck = true;
- continue;
- }
- ALOGE("%s: Post Switching LS store data failure", fn);
- }
- ALOGE("%s: Post Switching LS select failure", fn);
- }
- ALOGE("%s: Post Switching LS failure", fn);
+ if (status == LSCSTATUS_SELF_UPDATE_DONE) {
+ status = LSCSTATUS_SUCCESS;
+ goto exit;
}
ALOGE("%s: Sending packet to lsc failed", fn);
goto exit;
@@ -1031,7 +1005,7 @@
}
}
if (wStatus == 2) {
- status = LSCSTATUS_FILE_NOT_FOUND;
+ status = LSCSTATUS_SELF_UPDATE_DONE;
} else {
status = LSCSTATUS_FAILED;
}