summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoranil.hiranniah <anil.hiranniah@nxp.com>2018-07-19 00:37:02 +0530
committerRuchi Kandoi <kandoiruchi@google.com>2018-07-18 23:17:08 +0000
commitb25f0f974988e57cba44855193919d3182b42cab (patch)
treed92e91a73021d0beb1202ef5a13c07ad57cfd084
parent16d1be57da3fe3c0f840d4bbc9c9d8895def563c (diff)
downloadplatform_hardware_nxp_secure_element-pie-qpr3-release.tar.gz
platform_hardware_nxp_secure_element-pie-qpr3-release.tar.bz2
platform_hardware_nxp_secure_element-pie-qpr3-release.zip
Creation of output file moved after Slot applet Hash check to make sure new output files are created only for scripts which will be executed and not for the one which are already done. Bug: 109664165 Test: Ls Update Change-Id: I94c3ff74641269dc6d6ad216dc2ad622bd389bbf
-rwxr-xr-xls_client/src/LsClient.cpp21
1 files changed, 12 insertions, 9 deletions
diff --git a/ls_client/src/LsClient.cpp b/ls_client/src/LsClient.cpp
index 57bbf97..50ea3d1 100755
--- a/ls_client/src/LsClient.cpp
+++ b/ls_client/src/LsClient.cpp
@@ -161,15 +161,6 @@ void* performLSDownload_thread(__attribute__((unused)) void* data) {
ALOGD_IF(ese_debug_enabled, "%s File opened %s\n", __func__,
sourcePath.c_str());
- outPath.assign(ls_script_output_prefix);
- outPath += ('0' + index);
- outPath += ls_script_output_suffix;
-
- FILE* fOut = fopen(outPath.c_str(), "wb+");
- if (fOut == NULL) {
- ALOGE("%s Failed to open file %s\n", __func__, outPath.c_str());
- break;
- }
/*Read the script content to a local buffer*/
fseek(fIn, 0, SEEK_END);
long lsBufSize = ftell(fIn);
@@ -210,6 +201,18 @@ void* performLSDownload_thread(__attribute__((unused)) void* data) {
continue;
}
+ /*Create output file to write response data*/
+ outPath.assign(ls_script_output_prefix);
+ outPath += ('0' + index);
+ outPath += ls_script_output_suffix;
+
+ FILE* fOut = fopen(outPath.c_str(), "wb+");
+ if (fOut == NULL) {
+ ALOGE("%s Failed to open file %s\n", __func__, outPath.c_str());
+ break;
+ }
+ fclose(fOut);
+
/*Uptdates current script*/
status = LSC_Start(sourcePath.c_str(), outPath.c_str(), (uint8_t*)hash,
(uint16_t)sizeof(hash), resSW);