Coding idiom fixes 22/73522/1 accepted/tizen/mobile/20160609.034318 accepted/tizen/wearable/20160609.034252 submit/tizen_mobile/20160608.112126 submit/tizen_wearable/20160608.112141
authorManasij Sur Roy <manasij.r@samsung.com>
Wed, 8 Jun 2016 11:02:28 +0000 (16:32 +0530)
committerManasij Sur Roy <manasij.r@samsung.com>
Wed, 8 Jun 2016 11:02:28 +0000 (16:32 +0530)
Change-Id: Ib8b21d94e3ca137d01182564543721f69ea95a5c
Signed-off-by: Manasij Sur Roy <manasij.r@samsung.com>
12 files changed:
client/fido_uaf_client.c
common/fido_b64_util.c
common/fido_json_handler.c
fido_svc_ui/fido_ui_server.c
server/fido_app_id_handler.c
server/fido_selection_ui_adaptor.c
server/fido_server.c
test/3_0_Sample_App/FIDOSample/src/fidosample.c
test/Dummy_ASM_DBUS/dummy_asm_server.c
test/FIDOSample/src/main.c
test/shell_tc/fido_shell_tc.c
test/shell_tc/fido_shell_tc_util.c

index 1b1ca27..ce9cef0 100755 (executable)
@@ -346,9 +346,9 @@ fido_uaf_set_server_result(int response_code, const char *uaf_response_json)
 
        if (is_success == FALSE) {
                _ERR("fido_call_fido_uaf_notify_result_sync failed [%d]", tizen_error_code);
-               if (dbus_err) {
+               if (dbus_err)
                        _ERR("GError = [%s]", dbus_err->message);
-               }
+
                return FIDO_ERROR_PROTOCOL_ERROR;
        }
 
