Check TEE name again 97/173997/3
authorKrzysztof Dynowski <k.dynowski@samsung.com>
Tue, 27 Mar 2018 10:28:19 +0000 (12:28 +0200)
committerKrzysztof Jackiewicz <k.jackiewicz@samsung.com>
Fri, 30 Mar 2018 09:39:43 +0000 (09:39 +0000)
Change-Id: I4dfb4511da9ec8dc8bf496e32b22dcbc9ee62c76

simulatordaemon/src/TEEContext.cpp

index 400535f..c881ea2 100644 (file)
@@ -72,14 +72,22 @@ TEEC_Result TEEContext::initContext(InitContextData* data) {
 
        LOGD(SIM_DAEMON, "Entry");
 
+       if (data->nameLength != 0) {
+               data->returnValue = TEEC_ERROR_ITEM_NOT_FOUND;
+               result = mConnSess->write(INITIALIZE_CONTEXT, (char*)data, sizeof(InitContextData));
+               if (result != TEEC_SUCCESS) {
+                       LOGE(SIM_DAEMON, "Initialize Context response write to CA FAILED");
+               }
+               return result;
+       }
+
        /* Initialize Context is a request from CA, so the member variable
         * isInternal of TEEContext is set to false.
         */
        isInternal = false;
 
        if (!cynara_check_result) {
-               result = TEEC_ERROR_ACCESS_DENIED;
-               data->returnValue = result;
+               data->returnValue = TEEC_ERROR_ACCESS_DENIED;
                result = mConnSess->write(INITIALIZE_CONTEXT, (char*)data,
                    sizeof(InitContextData));
                if (result != TEEC_SUCCESS) {