if (bmem)
BIO_free_all(bmem);
+ SAFE_DELETE(base64);
+
_INFO("_fido_b64url_decode end");
return 0;
json_builder_add_string_value(header_root, uaf_res->header->app_id);
json_builder_set_member_name(header_root, _JSON_KEY_OP);
- json_builder_add_string_value(header_root, strdup(_UAF_OPERATION_NAME_KEY_DE_REG));
+ json_builder_add_string_value(header_root, _UAF_OPERATION_NAME_KEY_DE_REG);
json_builder_set_member_name(header_root, _JSON_KEY_SERVER_DATA);
json_builder_add_string_value(header_root, uaf_res->header->server_data);
json_builder_add_string_value(obj, (char *)key_id_enc);
_INFO("keyid=[%s]", key_id_enc);
}
-
+ SAFE_DELETE(key_id_enc);
}
_INFO("after assertions");
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);
- RET_IF_FAIL(r == 0, NULL);
+
+ if (r !=0) {
+ SAFE_DELETE(tlv_dec);
+ return NULL;
+ }
_INFO("in len = [%d], decoded len = [%d]", in_len, tlv_dec_len);
cb_data->user_data = user_data;
/*Case 1: UAF JSON does not have appID, so no check is required, put facetid*/
- if (uaf_app_id == NULL) {
+ if ((uaf_app_id == NULL) || (!strcmp(uaf_app_id, ""))) {
_DBG("UAF msg does not have appID");
cb_data->real_app_id = __get_tz_facet_id_of_caller(app_id, invocation);
g_timeout_add(2, __timer_expired, cb_data);
}
return FIDO_ERROR_NONE;
-#endif
-
+#else
return FIDO_ERROR_NONE;
+#endif
}
static int
match_data->auth_index = selected_auth_data->auth_index;
match_data->asm_id = strdup(selected_auth_data->asm_id);
- if (cb_data->type == _PROCESS_TYPE_REG)
+ if ((cb_data != NULL) && (cb_data->type == _PROCESS_TYPE_REG))
__handle_reg(cb_data, match_data);
- if (cb_data->type == _PROCESS_TYPE_AUTH)
+ if ((cb_data != NULL) && (cb_data->type == _PROCESS_TYPE_AUTH))
__handle_auth(cb_data, match_data);
_free_matched_auth_data(match_data);
}
} else {
GList *allowed_auth_list_iter = allowed_auth_list;
- _matched_auth_data_t *match_data = (_matched_auth_data_t *)(allowed_auth_list_iter->data);
-
- if (cb_data->type == _PROCESS_TYPE_REG)
- __handle_reg(cb_data, match_data);
+ if (allowed_auth_list_iter != NULL) {
+ _matched_auth_data_t *match_data = (_matched_auth_data_t *)(allowed_auth_list_iter->data);
- else if (cb_data->type == _PROCESS_TYPE_AUTH)
- __handle_auth(cb_data, match_data);
+ if ((cb_data != NULL) && (cb_data->type == _PROCESS_TYPE_REG))
+ __handle_reg(cb_data, match_data);
+ if ((cb_data != NULL) && (cb_data->type == _PROCESS_TYPE_AUTH))
+ __handle_auth(cb_data, match_data);
+ }
}
if (allowed_auth_list != NULL)
g_list_free_full(allowed_auth_list, _free_matched_auth_data);