index 0599c29..32f8100 100644 (file)
@@ -50,7 +50,7 @@ _fido_b64url_encode(const unsigned char *input,  int inlen, unsigned char *outpu
        *outlen = bptr->length;
 
        int i;
-       for (i =0; i < *outlen ; i++) {
+       for (i = 0; i < *outlen ; i++) {
                if (output[i] == '+')
                        output[i] = '-';
 
index e1d9d7a..130c36b 100644 (file)
@@ -183,7 +183,7 @@ __uaf_composer_compose_asm_init(JsonGenerator **generator, JsonObject **root_obj
        return TRUE;
 
 
-       CATCH:
+CATCH:
        if (generator != NULL && *generator != NULL) {
                g_object_unref(*generator);
                *generator = NULL;
@@ -248,7 +248,7 @@ __uaf_composer_compose_asm_response_init(JsonGenerator **generator, JsonObject *
        return TRUE;
 
 
-       CATCH:
+CATCH:
        if (generator != NULL && *generator != NULL) {
                g_object_unref(*generator);
                *generator = NULL;
@@ -299,8 +299,8 @@ __uaf_composer_compose_asm_version(_version_t *version, JsonNode **node)
 
        return TRUE;
 
-       CATCH:
-       if ((node !=NULL) && (*node != NULL)) {
+CATCH:
+       if ((node != NULL) && (*node != NULL)) {
                json_node_free(*node);
                *node = NULL;
        }
@@ -349,7 +349,7 @@ __uaf_composer_compose_asm_reg_in(_fido_asm_reg_in_t *reg_in, JsonNode **node)
 
        return TRUE;
 
-       CATCH:
+CATCH:
        if (node != NULL && *node != NULL) {
                json_node_free(*node);
                *node = NULL;
@@ -390,9 +390,8 @@ __uaf_composer_compose_asm_auth_in(_fido_asm_auth_in_t *auth_in, JsonNode **node
        if (auth_in->key_ids) {
                JsonArray *ids = json_array_new();
 
-       for (iter = auth_in->key_ids; iter != NULL; iter = g_list_next(iter)) {
-                       json_array_add_string_element(ids, (char *)iter->data);
-       }
+               for (iter = auth_in->key_ids; iter != NULL; iter = g_list_next(iter))
+                               json_array_add_string_element(ids, (char *)iter->data);
 
                json_object_set_array_member(obj, _JSON_KEY_KEY_IDS, ids);
        }
@@ -457,7 +456,7 @@ __uaf_composer_compose_asm_auth_in(_fido_asm_auth_in_t *auth_in, JsonNode **node
 
        return TRUE;
 
-       CATCH:
+CATCH:
        if (*node != NULL) {
                json_node_free(*node);
                *node = NULL;
@@ -631,19 +630,16 @@ _uaf_parser_parse_match(JsonObject *match_obj)
                _match_criteria_t *match_criteria = (_match_criteria_t*)calloc(1, sizeof(_match_criteria_t));
 
                JsonArray *aaid_arr = json_object_get_array_member(match_obj, _JSON_KEY_AAID);
-               if (aaid_arr != NULL) {
+               if (aaid_arr != NULL)
                        match_criteria->aaid_list = __get_string_list_from_json_array(aaid_arr);
-               }
 
                JsonArray *vendor_arr = json_object_get_array_member(match_obj, _JSON_KEY_VENDOR_ID);
-               if (vendor_arr != NULL) {
+               if (vendor_arr != NULL)
                        match_criteria->vendor_list = __get_string_list_from_json_array(vendor_arr);
-               }
 
                JsonArray *key_id_arr = json_object_get_array_member(match_obj, _JSON_KEY_KEY_IDS);
-               if (key_id_arr != NULL) {
+               if (key_id_arr != NULL)
                        match_criteria->key_id_list = __get_string_list_from_json_array(key_id_arr);
-               }
 
                match_criteria->user_verification = __get_int_from_json_object(match_obj, _JSON_KEY_USER_VERIFICATION);
 
@@ -662,14 +658,12 @@ _uaf_parser_parse_match(JsonObject *match_obj)
                }
 
                JsonArray *assertion_schm_arr = json_object_get_array_member(match_obj, _JSON_KEY_ASSERT_SCHEMES);
-               if (assertion_schm_arr) {
+               if (assertion_schm_arr)
                        match_criteria->assertion_scheme_list = __get_string_list_from_json_array(assertion_schm_arr);
-               }
 
                JsonArray *att_type_arr = json_object_get_array_member(match_obj, _JSON_KEY_ATT_TYPES);
-               if (att_type_arr) {
+               if (att_type_arr)
                        match_criteria->attestation_type_list = __get_string_list_from_json_array(att_type_arr);
-               }
 
                match_criteria->auth_version = __get_int_from_json_object(match_obj, _JSON_KEY_AUTH_VERSION);
 
@@ -1040,9 +1034,9 @@ _uaf_parser_parse_asm_response_discover(GList *asm_response_list, int *error_cod
                         _INFO("ASM Response = %s", asm_resp->asm_response_json);
                 }
 
-               if (asm_resp->error_code == FIDO_ERROR_NONE
+               if ((asm_resp->error_code == FIDO_ERROR_NONE)
                                &&
-                               asm_resp->asm_response_json != NULL) {
+                               (asm_resp->asm_response_json != NULL)) {
 
                        JsonParser *parser = json_parser_new();
                        CATCH_IF_FAIL(parser != NULL);
@@ -1505,7 +1499,7 @@ _uaf_composer_compose_asm_reg_request(_version_t *version, int auth_index, _fido
 
        return 0;
 
-       CATCH:
+CATCH:
        if (generator != NULL) {
                g_object_unref(generator);
                generator = NULL;
@@ -1918,9 +1912,8 @@ _uaf_composer_compose_final_challenge(const char *app_id, const char *challenge,
 
                GError *chb_err = NULL;
                bool chb_parsed = json_parser_load_from_data(chb_parser, ch_bin, -1, &chb_err);
-               if (chb_parsed == FALSE) {
+               if (chb_parsed == FALSE)
                        return NULL;
-               }
 
                JsonNode *chb_root = json_parser_get_root(chb_parser);
                RET_IF_FAIL(chb_root != NULL, NULL);
@@ -2012,19 +2005,16 @@ _uaf_composer_compose_final_challenge(const char *app_id, const char *challenge,
 
                GError *chb_err = NULL;
                bool chb_parsed = json_parser_load_from_data(chb_parser, ch_bin, -1, &chb_err);
-               if (chb_parsed == FALSE) {
+               if (chb_parsed == FALSE)
                        return NULL;
-               }
 
                JsonNode *chb_root = json_parser_get_root(chb_parser);
-               if (chb_root == NULL) {
+               if (chb_root == NULL)
                        return NULL;
-               }
 
                JsonObject *chb_root_obj = json_node_get_object(chb_root);
-               if (chb_root_obj == NULL) {
+               if (chb_root_obj == NULL)
                        return NULL;
-               }
 
                char *end_pt = (char*)json_object_get_string_member(chb_root_obj, _JSON_KEY_SERVER_END_POINT);
                char *cert = (char*)json_object_get_string_member(chb_root_obj, _JSON_KEY_TLS_SERVER_CERT);
@@ -2802,9 +2792,8 @@ __get_transaction_list(JsonObject *uaf_obj)
 
                        /*tcDisplayPNGCharacteristics*/
                        JsonObject *tc_disp_obj = json_object_get_object_member(tr_obj, _JSON_KEY_TC_DISP_PNG_CHARS);
-                       if (tc_disp_obj != NULL) {
+                       if (tc_disp_obj != NULL)
                                trans->display_charac = __get_png_data(tr_obj);
-                       }
 
                        trans_list = g_list_append(trans_list, trans);
                }
@@ -2860,9 +2849,8 @@ __parse_uaf_dereg_message(JsonObject *uaf_object)
        _dereg_request_t *dereg_req_temp = (_dereg_request_t *)calloc(1, sizeof(_dereg_request_t));
 
        JsonArray *auth_arr = json_object_get_array_member(uaf_object, _JSON_KEY_AUTHENTICATORS_SMALL);
-       if (auth_arr != NULL) {
+       if (auth_arr != NULL)
                json_array_foreach_element(auth_arr, __dereg_auth_parser, dereg_req_temp);
-       }
 
        return dereg_req_temp;
 }
@@ -3030,9 +3018,8 @@ _uaf_parser_parse_trusted_facets(const char *json)
                                                int idx = 0;
                                                for (; idx < id_arr_len; idx++) {
                                                        const char *id = json_array_get_string_element(id_arr, idx);
-                                                       if (id != NULL) {
+                                                       if (id != NULL)
                                                                app_id_list = g_list_append(app_id_list, strdup(id));
-                                                       }
                                                }
                                        }
                                }
index 2515b60..083080d 100644 (file)
@@ -457,7 +457,7 @@ _parse_json_ui_in(const char *ui_auth_json)
 
        json_array_foreach_element(auth_data_arr, _auth_arr_cb, NULL);
 
-       CATCH:
+CATCH:
        if (parser != NULL) {
                g_object_unref(parser);
                parser = NULL;
@@ -466,7 +466,7 @@ _parse_json_ui_in(const char *ui_auth_json)
        if (parse_err != NULL) {
                g_error_free(parse_err);
                parse_err = NULL;
-               }
+       }
 
        SAFE_DELETE(ui_auth);
 
@@ -674,9 +674,8 @@ main(int argc, char *argv[])
        ui_app_remove_event_handler(handlers[APP_EVENT_LOW_MEMORY]);
 
        ret = ui_app_main(argc, argv, &event_callback, &ad);
-       if (ret != APP_ERROR_NONE) {
+       if (ret != APP_ERROR_NONE)
                _INFO("app_main() is failed. err = %d", ret);
-       }
 
        return ret;
 }
index 9aa01c0..290a034 100644 (file)
@@ -350,7 +350,7 @@ __b64_encode(unsigned char *input, int ip_len)
        memcpy(output, bptr->data, bptr->length);
        output[bptr->length] = 0;
 
-       if(b64)
+       if (b64)
                BIO_free_all(b64);
 
        return (char*)output;
@@ -433,7 +433,7 @@ __get_pub_key_from_cert(const char *cert_b64)
 
        ret = EVP_Digest(der_pubkey, der_len, pubkey_der_digest, (unsigned int*)&hashed_len, EVP_sha256(), NULL);
 
-       if (ret != 1 ) {
+       if (ret != 1) {
                _ERR("EVP_Digest failed");
                OPENSSL_free(der_pubkey);
 
@@ -538,8 +538,7 @@ __get_tz_facet_id_of_caller(const char *caller_app_id, GDBusMethodInvocation *in
        _INFO("");
 
 
-CATCH :
-
+CATCH:
        _INFO("Before return");
 
        pkgmgrinfo_pkginfo_destroy_certinfo(cert_handle);
@@ -554,9 +553,8 @@ _verify_and_get_facet_id(const char *uaf_app_id, GDBusMethodInvocation *invocati
        _INFO("_verify_and_get_facet_id");
 
        char *app_id = __get_appid_of_dbus_caller(invocation);
-       if (app_id == NULL) {
+       if (app_id == NULL)
                return FIDO_ERROR_PERMISSION_DENIED;
-       }
 
        _app_id_cb_data_t *cb_data = (_app_id_cb_data_t*)calloc(1, sizeof(_app_id_cb_data_t));
        if (cb_data == NULL)
index 4c4e1fd..01f3200 100644 (file)
@@ -83,9 +83,8 @@ _get_ui_queue(void)
                return _ui_q;
 
        _ui_q = g_queue_new();
-       if (_ui_q == NULL) {
+       if (_ui_q == NULL)
                _ERR("Out of memory");
-       }
 
        return _ui_q;
 }
index c940e7d..c0c5986 100755 (executable)
@@ -227,9 +227,8 @@ _discover_response_intermediate_cb(GList *asm_response_list, void *user_data)
 
        if (asm_response_list == NULL)
                _ERR("Discover response failed");
-       else {
+       else
                asm_auth_list = _uaf_parser_parse_asm_response_discover(asm_response_list, &error);
-       }
 
        (cb_data->cb)(error, 0, asm_auth_list, cb_data->user_data);
 
@@ -884,12 +883,10 @@ _discover_response_cb_for_process(int tz_error_code, int error_code, GList *avai
                        GList *allowed_auth_list = _policy_checker_get_matched_auth_list(policy, available_authenticators_full);
                        g_list_free_full(available_authenticators_full, _free_asm_auth_list);
 
-                       if ((allowed_auth_list != NULL) && g_list_length(allowed_auth_list) > 0) {
-
+                       if ((allowed_auth_list != NULL) && g_list_length(allowed_auth_list) > 0)
                                _send_process_response(cb_data, FIDO_ERROR_NONE, NULL);
-                       } else {
+                       else
                                _send_process_response(cb_data, FIDO_ERROR_NO_SUITABLE_AUTHENTICATOR, NULL);
-                       }
 
                        if (allowed_auth_list != NULL)
                                g_list_free_full(allowed_auth_list, _free_matched_auth_data);
@@ -906,12 +903,10 @@ _discover_response_cb_for_process(int tz_error_code, int error_code, GList *avai
                                                                                                                                                                   available_authenticators_full);
                        g_list_free_full(available_authenticators_full, _free_asm_auth_list);
 
-                       if ((matched_auth_list != NULL) && g_list_length(matched_auth_list) > 0) {
-
+                       if ((matched_auth_list != NULL) && g_list_length(matched_auth_list) > 0)
                                _send_process_response(cb_data, FIDO_ERROR_NONE, NULL);
-                       } else {
+                       else
                                _send_process_response(cb_data, FIDO_ERROR_NO_SUITABLE_AUTHENTICATOR, NULL);
-                       }
 
                        if (matched_auth_list != NULL)
                                g_list_free_full(matched_auth_list, __free_matched_dereg_auth_data_list_item);
@@ -1108,9 +1103,8 @@ __facet_id_cb(int err, const char *facet_id, void *user_data)
 
        error_code = _handle_process_message(cb_data);
 
-       if (error_code != FIDO_ERROR_NONE) {
+       if (error_code != FIDO_ERROR_NONE)
                _send_process_response(cb_data, error_code, NULL);
-       }
 }
 
 gboolean
@@ -1164,7 +1158,7 @@ _dbus_on_fido_discover(Fido *object, GDBusMethodInvocation *invocation)
 }
 
 gboolean
-_dbus_handle_process_or_check_policy(Fido *object, GDBusMethodInvocation *invocation, 
+_dbus_handle_process_or_check_policy(Fido *object, GDBusMethodInvocation *invocation,
                                                                        const gchar *uaf_request_json, const gchar *channel_binding,
                                                                         _process_type_t type)
 {
index 3f22bca..dfa4839 100644 (file)
@@ -87,12 +87,13 @@ static void create_popup(char *popup_str, appdata_s *ad)
        return;
 }
 
-char *get_error_code(fido_error_e error_code)
+char*
+get_error_code(fido_error_e error_code)
 {
 
-       char *error_str = calloc(1,128);
+       char *error_str = calloc(1, 128);
 
-       if(error_code == FIDO_ERROR_NONE)
+       if (error_code == FIDO_ERROR_NONE)
                strcpy(error_str, "SUCCESS");
        else if (error_code == FIDO_ERROR_OUT_OF_MEMORY)
                strcpy(error_str, "FIDO_ERROR_OUT_OF_MEMORY");
@@ -150,7 +151,7 @@ __print_authinfo(const fido_authenticator_h auth, appdata_s *ad)
 
        char *title =  NULL;
        fido_authenticator_get_title(auth, &title);
-       if(title) {
+       if (title != NULL) {
                sprintf(tmp, " | Title = [%s]", title);
                strcat(str, tmp);
        }
@@ -158,7 +159,7 @@ __print_authinfo(const fido_authenticator_h auth, appdata_s *ad)
 
        char *aaid = NULL;
        fido_authenticator_get_aaid(auth, &aaid);
-       if(aaid) {
+       if (aaid != NULL) {
                sprintf(tmp, " | AAID = [%s]", aaid);
                strcat(str, tmp);
        }
@@ -166,7 +167,7 @@ __print_authinfo(const fido_authenticator_h auth, appdata_s *ad)
 
        char *description = NULL;
        fido_authenticator_get_description(auth, &description);
-       if(description) {
+       if (description != NULL) {
                sprintf(tmp, " | Description = [%s]", description);
                strcat(str, tmp);
        }
@@ -174,7 +175,7 @@ __print_authinfo(const fido_authenticator_h auth, appdata_s *ad)
 
        char *scheme = NULL;
        fido_authenticator_get_assertion_scheme(auth, &scheme);
-       if(scheme) {
+       if (scheme != NULL) {
                sprintf(tmp, " | Scheme = [%s]", scheme);
                strcat(str, tmp);
        }
@@ -184,7 +185,7 @@ __print_authinfo(const fido_authenticator_h auth, appdata_s *ad)
 
        fido_auth_algo_e get_algo = -1;
        fido_authenticator_get_algorithm(auth, &get_algo);
-       if(get_algo != -1) {
+       if (get_algo != -1) {
                sprintf(tmp, " | Algo = [%d]", get_algo);
                strcat(str, tmp);
        }
@@ -198,35 +199,35 @@ __print_authinfo(const fido_authenticator_h auth, appdata_s *ad)
 
        fido_auth_key_protection_type_e key_protection = -1;
        fido_authenticator_get_key_protection_method(auth, &key_protection);
-       if(key_protection != -1) {
+       if (key_protection != -1) {
                sprintf(tmp, " | Key Protection = [%d]", key_protection);
                strcat(str, tmp);
        }
 
        fido_auth_matcher_protection_type_e matcher_protection = -1;
        fido_authenticator_get_matcher_protection_method(auth, &matcher_protection);
-       if(matcher_protection != -1) {
+       if (matcher_protection != -1) {
                sprintf(tmp, " | Matcher Protection = [%d]", matcher_protection);
                strcat(str, tmp);
        }
 
        fido_auth_attachment_hint_e attachment_hint = -1;
        fido_authenticator_get_attachment_hint(auth, &attachment_hint);
-       if(attachment_hint != -1) {
+       if (attachment_hint != -1) {
                sprintf(tmp, " | Attachment Hint = [%d]", attachment_hint);
                strcat(str, tmp);
        }
 
        fido_auth_tc_display_type_e tc_discplay = -1;
        fido_authenticator_get_tc_discplay(auth, &tc_discplay);
-       if(tc_discplay != -1) {
+       if (tc_discplay != -1) {
                sprintf(tmp, " | Tc Display = [%d]", tc_discplay);
                strcat(str, tmp);
        }
 
        char *tc_display_type = NULL;
        fido_authenticator_get_tc_display_type(auth, &tc_display_type);
-       if(tc_display_type) {
+       if (tc_display_type != NULL) {
                sprintf(tmp, " | Tc Display Type = [%s]", tc_display_type);
                strcat(str, tmp);
        }
@@ -234,7 +235,7 @@ __print_authinfo(const fido_authenticator_h auth, appdata_s *ad)
 
        char *icon = NULL;
        fido_authenticator_get_icon(auth, &icon);
-       if(icon) {
+       if (icon != NULL) {
                sprintf(tmp, " | Icon = [%s]", icon);
                strcat(str, tmp);
        }
@@ -281,8 +282,7 @@ start_check_policy(void *data, Evas_Object *obj, void *event_info)
                sprintf(str, "[%s]", error_string);
                create_popup(str, (appdata_s *) data);
                free(error_string);
-       }
-       else {
+       } else {
                if (is_supported == true)
                        sprintf(str, "TRUE");
                else
@@ -295,7 +295,7 @@ start_check_policy(void *data, Evas_Object *obj, void *event_info)
 static void
 _process_cb(fido_error_e tizen_error_code, const char *uaf_response, void *user_data)
 {
-    dlog_print(DLOG_INFO, "org.tizen.Fidosample", "process response = [%d]", tizen_error_code);
+       dlog_print(DLOG_INFO, "org.tizen.Fidosample", "process response = [%d]", tizen_error_code);
 
        if (tizen_error_code == 0 && uaf_response != NULL) {
                dlog_print(DLOG_INFO, "org.tizen.Fidosample", "uaf response = %s", uaf_response);
@@ -307,8 +307,7 @@ _process_cb(fido_error_e tizen_error_code, const char *uaf_response, void *user_
 
                create_popup(popup_str, (appdata_s *) user_data);
                free(popup_str);
-       }
-       else {
+       } else {
                __show_error(tizen_error_code, (appdata_s *)user_data);
        }
 }
@@ -372,13 +371,12 @@ _process_cb_for_notify_pos(fido_error_e tizen_error_code, const char *uaf_respon
                dlog_print(DLOG_INFO, "org.tizen.Fidosample", "uaf response = %s", uaf_response);
 
                int ret = fido_uaf_set_server_result(FIDO_SERVER_STATUS_CODE_OK, uaf_response);
-        dlog_print(DLOG_INFO, "org.tizen.Fidosample", "fido_uaf_set_server_result =[%d]", ret);
+               dlog_print(DLOG_INFO, "org.tizen.Fidosample", "fido_uaf_set_server_result =[%d]", ret);
 
                char *error_string = get_error_code(tizen_error_code);
                create_popup(error_string, (appdata_s *) user_data);
                free(error_string);
-       }
-       else {
+       } else {
                __show_error(tizen_error_code, (appdata_s *)user_data);
        }
 }
@@ -386,19 +384,18 @@ _process_cb_for_notify_pos(fido_error_e tizen_error_code, const char *uaf_respon
 static void
 _process_cb_for_notify_neg(fido_error_e tizen_error_code, const char *uaf_response, void *user_data)
 {
-    dlog_print(DLOG_INFO, "org.tizen.Fidosample", "process response = [%d]", tizen_error_code);
+       dlog_print(DLOG_INFO, "org.tizen.Fidosample", "process response = [%d]", tizen_error_code);
 
        if (tizen_error_code == 0) {
                dlog_print(DLOG_INFO, "org.tizen.Fidosample", "uaf response = %s", uaf_response);
 
                int ret = fido_uaf_set_server_result(0, uaf_response);
-        dlog_print(DLOG_INFO, "org.tizen.Fidosample", "fido_uaf_set_server_result =[%d]", ret);
+               dlog_print(DLOG_INFO, "org.tizen.Fidosample", "fido_uaf_set_server_result =[%d]", ret);
 
                char *error_string = get_error_code(tizen_error_code);
                create_popup(error_string, (appdata_s *) user_data);
                free(error_string);
-       }
-       else {
+       } else {
                __show_error(tizen_error_code, (appdata_s *)user_data);
        }
 }
@@ -630,9 +627,8 @@ main(int argc, char *argv[])
        ui_app_remove_event_handler(handlers[APP_EVENT_LOW_MEMORY]);
 
        ret = ui_app_main(argc, argv, &event_callback, &ad);
-       if (ret != APP_ERROR_NONE) {
+       if (ret != APP_ERROR_NONE)
                dlog_print(DLOG_ERROR, LOG_TAG, "app_main() is failed. err = %d", ret);
-       }
 
        return ret;
 }
index 14be180..183c25f 100644 (file)
@@ -191,21 +191,16 @@ _dbus_on_asm_request(Dummyasm *object, GDBusMethodInvocation *invocation, const
 
        _INFO("request type=[%s]", req_type);
 
-       if (strcmp(req_type, "GetInfo") == 0) {
+       if (strcmp(req_type, "GetInfo") == 0)
                dummyasm_complete_asm_request(object, invocation, 0, _GET_INFO_RESPONSE);
-       }
-       if (strcmp(req_type, "Register") == 0) {
+       if (strcmp(req_type, "Register") == 0)
                dummyasm_complete_asm_request(object, invocation, 0, _REG_RESPONSE);
-       }
-       if (strcmp(req_type, "Authenticate") == 0) {
+       if (strcmp(req_type, "Authenticate") == 0)
                dummyasm_complete_asm_request(object, invocation, 0, _AUTH_RESPONSE);
-       }
-       if (strcmp(req_type, "Deregister") == 0) {
+       if (strcmp(req_type, "Deregister") == 0)
                dummyasm_complete_asm_request(object, invocation, 0, _DEREG_RESPONSE);
-       }
-       if (strcmp(req_type, "GetRegistrations") == 0) {
+       if (strcmp(req_type, "GetRegistrations") == 0)
                dummyasm_complete_asm_request(object, invocation, 0, _GET_REGISTRATIONS_RESPONSE);
-       }
 
        return true;
 }
@@ -217,14 +212,12 @@ on_bus_acquired(GDBusConnection *connection, const gchar *name, gpointer user_da
 
                GDBusInterfaceSkeleton* interface = NULL;
                __dbus_obj = dummyasm_skeleton_new();
-               if (__dbus_obj == NULL) {
+               if (__dbus_obj == NULL)
                        return;
-               }
 
                interface = G_DBUS_INTERFACE_SKELETON(__dbus_obj);
-               if (!g_dbus_interface_skeleton_export(interface, connection, _DUMMY_ASM_SERVICE_DBUS_PATH, NULL)) {
+               if (!g_dbus_interface_skeleton_export(interface, connection, _DUMMY_ASM_SERVICE_DBUS_PATH, NULL))
                        return;
-               }
 
                _INFO("before g_signal_connect");
                g_signal_connect(__dbus_obj, "handle_asm_request",
index 7691096..e7ffcf7 100755 (executable)
@@ -669,9 +669,8 @@ main(int argc, char *argv[])
        ui_app_remove_event_handler(handlers[APP_EVENT_LOW_MEMORY]);
 
        ret = ui_app_main(argc, argv, &event_callback, &ad);
-       if (ret != APP_ERROR_NONE) {
+       if (ret != APP_ERROR_NONE)
                dlog_print(DLOG_ERROR, LOG_TAG, "app_main() is failed. err = %d", ret);
-       }
 
        return ret;
 }
index 7546d6a..0dac8c1 100644 (file)
@@ -205,9 +205,9 @@ find_auth(void)
 {
        int ret = fido_foreach_authenticator(auth_list_cb, NULL);
 
-       if (ret != FIDO_ERROR_NONE) {
+       if (ret != FIDO_ERROR_NONE)
                __show_error(ret);
-       }
+
        get_user_choice();
 }
 
@@ -362,7 +362,7 @@ get_user_choice(void)
 {
        int sel_opt = 0;
        const int options[8] = { 1, 2, 3, 4, 5, 6, 7, 8 };
-       const char *names[8] = {        "Find Authenticator",
+       const char *names[8] = {        "Find Authenticator",
                                                                "Check UAF Message Supported",
                                                                "Registration",
                                                                "Authentication",
index 060b5ae..0f092b1 100644 (file)
@@ -33,7 +33,7 @@ print_fail_result(
                        action_name);
 }
 
-void 
+void
 print_done_result(const char *action_name)
 {
        printf(TEXT_YELLOW
@@ -42,7 +42,7 @@ print_done_result(const char *action_name)
                        action_name);
 }
 
-void 
+void
 print_success_result(const char *action_name)
 {
        printf(TEXT_GREEN
@@ -51,7 +51,7 @@ print_success_result(const char *action_name)
                        "\n", action_name);
 }
 
-void 
+void
 print_action_result(
                const char *action_name,
                int action_return_value,
@@ -77,7 +77,7 @@ print_action_result(
        }
 }
 
-int 
+int
 input_string(const char *prompt, size_t max_len, char **string)
 {
        printf("\n");
@@ -104,7 +104,7 @@ input_string(const char *prompt, size_t max_len, char **string)
        return strlen(*string);
 }
 
-int 
+int
 input_size(const char *prompt, size_t max_size, size_t *size)
 {
        printf("\n");
@@ -142,7 +142,7 @@ input_int(const char *prompt, int min_value, int max_value, int *value)
        return (*value < min_value || *value > max_value ? -1 : 0);
 }
 
-int 
+int
 input_double(
                const char *prompt,
                double min_value,
@@ -165,7 +165,7 @@ input_double(
        return (*value < min_value || *value > max_value ? -1 : 0);
 }
 
-bool 
+bool
 show_confirm_dialog(const char *title)
 {
        const int options[2] = {1, 2};
@@ -193,7 +193,7 @@ show_confirm_dialog(const char *title)
        return answer;
 }
 
-int 
+int
 show_menu(
                const char *title,
                const int *options,