mirror of
https://github.com/nginx/nginx.git
synced 2025-01-06 22:23:00 -06:00
QUIC: fixed computation of nonce with packet numbers beyond 2^32.
Prodded by Yu Zhu.
This commit is contained in:
parent
7d73c50a2d
commit
d3294e61d5
@ -964,10 +964,14 @@ ngx_quic_parse_pn(u_char **pos, ngx_int_t len, u_char *mask,
|
||||
static void
|
||||
ngx_quic_compute_nonce(u_char *nonce, size_t len, uint64_t pn)
|
||||
{
|
||||
nonce[len - 4] ^= (pn & 0xff000000) >> 24;
|
||||
nonce[len - 3] ^= (pn & 0x00ff0000) >> 16;
|
||||
nonce[len - 2] ^= (pn & 0x0000ff00) >> 8;
|
||||
nonce[len - 1] ^= (pn & 0x000000ff);
|
||||
nonce[len - 8] ^= (pn >> 56) & 0x3f;
|
||||
nonce[len - 7] ^= (pn >> 48) & 0xff;
|
||||
nonce[len - 6] ^= (pn >> 40) & 0xff;
|
||||
nonce[len - 5] ^= (pn >> 32) & 0xff;
|
||||
nonce[len - 4] ^= (pn >> 24) & 0xff;
|
||||
nonce[len - 3] ^= (pn >> 16) & 0xff;
|
||||
nonce[len - 2] ^= (pn >> 8) & 0xff;
|
||||
nonce[len - 1] ^= pn & 0xff;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user