BIO * b64 = NULL;
BUF_MEM * bptr = NULL;
b64 = BIO_new(BIO_f_base64());
- if(b64 == NULL) {
+ if (b64 == NULL) {
_ERR("BIO_new with BIO_f_base64 failed ");
return -1;
}
*outlen = bptr->length;
int i;
- for(i =0; i < *outlen ; i++) {
- if(output[i] == '+')
+ for (i =0; i < *outlen ; i++) {
+ if (output[i] == '+')
output[i] = '-';
- else if(output[i] == '/')
+ else if (output[i] == '/')
output[i] = '_';
- else if(output[i] == '=') {
+ else if (output[i] == '=') {
*outlen = i ;
output[i] = '\0';
break;
int npadChars = (inlen %4) == 0 ? 0 : (4 - (inlen%4));
unsigned char *base64 = (unsigned char *) malloc(inlen + npadChars);
- if(base64 == NULL) {
+ if (base64 == NULL) {
_ERR("malloc failed");
return -1;
}
#include <stdlib.h>
#include <dlog.h>
#include <glib.h>
-#if !GLIB_CHECK_VERSION (2, 31, 0)
+#if !GLIB_CHECK_VERSION(2, 31, 0)
#include <glib/gmacros.h>
#endif
#include <json-glib/json-glib.h>
JsonNode *root_node = NULL;
*generator = json_generator_new();
- if(*generator == NULL) {
+ if (*generator == NULL) {
_INFO("json_generator_new is NULL");
goto CATCH;
}
}
*root_obj = json_object_new();
- if(*root_obj == NULL) {
+ if (*root_obj == NULL) {
_INFO("json_object_new in NULL");
goto CATCH;
}
JsonArray *rootArray = json_array_new();
*generator = json_generator_new();
- if(*generator == NULL) {
+ if (*generator == NULL) {
_INFO("json_generator_new is NULL");
goto CATCH;
}
}
gen_object = json_object_new();
- if(gen_object == NULL) {
+ if (gen_object == NULL) {
_INFO("json_object_new in NULL");
goto CATCH;
}
*root_obj = json_object_new();
- if(*root_obj == NULL) {
+ if (*root_obj == NULL) {
_INFO("json_object_new in NULL");
goto CATCH;
}
}
JsonObject *obj = json_object_new();
- if(obj == NULL) {
+ if (obj == NULL) {
_INFO("json_object_new in NULL");
goto CATCH;
}
return TRUE;
CATCH:
- if (node !=NULL && *node != NULL) {
+ if ((node !=NULL) && (*node != NULL)) {
json_node_free(*node);
*node = NULL;
}
}
JsonObject *obj = json_object_new();
- if(obj == NULL) {
+ if (obj == NULL) {
_INFO("json_object_new in NULL");
goto CATCH;
}
}
JsonObject *obj = json_object_new();
- if(obj == NULL) {
+ if (obj == NULL) {
_INFO("json_object_new in NULL");
goto CATCH;
}
if (auth_in->final_challenge)
json_object_set_string_member(obj, _JSON_KEY_FINAL_CHALLENGE, auth_in->final_challenge);
- if(auth_in->trans_list != NULL) {
+ if (auth_in->trans_list != NULL) {
JsonArray *transArray = json_array_new();
GList *iter = g_list_first(auth_in->trans_list);
- while(iter != NULL) {
+ while (iter != NULL) {
_fido_asm_transaction_t *val = (_fido_asm_transaction_t*)(iter->data);
JsonNode *transNode = json_node_new(JSON_NODE_OBJECT);
JsonObject *transObject = json_object_new();
JsonNode *tcNode = json_node_new(JSON_NODE_OBJECT);
JsonObject *tcObject = json_object_new();
- if(val->display_charac != NULL) {
+ if (val->display_charac != NULL) {
json_object_set_int_member(tcObject, _JSON_KEY_WIDTH, val->display_charac->width);
json_object_set_int_member(tcObject, _JSON_KEY_HEIGHT, val->display_charac->height);
json_object_set_int_member(tcObject, _JSON_KEY_BIT_DEPTH, val->display_charac->bit_depth);
json_object_set_int_member(tcObject, _JSON_KEY_FILTER, val->display_charac->filter);
json_object_set_int_member(tcObject, _JSON_KEY_INTERLACE, val->display_charac->interlace);
- if(val->display_charac != NULL) {
+ if (val->display_charac != NULL) {
JsonArray *plteArray = json_array_new();
GList *plte_iter = g_list_first(val->display_charac->plte);
- while(plte_iter != NULL) {
+ while (plte_iter != NULL) {
_fido_asm_rgb_pallette_entry_t *plte = (_fido_asm_rgb_pallette_entry_t*)(plte_iter->data);
JsonNode *plteNode = json_node_new(JSON_NODE_OBJECT);
JsonObject *plteObject = json_object_new();
if (__uaf_composer_compose_asm_version(version, &version_node) != TRUE) {
_INFO("__uaf_composer_compose_asm_version fail");
goto CATCH;
- }
- else
+ } else {
json_object_set_member(root_obj, _JSON_KEY_ASM_VERSION, version_node);
+ }
json_object_set_int_member(root_obj, _JSON_KEY_AUTH_INDEX, auth_index);
if (!__uaf_composer_compose_asm_reg_in(reg_in, ®ister_node)) {
_INFO("__uaf_composer_compose_asm_reg_in fail");
goto CATCH;
- }
- else
+ } else {
json_object_set_member(root_obj, _JSON_KEY_ARGS, register_node);
+ }
*asm_reg_json = json_generator_to_data(generator, NULL);
if (__uaf_composer_compose_asm_version(version, &version_node) != TRUE) {
_INFO("_uaf_composer_compose_asm_auth_request fail");
goto CATCH;
- }
- else
+ } else {
json_object_set_member(root_obj, _JSON_KEY_ASM_VERSION, version_node);
+ }
/*args*/
if (__uaf_composer_compose_asm_auth_in(auth_in, &auth_node) != TRUE) {
_INFO("_uaf_composer_compose_asm_auth_request fail");
goto CATCH;
- }
- else
+ } else {
json_object_set_member(root_obj, _JSON_KEY_ARGS, auth_node);
+ }
/*Transaction list composing*/
if (__uaf_composer_compose_asm_version(version, &version_node) != TRUE) {
_INFO("_uaf_composer_compose_asm_dereg_request fail");
goto CATCH;
- }
- else
+ } else {
json_object_set_member(root_obj, _JSON_KEY_ASM_VERSION, version_node);
+ }
/*args*/
JsonNode *argNode = json_node_new(JSON_NODE_OBJECT);
JsonGenerator *generator = json_generator_new();
JsonObject *root_obj = json_object_new();
- if(__uaf_composer_compose_asm_init(&generator, &root_obj) != TRUE) {
+ if (__uaf_composer_compose_asm_init(&generator, &root_obj) != TRUE) {
_INFO("_uaf_composer_compose_asm_init fail");
goto CATCH;
}
JsonNode *jsonNode = NULL;
JsonObject *jsonObject = json_object_new();
- if(ch_bin != NULL) {
+ if (ch_bin != NULL) {
JsonParser *chb_parser = json_parser_new();
GError *chb_err = 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);
+ char *cert = (char*)json_object_get_string_member(chb_root_obj, _JSON_KEY_TLS_SERVER_CERT);
char *uni = (char*)json_object_get_string_member(chb_root_obj, _JSON_KEY_TLS_UNIQUE);
char *cid = (char*)json_object_get_string_member(chb_root_obj, _JSON_KEY_CID_PUB_KEY);
return ((char*)fc_enc);
CATCH:
- if(generator!=NULL) {
+ if (generator != NULL) {
g_object_unref(generator);
generator = NULL;
}
- if(root_obj!=NULL) {
+ if (root_obj != NULL) {
g_object_unref(root_obj);
root_obj = NULL;
}
JsonGenerator *generator = json_generator_new();
JsonObject *root_obj = json_object_new();
- if(__uaf_composer_compose_asm_response_init(&generator, &root_obj) != TRUE) {
+ if (__uaf_composer_compose_asm_response_init(&generator, &root_obj) != TRUE) {
_INFO("_uaf_composer_compose_asm_init fail");
goto CATCH;
}
/*header*/
JsonNode *_header = json_node_new(JSON_NODE_OBJECT);
JsonObject *obj1 = json_object_new();
- if(obj1 == NULL) {
+ if (obj1 == NULL) {
_INFO("json_object_new is NULL");
goto CATCH;
}
JsonNode *upv = json_node_new(JSON_NODE_OBJECT);
JsonObject *obj2 = json_object_new();
- if(obj2 == NULL) {
+ if (obj2 == NULL) {
_INFO("json_object_new is NULL");
goto CATCH;
}
_INFO("_uaf_composer_compose_uaf_process_response_reg return fail");
- if(generator!=NULL) {
+ if (generator != NULL) {
g_object_unref(generator);
generator = NULL;
}
return 0;
CATCH:
- if(generator!=NULL) {
+ if (generator != NULL) {
g_object_unref(generator);
generator = NULL;
}
- if(root_obj!=NULL) {
+ if (root_obj != NULL) {
g_object_unref(root_obj);
root_obj = NULL;
}
json_builder_add_int_value(upv_root, uaf_res->header->version->major);
json_builder_set_member_name(upv_root, _JSON_KEY_MINOR);
- json_builder_add_int_value(upv_root,uaf_res->header->version->minor);
+ json_builder_add_int_value(upv_root, uaf_res->header->version->minor);
json_builder_end_object(upv_root);
JsonGenerator *generator = json_generator_new();
JsonObject *root_obj = json_object_new();
- if(__uaf_composer_compose_asm_init(&generator, &root_obj) != TRUE) {
+ if (__uaf_composer_compose_asm_init(&generator, &root_obj) != TRUE) {
_INFO("_uaf_composer_compose_asm_init fail");
goto CATCH;
}
gsize len = 0;
char *dereg_json = json_generator_to_data(generator, &len);
- if(generator!=NULL) {
+ if (generator != NULL) {
g_object_unref(generator);
generator = NULL;
}
return NULL;
CATCH:
- if(generator!=NULL) {
+ if (generator != NULL) {
g_object_unref(generator);
generator = NULL;
}
- if(root_obj!=NULL) {
+ if (root_obj != NULL) {
g_object_unref(root_obj);
root_obj = NULL;
}
RET_IF_FAIL(accepted_array != NULL, NULL);
int accepted_len = json_array_get_length(accepted_array);
- _INFO("Parser accepted list count [%d]", accepted_len);
+ _INFO("Parser accepted list count [%d]", accepted_len);
_policy_t *policy_info = (_policy_t *)calloc(1, sizeof(_policy_t));
policy_info->is_keyid_present = false;
int tr_arr_len = json_array_get_length(tr_arr);
int i = 0;
- for (; i< tr_arr_len; i++) {
+ for (; i < tr_arr_len; i++) {
JsonObject *tr_obj = json_array_get_object_element(tr_arr, i);
if (tr_obj != NULL) {
if (uaf_message_temp->header == NULL)
continue;
- if (strcmp(uaf_message_temp->header->operation, _UAF_OPERATION_NAME_KEY_REG) == 0){
+ if (strcmp(uaf_message_temp->header->operation, _UAF_OPERATION_NAME_KEY_REG) == 0) {
uaf_message_temp->data = (void *)__parse_uaf_reg_message(uaf_object);
if (uaf_message_temp->data == NULL) {
g_object_unref(parser);
return NULL;
- }
- else {
+ } else {
uaf_message_temp->type = _MESSAGE_TYPE_REG;
g_object_unref(parser);
}
}
- if (strcmp(uaf_message_temp->header->operation, _UAF_OPERATION_NAME_KEY_AUTH) == 0){
+ if (strcmp(uaf_message_temp->header->operation, _UAF_OPERATION_NAME_KEY_AUTH) == 0) {
uaf_message_temp->data = (void *)__parse_uaf_auth_message(uaf_object);
if (uaf_message_temp->data == NULL) {
g_object_unref(parser);
return NULL;
- }
- else {
- uaf_message_temp->type = _MESSAGE_TYPE_AUTH;
+ } else {
+ uaf_message_temp->type = _MESSAGE_TYPE_AUTH;
- g_object_unref(parser);
- return uaf_message_temp;
+ g_object_unref(parser);
+ return uaf_message_temp;
}
}
- if (strcmp(uaf_message_temp->header->operation, _UAF_OPERATION_NAME_KEY_DE_REG) == 0){
+ if (strcmp(uaf_message_temp->header->operation, _UAF_OPERATION_NAME_KEY_DE_REG) == 0) {
uaf_message_temp->data = (void *)__parse_uaf_dereg_message(uaf_object);
if (uaf_message_temp->data == NULL) {
g_object_unref(parser);
return NULL;
- }
- else {
+ } else {
uaf_message_temp->type = _MESSAGE_TYPE_DEREG;
g_object_unref(parser);
JsonGenerator *generator = json_generator_new();
JsonObject *root_obj = json_object_new();
- if(__uaf_composer_compose_asm_init(&generator, &root_obj) != TRUE) {
+ if (__uaf_composer_compose_asm_init(&generator, &root_obj) != TRUE) {
_INFO("_uaf_composer_compse_asm_init fail");
goto CATCH;
}
gsize len = 0;
char *get_reg_json = json_generator_to_data(generator, &len);
- if(generator != NULL) {
+ if (generator != NULL) {
g_object_unref(generator);
generator = NULL;
}
return get_reg_json;
CATCH:
- if(generator != NULL) {
+ if (generator != NULL) {
g_object_unref(generator);
generator = NULL;
}
- if(root_obj != NULL) {
+ if (root_obj != NULL) {
g_object_unref(root_obj);
root_obj = NULL;
}
_auth_reg_assertion_tlv_t*
_tlv_util_decode_reg_assertion(char *tlv_enc)
{
- _INFO("_tlv_util_decode_reg_assertion");
+ _INFO("_tlv_util_decode_reg_assertion");
- RET_IF_FAIL(tlv_enc != NULL, NULL);
+ RET_IF_FAIL(tlv_enc != NULL, NULL);
- _INFO("%s", tlv_enc);
+ _INFO("%s", tlv_enc);
- int in_len = strlen(tlv_enc);
- int tlv_dec_len = in_len * 1.5;
- unsigned char *tlv_dec = calloc(1, tlv_dec_len);
+ int in_len = strlen(tlv_enc);
+ int tlv_dec_len = in_len * 1.5;
+ unsigned char *tlv_dec = calloc(1, tlv_dec_len);
- int r = _fido_b64url_decode((unsigned char *)tlv_enc, in_len, tlv_dec, &tlv_dec_len);
+ int r = _fido_b64url_decode((unsigned char *)tlv_enc, in_len, tlv_dec, &tlv_dec_len);
RET_IF_FAIL(r == 0, NULL);
- _INFO("in len = [%d], decoded len = [%d]", in_len, tlv_dec_len);
+ _INFO("in len = [%d], decoded len = [%d]", in_len, tlv_dec_len);
- _tlv_t *reg_tlv = __get_tlv_pack_by_type(tlv_dec, TAG_UAFV1_REG_ASSERTION, tlv_dec_len);
- if (reg_tlv != NULL) {
- _INFO("Found TAG_UAFV1_REG_ASSERTION");
+ _tlv_t *reg_tlv = __get_tlv_pack_by_type(tlv_dec, TAG_UAFV1_REG_ASSERTION, tlv_dec_len);
+ if (reg_tlv != NULL) {
+ _INFO("Found TAG_UAFV1_REG_ASSERTION");
- _free_tlv(reg_tlv);
+ _free_tlv(reg_tlv);
- int krd_start_idx = 2 + 2;
+ int krd_start_idx = 2 + 2;
- _tlv_t *krd_tlv = __get_tlv_pack_by_type(tlv_dec + krd_start_idx, TAG_UAFV1_KRD, (tlv_dec_len - krd_start_idx));
- if (krd_tlv != NULL) {
- _INFO("Found TAG_UAFV1_KRD");
- _free_tlv(krd_tlv);
+ _tlv_t *krd_tlv = __get_tlv_pack_by_type(tlv_dec + krd_start_idx, TAG_UAFV1_KRD, (tlv_dec_len - krd_start_idx));
+ if (krd_tlv != NULL) {
+ _INFO("Found TAG_UAFV1_KRD");
+ _free_tlv(krd_tlv);
- int krd_inner_start_idx = krd_start_idx + 2 + 2;
+ int krd_inner_start_idx = krd_start_idx + 2 + 2;
- _tlv_t *aaid_tlv = __get_tlv_pack_by_type(tlv_dec + krd_inner_start_idx, TAG_AAID, (tlv_dec_len - krd_inner_start_idx));
+ _tlv_t *aaid_tlv = __get_tlv_pack_by_type(tlv_dec + krd_inner_start_idx, TAG_AAID, (tlv_dec_len - krd_inner_start_idx));
- _tlv_t *key_id_tlv = __get_tlv_pack_by_type(tlv_dec + krd_inner_start_idx, TAG_KEYID, (tlv_dec_len - krd_inner_start_idx));
+ _tlv_t *key_id_tlv = __get_tlv_pack_by_type(tlv_dec + krd_inner_start_idx, TAG_KEYID, (tlv_dec_len - krd_inner_start_idx));
- _auth_reg_assertion_tlv_t *assrt_tlv = (_auth_reg_assertion_tlv_t*)calloc(1, sizeof(_auth_reg_assertion_tlv_t));
+ _auth_reg_assertion_tlv_t *assrt_tlv = (_auth_reg_assertion_tlv_t*)calloc(1, sizeof(_auth_reg_assertion_tlv_t));
- if (aaid_tlv != NULL) {
- _INFO("Found TAG_AAID");
+ if (aaid_tlv != NULL) {
+ _INFO("Found TAG_AAID");
- assrt_tlv->aaid = (char*)calloc(1, aaid_tlv->len + 1);
- memcpy(assrt_tlv->aaid, aaid_tlv->val, aaid_tlv->len);
+ assrt_tlv->aaid = (char*)calloc(1, aaid_tlv->len + 1);
+ memcpy(assrt_tlv->aaid, aaid_tlv->val, aaid_tlv->len);
- _free_tlv(aaid_tlv);
- }
+ _free_tlv(aaid_tlv);
+ }
- if (key_id_tlv != NULL) {
- _INFO("Found TAG_KEYID");
+ if (key_id_tlv != NULL) {
+ _INFO("Found TAG_KEYID");
- assrt_tlv->key_id = (unsigned char*)calloc(1, key_id_tlv->len);
- memcpy(assrt_tlv->key_id, key_id_tlv->val, key_id_tlv->len);
+ assrt_tlv->key_id = (unsigned char*)calloc(1, key_id_tlv->len);
+ memcpy(assrt_tlv->key_id, key_id_tlv->val, key_id_tlv->len);
- assrt_tlv->key_id_len = key_id_tlv->len;
+ assrt_tlv->key_id_len = key_id_tlv->len;
- _INFO("key_id len = [%d]", key_id_tlv->len);
+ _INFO("key_id len = [%d]", key_id_tlv->len);
- _free_tlv(key_id_tlv);
- }
+ _free_tlv(key_id_tlv);
+ }
- _INFO("Found TAG_KEYID");
- return assrt_tlv;
- }
- }
+ _INFO("Found TAG_KEYID");
+ return assrt_tlv;
+ }
+ }
- return NULL;
+ return NULL;
}
default:
SAFE_DELETE(data->data);
- }
+ }
SAFE_DELETE(data);
_INFO("");
_INFO("Freeing ext list");
g_list_free_full(data->ext_list, free);
_INFO("After Freeing ext list");
- }
+ }
SAFE_DELETE(data);
_INFO("");
{
_INFO("init_dbus");
#if !GLIB_CHECK_VERSION(2, 35, 0)
- g_type_init();
+ g_type_init();
#endif
GDBusConnection *connection = NULL;
_INFO("_create_json_response end");
return json;
- }
+ }
g_object_unref(gen);
_INFO("_create_json_response end");
return json;
- }
+ }
CATCH:
if (generator != NULL) {
if (!obj) {
_ERR("json_node_get_object() failed");
return;
- }
+ }
ui_data_s *ui_data = (ui_data_s *) calloc(1, sizeof(ui_data_s));
if (!ui_data) {
__free_ui_data(ui_data);
return;
- }
+ }
const char *auth_idx = NULL;
auth_idx = json_object_get_string_member(obj, UI_DATA_AUTH_INDEX);
static void
__soup_cb(SoupSession *session, SoupMessage *msg, gpointer user_data)
{
- _INFO("__soup_cb");
+ _INFO("__soup_cb");
- if (user_data == NULL)
- return;
+ if (user_data == NULL)
+ return;
- _app_id_cb_data_t *cb_data = (_app_id_cb_data_t*)user_data;
+ _app_id_cb_data_t *cb_data = (_app_id_cb_data_t*)user_data;
- GList *app_id_list = NULL;
- char *real_app_id = NULL;
+ GList *app_id_list = NULL;
+ char *real_app_id = NULL;
- int error_code = FIDO_ERROR_UNTRUSTED_FACET_ID;
+ int error_code = FIDO_ERROR_UNTRUSTED_FACET_ID;
- SoupBuffer *request = NULL;
+ SoupBuffer *request = NULL;
- _INFO("status_code = [%d]", msg->status_code);
+ _INFO("status_code = [%d]", msg->status_code);
CATCH_IF_FAIL_X(msg->status_code == SOUP_STATUS_OK, error_code = FIDO_ERROR_UNTRUSTED_FACET_ID);
//g_variant_unref (_ret);
-CATCH:
+CATCH :
return asm_res_json;
}
ret = cynara_check(__cynara, client, session, user, privilege);
switch (ret) {
- case CYNARA_API_ACCESS_ALLOWED:
- _DBG("cynara_check success");
- return FIDO_ERROR_NONE;
-
- case CYNARA_API_ACCESS_DENIED:
- _ERR("cynara_check permission deined, privilege=%s, error = CYNARA_API_ACCESS_DENIED", privilege);
- return FIDO_ERROR_PERMISSION_DENIED;
-
- default:
- cynara_strerror(ret, err_buf, sizeof(err_buf));
- _ERR("cynara_check error : %s, privilege=%s, ret = %d", err_buf, privilege, ret);
- return FIDO_ERROR_PERMISSION_DENIED;
+ case CYNARA_API_ACCESS_ALLOWED:
+ _DBG("cynara_check success");
+ return FIDO_ERROR_NONE;
+
+ case CYNARA_API_ACCESS_DENIED:
+ _ERR("cynara_check permission deined, privilege=%s, error = CYNARA_API_ACCESS_DENIED", privilege);
+ return FIDO_ERROR_PERMISSION_DENIED;
+
+ default:
+ cynara_strerror(ret, err_buf, sizeof(err_buf));
+ _ERR("cynara_check error : %s, privilege=%s, ret = %d", err_buf, privilege, ret);
+ return FIDO_ERROR_PERMISSION_DENIED;
}
return FIDO_ERROR_NONE;
snprintf(buf, sizeof(buf), "/proc/%d/cmdline", upid);
ret = __read_proc(buf, buf, sizeof(buf));
if (ret <= 0) {
- _ERR("No proc directory (%d)\n", upid);
- return NULL;
- }
+ _ERR("No proc directory (%d)\n", upid);
+ return NULL;
+ }
_INFO("Caller=[%s]", buf);
G_CALLBACK(_dbus_on_fido_discover), NULL);
g_signal_connect(fido_dbus_obj, "handle_fido_uaf_check_policy",
- G_CALLBACK(_dbus_on_fido_uaf_is_supported), NULL);
+ G_CALLBACK(_dbus_on_fido_uaf_is_supported), NULL);
g_signal_connect(fido_dbus_obj, "handle_fido_uaf_process_operation",
G_CALLBACK(_dbus_on_fido_process_operation), NULL);
&&
((match_criteria->user_verification & _USER_VER_METHOD_ALL) == 0)
&&
- ((auth_info->user_verification & match_criteria->user_verification) != 0)))
- {
+ ((auth_info->user_verification & match_criteria->user_verification) != 0))) {
_INFO("User verification match passed");
} else {
_ERR("User verification match failed");
switch (ver_method) {
- case _USER_VER_METHOD_PRESENCE:
- snprintf(ver_str, 127, "%s", "Presence Authenticator");
- break;
+ case _USER_VER_METHOD_PRESENCE:
+ snprintf(ver_str, 127, "%s", "Presence Authenticator");
+ break;
- case _USER_VER_METHOD_FINGERPRINT:
- snprintf(ver_str, 127, "%s", "Fingerprint Authenticator");
- break;
+ case _USER_VER_METHOD_FINGERPRINT:
+ snprintf(ver_str, 127, "%s", "Fingerprint Authenticator");
+ break;
- case _USER_VER_METHOD_PASSCODE:
- snprintf(ver_str, 127, "%s", "Passcode Authenticator");
- break;
+ case _USER_VER_METHOD_PASSCODE:
+ snprintf(ver_str, 127, "%s", "Passcode Authenticator");
+ break;
- case _USER_VER_METHOD_VOICE_PRINT:
- snprintf(ver_str, 127, "%s", "Voice Print Authenticator");
- break;
+ case _USER_VER_METHOD_VOICE_PRINT:
+ snprintf(ver_str, 127, "%s", "Voice Print Authenticator");
+ break;
- case _USER_VER_METHOD_FACE_PRINT:
- snprintf(ver_str, 127, "%s", "Face Print Authenticator");
- break;
+ case _USER_VER_METHOD_FACE_PRINT:
+ snprintf(ver_str, 127, "%s", "Face Print Authenticator");
+ break;
- case _USER_VER_METHOD_LOCATION:
- snprintf(ver_str, 127, "%s", "Location Authenticator");
- break;
+ case _USER_VER_METHOD_LOCATION:
+ snprintf(ver_str, 127, "%s", "Location Authenticator");
+ break;
- case _USER_VER_METHOD_EYE_PRINT:
- snprintf(ver_str, 127, "%s", "Eye Print Authenticator");
- break;
+ case _USER_VER_METHOD_EYE_PRINT:
+ snprintf(ver_str, 127, "%s", "Eye Print Authenticator");
+ break;
- case _USER_VER_METHOD_PATTERN:
- snprintf(ver_str, 127, "%s", "Pattern Authenticator");
- break;
+ case _USER_VER_METHOD_PATTERN:
+ snprintf(ver_str, 127, "%s", "Pattern Authenticator");
+ break;
- case _USER_VER_METHOD_HAND_PRINT:
- snprintf(ver_str, 127, "%s", "Hand Print Authenticator");
- break;
+ case _USER_VER_METHOD_HAND_PRINT:
+ snprintf(ver_str, 127, "%s", "Hand Print Authenticator");
+ break;
- // case _USER_VER_METHOD_NONE:
- // snprintf(ver_str, "%s", "");
- // break;
+// case _USER_VER_METHOD_NONE:
+// snprintf(ver_str, "%s", "");
+// break;
- case _USER_VER_METHOD_ALL:
- snprintf(ver_str, 127, "%s", "All Authenticator");
- break;
+ case _USER_VER_METHOD_ALL:
+ snprintf(ver_str, 127, "%s", "All Authenticator");
+ break;
- default:
- snprintf(ver_str, 127, "%s", "Other Type");
- break;
+ default:
+ snprintf(ver_str, 127, "%s", "Other Type");
+ break;
}
return ver_str;
static char*
__read(const char *file_name)
{
- FILE *file = fopen(file_name, "rb");
- if (file == NULL)
- return NULL;
-
- fseek(file, 0, SEEK_END);
- long size = ftell(file);
- if (size <= 0) {
- fclose(file);
- return NULL;
- }
+ FILE *file = fopen(file_name, "rb");
+ if (file == NULL)
+ return NULL;
+
+ fseek(file, 0, SEEK_END);
+ long size = ftell(file);
+ if (size <= 0) {
+ fclose(file);
+ return NULL;
+ }
- fseek(file, 0, SEEK_SET);
+ fseek(file, 0, SEEK_SET);
- char *json = calloc(1, size + 1);
- int num_bytes = fread(json, size, 1, file);
- if (num_bytes <= 0) {
- free(json);
- fclose(file);
- return NULL;
- }
+ char *json = calloc(1, size + 1);
+ int num_bytes = fread(json, size, 1, file);
+ if (num_bytes <= 0) {
+ free(json);
+ fclose(file);
+ return NULL;
+ }
- json[size] = 0;
+ json[size] = 0;
- fclose(file);
+ fclose(file);
- return json;
+ return json;
}
int ret = fido_discovery_data_foreach_authenticator(discovery_data, auth_list_cb, ad);
dlog_print(DLOG_INFO, "org.tizen.Fidosample", "fido_discovery_data_foreach_authenticator =[%d]", ret);
- fido_discovery_data_destroy(discovery_data);
+ fido_discovery_data_destroy(discovery_data);
}
static void
dlog_print(DLOG_INFO, "org.tizen.Fidosample", "uaf response = %s", uaf_response);
int ret = fido_request_set_result(FIDO_SERVER_STATUS_CODE_OK, uaf_response);
- dlog_print(DLOG_INFO, "org.tizen.Fidosample", "fido_request_set_result =[%d]", ret);
+ dlog_print(DLOG_INFO, "org.tizen.Fidosample", "fido_request_set_result =[%d]", ret);
char *error_string = get_error_code(tizen_error_code);
create_popup(error_string, (appdata_s *) user_data);
dlog_print(DLOG_INFO, "org.tizen.Fidosample", "uaf response = %s", uaf_response);
int ret = fido_request_set_result(0, uaf_response);
- dlog_print(DLOG_INFO, "org.tizen.Fidosample", "fido_request_set_result =[%d]", ret);
+ dlog_print(DLOG_INFO, "org.tizen.Fidosample", "fido_request_set_result =[%d]", ret);
char *error_string = get_error_code(tizen_error_code);
create_popup(error_string, (appdata_s *) user_data);
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);
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);
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);
get_user_choice();
g_main_loop_run(mainloop);
-
+
return 0;
}
#include <dlog.h>
void
- print_fail_result(
+print_fail_result(
const char *action_name,
int action_return_value)
{