Skip to content
Snippets Groups Projects
Commit 70f8db62 authored by Roman Khlopkov's avatar Roman Khlopkov 🔜
Browse files

Merge branch 'hotfix-12492' into 'release-5.3'

Leaks fixed

See merge request !323
parents 8f8f048e a4955dc4
No related branches found
No related tags found
1 merge request!323Leaks fixed
Pipeline #42272 passed with stage
in 12 minutes and 31 seconds
......@@ -331,6 +331,7 @@ static void s_queue_es_io_callback( dap_events_socket_t * a_es, void * a_arg)
dap_events_socket_t *l_msg_es = dap_context_find(l_context, l_msg->esocket_uuid);
if ( l_msg_es == NULL){
log_it(L_INFO, "We got i/o message for esocket %"DAP_UINT64_FORMAT_U" thats now not in list. Lost %zu data", l_msg->esocket_uuid, l_msg->data_size);
DAP_DELETE(l_msg->data);
DAP_DELETE(l_msg);
return;
}
......
......@@ -109,7 +109,6 @@ void enc_http_proc(struct dap_http_simple *cl_st, void * arg)
size_t l_block_key_size=32;
int l_protocol_version = 0;
size_t l_sign_count = 0;
char *encrypt_msg = NULL, *encrypt_id = NULL;
sscanf(cl_st->http_client->in_query_string, "enc_type=%d,pkey_exchange_type=%d,pkey_exchange_size=%zu,block_key_size=%zu,protocol_version=%d,sign_count=%zu",
&l_enc_block_type,&l_pkey_exchange_type,&l_pkey_exchange_size,&l_block_key_size, &l_protocol_version, &l_sign_count);
......@@ -175,15 +174,8 @@ void enc_http_proc(struct dap_http_simple *cl_st, void * arg)
log_it(L_DEBUG, "Callback for ACL is not set, pass anauthorized");
}
if (
!(encrypt_msg = DAP_NEW_Z_SIZE(char, DAP_ENC_BASE64_ENCODE_SIZE(l_pkey_exchange_key->pub_key_data_size) + 1)) ||
!(encrypt_id = DAP_NEW_Z_SIZE(char, DAP_ENC_BASE64_ENCODE_SIZE(DAP_ENC_KS_KEY_ID_SIZE) + 1))
) {
log_it(L_CRITICAL, "%s", c_error_memory_alloc);
dap_enc_key_delete(l_pkey_exchange_key);
*return_code = Http_Status_InternalServerError;
return;
}
char *encrypt_msg = DAP_NEW_Z_SIZE(char, DAP_ENC_BASE64_ENCODE_SIZE(l_pkey_exchange_key->pub_key_data_size) + 1),
*encrypt_id = DAP_NEW_STACK_SIZE(char, DAP_ENC_BASE64_ENCODE_SIZE(DAP_ENC_KS_KEY_ID_SIZE) + 1);
dap_enc_base64_encode(l_pkey_exchange_key->pub_key_data, l_pkey_exchange_key->pub_key_data_size, encrypt_msg, DAP_ENC_DATA_TYPE_B64);
l_enc_key_ks->key = dap_enc_key_new_generate(l_enc_block_type,
......@@ -203,6 +195,7 @@ void enc_http_proc(struct dap_http_simple *cl_st, void * arg)
dap_sign_t *l_node_sign = dap_sign_create(l_node_cert->enc_key,l_pkey_exchange_key->pub_key_data, l_pkey_exchange_key->pub_key_data_size, 0);
if (!l_node_sign) {
dap_enc_key_delete(l_pkey_exchange_key);
DAP_DELETE(encrypt_msg);
*return_code = Http_Status_InternalServerError;
return;
}
......@@ -214,6 +207,7 @@ void enc_http_proc(struct dap_http_simple *cl_st, void * arg)
log_it(L_CRITICAL, "%s", c_error_memory_alloc);
dap_enc_key_delete(l_pkey_exchange_key);
*return_code = Http_Status_InternalServerError;
DAP_DELETE(encrypt_msg);
DAP_DELETE(l_node_sign);
return;
}
......@@ -222,7 +216,7 @@ void enc_http_proc(struct dap_http_simple *cl_st, void * arg)
}
_enc_http_write_reply(cl_st, encrypt_id, encrypt_msg, l_node_sign_msg);
DAP_DELETE(encrypt_msg);
dap_enc_key_delete(l_pkey_exchange_key);
DAP_DEL_Z(l_node_sign_msg);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment