The removal of QUIC packet protection depends on the largest packet number
received. When a garbage packet was received, the decoder still updated the
largest packet number from that packet. This could affect removing protection
from subsequent QUIC packets.
{
u_char clearflags, *p, *sample;
uint8_t badflags;
- uint64_t pn;
+ uint64_t pn, lpn;
ngx_int_t pnl, rc, key_phase;
ngx_str_t in, ad;
ngx_quic_secret_t *secret;
}
}
+ lpn = *largest_pn;
+
pnl = (clearflags & 0x03) + 1;
- pn = ngx_quic_parse_pn(&p, pnl, &mask[1], largest_pn);
+ pn = ngx_quic_parse_pn(&p, pnl, &mask[1], &lpn);
pkt->pn = pn;
pkt->flags = clearflags;
return NGX_ERROR;
}
+ *largest_pn = lpn;
+
return NGX_OK;
}