Skip to content

Commit

Permalink
mesa: don't send auth response for single-fragment message
Browse files Browse the repository at this point in the history
  • Loading branch information
yosoyubik committed Sep 11, 2024
1 parent 765d170 commit 0d8eb8b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pkg/vere/io/mesa.c
Original file line number Diff line number Diff line change
Expand Up @@ -1918,10 +1918,10 @@ _mesa_send_leaf(u3_mesa* sam_u,

lss_pair* pair = ((lss_pair*)lin_u->haz_y) + i_d;

if ( 0 == memcmp(pair, &(lss_pair){0}, sizeof(lss_pair)) ) {
dat_u->aut_u.typ_e = AUTH_NONE;
} else if ( 0 == nam_u->fra_d ) {
if ( 0 == nam_u->fra_d ) { // XX
_mesa_copy_auth_data(&dat_u->aut_u, &lin_u->aut_u);
} else if ( 0 == memcmp(pair, &(lss_pair){0}, sizeof(lss_pair)) ) {
dat_u->aut_u.typ_e = AUTH_NONE;
}else {
dat_u->aut_u.typ_e = AUTH_PAIR;
memcpy(dat_u->aut_u.has_y, pair, sizeof(lss_pair));
Expand Down Expand Up @@ -1978,9 +1978,10 @@ _mesa_send_jumbo_pieces(u3_mesa* sam_u, u3_mesa_line* lin_u, c3_d* fra_u)
nam_u->nit_o = c3y;
u3_weak pin = _mesa_get_pit(sam_u, nam_u);
if ( u3_none != pin ) {
// XX lss_proof_size always returns >= 1
// if the initial Merkle proof is nonzero, this is a multifragment
// message; send auth response to the %init request
if ( pro_w > 0 ) {
if ( pro_w > 1 ) {
dat_u->len_w = pro_w * sizeof(lss_hash);
c3_y* pro_y = c3_malloc(dat_u->len_w);
memcpy(pro_y, lin_u->tip_y, dat_u->len_w);
Expand Down

0 comments on commit 0d8eb8b

Please sign in to comment.