security svace fix additional 40/126940/1 accepted/tizen/3.0/common/20170510.183002 accepted/tizen/3.0/ivi/20170509.223140 accepted/tizen/3.0/mobile/20170509.223133 accepted/tizen/3.0/wearable/20170509.223135 submit/tizen_3.0-common/20170510.074450 submit/tizen_3.0/20170427.111036 submit/tizen_3.0_common/20170510.075013
authorjkjo92 <jkjo92@samsung.com>
Tue, 25 Apr 2017 10:04:52 +0000 (19:04 +0900)
committerjkjo92 <jkjo92@samsung.com>
Tue, 25 Apr 2017 10:04:52 +0000 (19:04 +0900)
Change-Id: I1f9c2c27099f09f91ec029c21c3459cececda319
Signed-off-by: jkjo92 <jkjo92@samsung.com>
server/fido_server.c

index 6644317..73c9c80 100755 (executable)
@@ -594,8 +594,6 @@ __handle_auth(_process_cb_data_t *cb_data, _matched_auth_data_t *matched_auth)
 
        _fido_asm_auth_in_t *auth_asm_in = (_fido_asm_auth_in_t*)calloc(1, sizeof(_fido_asm_auth_in_t));
 
-       _fido_asm_reg_in_t *reg_in = (_fido_asm_reg_in_t*) calloc(1, sizeof(_fido_asm_reg_in_t));
-
        if (cb_data->uaf_req->header->app_id == NULL) {
 
                if (cb_data->uaf_req->facet_id == NULL) {
@@ -646,27 +644,27 @@ __handle_auth(_process_cb_data_t *cb_data, _matched_auth_data_t *matched_auth)
        if (end == matched_auth->auth_index) {
                _ERR("Failed to compose final challenge");
                _send_process_response(cb_data, FIDO_ERROR_PROTOCOL_ERROR, NULL);
-               _free_fido_asm_reg_in(reg_in);
+               SAFE_DELETE(version);
                return;
        } else if ('\0' != *end) {
                _ERR("Failed to compose final challenge");
                _send_process_response(cb_data, FIDO_ERROR_PROTOCOL_ERROR, NULL);
-               _free_fido_asm_reg_in(reg_in);
+               SAFE_DELETE(version);
                return;
        } else if ((LONG_MIN == sl || LONG_MAX == sl) && ERANGE == errno) {
                _ERR("Failed to compose final challenge");
                _send_process_response(cb_data, FIDO_ERROR_PROTOCOL_ERROR, NULL);
-               _free_fido_asm_reg_in(reg_in);
+               SAFE_DELETE(version);
                return;
        } else if (sl > INT_MAX) {
                _ERR("Failed to compose final challenge");
                _send_process_response(cb_data, FIDO_ERROR_PROTOCOL_ERROR, NULL);
-               _free_fido_asm_reg_in(reg_in);
+               SAFE_DELETE(version);
                return;
        } else if (sl < INT_MIN) {
                _ERR("Failed to compose final challenge");
                _send_process_response(cb_data, FIDO_ERROR_PROTOCOL_ERROR, NULL);
-               _free_fido_asm_reg_in(reg_in);
+               SAFE_DELETE(version);
                return;
        } else {
                auth_idx_int = (int)sl;
@@ -779,8 +777,6 @@ __process_dereg_queue(_dereg_q_t *dereg_q)
 
        _matched_auth_dereg_t *dereg_data = (_matched_auth_dereg_t*)(g_queue_pop_head(q));
 
-       _fido_asm_reg_in_t *reg_in = (_fido_asm_reg_in_t*) calloc(1, sizeof(_fido_asm_reg_in_t));
-
        char *asm_req_json = NULL;
 
        int auth_index_int = _INVALID_INT;
@@ -791,27 +787,22 @@ __process_dereg_queue(_dereg_q_t *dereg_q)
        if (end == dereg_data->auth_index) {
                _ERR("Failed to compose final challenge");
                _send_process_response(cb_data, FIDO_ERROR_PROTOCOL_ERROR, NULL);
-               _free_fido_asm_reg_in(reg_in);
                return;
        } else if ('\0' != *end) {
                _ERR("Failed to compose final challenge");
                _send_process_response(cb_data, FIDO_ERROR_PROTOCOL_ERROR, NULL);
-               _free_fido_asm_reg_in(reg_in);
                return;
        } else if ((LONG_MIN == sl || LONG_MAX == sl) && ERANGE == errno) {
                _ERR("Failed to compose final challenge");
                _send_process_response(cb_data, FIDO_ERROR_PROTOCOL_ERROR, NULL);
-               _free_fido_asm_reg_in(reg_in);
                return;
        } else if (sl > INT_MAX) {
                _ERR("Failed to compose final challenge");
                _send_process_response(cb_data, FIDO_ERROR_PROTOCOL_ERROR, NULL);
-               _free_fido_asm_reg_in(reg_in);
                return;
        } else if (sl < INT_MIN) {
                _ERR("Failed to compose final challenge");
                _send_process_response(cb_data, FIDO_ERROR_PROTOCOL_ERROR, NULL);
-               _free_fido_asm_reg_in(reg_in);
                return;
        } else {
                auth_index_int = (int)sl;