Skip to content
Snippets Groups Projects
Commit 6827b550 authored by Constantin P.'s avatar Constantin P. 💬
Browse files

Merge branch 'hotfix-ems-tsd' into 'master'

Hotfix ems tsd

See merge request !1196
parents 255e2907 71f9922f
No related branches found
No related tags found
1 merge request!1196Hotfix ems tsd
Pipeline #28637 passed with stage
in 16 minutes and 48 seconds
......@@ -428,21 +428,15 @@ byte_t *dap_chain_emission_get_tsd(dap_chain_datum_token_emission_t *a_emission,
if (!a_emission || a_emission->hdr.type != DAP_CHAIN_DATUM_TOKEN_EMISSION_TYPE_AUTH ||
a_emission->data.type_auth.tsd_total_size == 0)
return NULL;
dap_tsd_t *l_tsd = (dap_tsd_t *)a_emission->tsd_n_signs;
do {
if (a_emission->data.type_auth.tsd_total_size < l_tsd->size) {
log_it(L_ERROR, "Corrupt data in emission: invalid TSD size %lu < %u",
a_emission->data.type_auth.tsd_total_size, l_tsd->size);
return NULL;
}
if (l_tsd->type == a_type) {
if (a_size)
*a_size = l_tsd->size;
return l_tsd->data;
}
l_tsd = (dap_tsd_t *)((byte_t *)l_tsd + dap_tsd_size(l_tsd));
} while ((byte_t *)l_tsd < a_emission->tsd_n_signs + a_emission->data.type_auth.tsd_total_size);
return NULL;
dap_tsd_t *l_tsd = NULL;
if (!(l_tsd = dap_tsd_find(a_emission->tsd_n_signs, a_emission->data.type_auth.tsd_total_size, a_type))) {
log_it(L_ERROR, "TSD section of type %d not found", a_type);
return NULL;
} else {
if (a_size)
*a_size = l_tsd->size;
}
return l_tsd->data;
}
dap_chain_datum_token_emission_t *dap_chain_datum_emission_add_sign(dap_enc_key_t *a_sign_key, dap_chain_datum_token_emission_t *a_emission)
......
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