comparison src/event/ngx_event_quic.c @ 8218:33feac1e57ac quic

Fixed header protection application with pn length > 1.
author Sergey Kandaurov <pluknet@nginx.com>
date Sat, 14 Mar 2020 03:15:09 +0300
parents a5a1b3fad834
children 7ada2feeac18
comparison
equal deleted inserted replaced
8217:a5a1b3fad834 8218:33feac1e57ac
1635 return NGX_ERROR; 1635 return NGX_ERROR;
1636 } 1636 }
1637 1637
1638 ngx_memcpy(ad.data, pkt->data, ad.len); 1638 ngx_memcpy(ad.data, pkt->data, ad.len);
1639 ad.data[0] = clearflags; 1639 ad.data[0] = clearflags;
1640 ad.data[ad.len - pnl] = (u_char) pn; 1640
1641 do {
1642 ad.data[ad.len - pnl] = pn >> (8 * (pnl - 1)) % 256;
1643 } while (--pnl);
1641 1644
1642 nonce = ngx_pstrdup(c->pool, &pkt->secret->iv); 1645 nonce = ngx_pstrdup(c->pool, &pkt->secret->iv);
1643 nonce[11] ^= pn; 1646 nonce[11] ^= pn;
1644 1647
1645 ngx_quic_hexdump0(c->log, "nonce", nonce, 12); 1648 ngx_quic_hexdump0(c->log, "nonce", nonce, 12);