Fix error codes for TEEContext 70/151370/5
authorakoszewski <a.koszewski@samsung.com>
Wed, 20 Sep 2017 13:52:43 +0000 (15:52 +0200)
committerLukasz Kostyra <l.kostyra@samsung.com>
Fri, 6 Oct 2017 12:08:19 +0000 (14:08 +0200)
Change-Id: I58c5af3934f55cf06eb0d26211a343a5c079d915

simulatordaemon/src/Session.cpp
simulatordaemon/src/TEEContext.cpp

index 92b302c..7b6906d 100644 (file)
@@ -134,7 +134,7 @@ TEEC_Result Session::createSession(OpenSessionData data) {
        if (!mTAInstance == true) { // failure
                LOGE(SIM_DAEMON, "Creating Trusted Application Instance FAILED - "
                                "TA not launched/Create FAILED");
-               return TEEC_ERROR_BAD_PARAMETERS;
+               return TEEC_ERROR_ITEM_NOT_FOUND;
        }
 
        /* Check if TAInstance is newly created or an old instance is being re-used.
index 97833c8..be2bf01 100644 (file)
@@ -82,7 +82,7 @@ TEEC_Result TEEContext::initContext(InitContextData* data) {
                string TName(data->TEEName);
 
                if (TName.compare(TEENAME) != 0) {
-                       data->returnValue = TEEC_ERROR_BAD_PARAMETERS;
+                       data->returnValue = TEEC_ERROR_ITEM_NOT_FOUND;
                        /* Write the response back to TEECLIB in case of failure */
                        result = mConnSess->write(INITIALIZE_CONTEXT, (char*)data,
                            sizeof(InitContextData));
@@ -197,7 +197,7 @@ TEEC_Result TEEContext::openSession(OpenSessionData data) {
        if (mSession->getTAInstance() == NULL) {
                LOGE(SIM_DAEMON, "Creating Trusted Application Instance FAILED");
                delete mSession;
-               data.returnValue = TEEC_ERROR_BAD_PARAMETERS;
+               data.returnValue = TEEC_ERROR_ITEM_NOT_FOUND;
 
                /* Write the response back to TEECLIB in case of failure */
                result = mConnSess->write(OPEN_SESSION, (char*)&data,
@@ -409,7 +409,7 @@ TEEC_Result TEEContext::openTASession(IntTAOpenSessionData data) {
        if (mSession->getTAInstance() == NULL) {
                LOGE(SIM_DAEMON, "Creating Trusted Application Instance FAILED");
                delete mSession;
-               data.returnValue = TEEC_ERROR_BAD_PARAMETERS;
+               data.returnValue = TEEC_ERROR_ITEM_NOT_FOUND;
                /* Write the response back to SSFLIB in case of failure */
                result = mConnSess->write(OPEN_TA_SESSION, (char*)&data,
                    sizeof(IntTAOpenSessionData));