SVACE issue fix 86/69686/1 accepted/tizen/mobile/20160517.033252 accepted/tizen/wearable/20160517.033041 submit/tizen_mobile/20160516.104621 submit/tizen_mobile/20160518.111350 submit/tizen_wearable/20160516.104634 submit/tizen_wearable/20160518.111404
authorManasij Sur Roy <manasij.r@samsung.com>
Mon, 16 May 2016 10:25:10 +0000 (15:55 +0530)
committerManasij Sur Roy <manasij.r@samsung.com>
Mon, 16 May 2016 10:25:10 +0000 (15:55 +0530)
Change-Id: I608bc336a8cb8f76b259a1a1886bf802038b7177
Signed-off-by: Manasij Sur Roy <manasij.r@samsung.com>
server/fido_server.c

index fa7285b..c940e7d 100755 (executable)
@@ -837,6 +837,14 @@ _discover_response_cb_for_process(int tz_error_code, int error_code, GList *avai
                return;
        }
 
+       if (cb_data->uaf_req->header->operation == NULL) {
+               _ERR("op field missing in uaf json message");
+
+               _send_process_response(cb_data, FIDO_ERROR_PROTOCOL_ERROR, NULL);
+
+               return;
+       }
+
        _INFO("cb_data->type = [%d]", cb_data->type);
 
        GList *available_authenticators_full = g_list_first(available_authenticators);
@@ -845,10 +853,7 @@ _discover_response_cb_for_process(int tz_error_code, int error_code, GList *avai
 
                _INFO("_PROCESS_TYPE_CHECK_POLICY");
 
-               if (cb_data->uaf_req->header->operation != NULL)
-                       _INFO("operation = [%s]", cb_data->uaf_req->header->operation);
-               else
-                       _ERR("operation = [NULL]");
+               _INFO("operation = [%s]", cb_data->uaf_req->header->operation);
 
                if ((strcmp(cb_data->uaf_req->header->operation, _UAF_OPERATION_NAME_KEY_REG) == 0)
                                         || ((strcmp(cb_data->uaf_req->header->operation, _UAF_OPERATION_NAME_KEY_AUTH) == 0))) {