diff options
author | Sergey Kandaurov <pluknet@nginx.com> | 2020-03-14 03:15:09 +0300 |
---|---|---|
committer | Sergey Kandaurov <pluknet@nginx.com> | 2020-03-14 03:15:09 +0300 |
commit | 1ac31c01b4a2df79a512a7b6bde67002b3e5259e (patch) | |
tree | 49f0eedf773fa9c44dfb74dfad296a3b28cc76d1 /src | |
parent | 11dfc1c9439a79881c2d2e73ab1e2c5c71f88499 (diff) | |
download | nginx-1ac31c01b4a2df79a512a7b6bde67002b3e5259e.tar.gz nginx-1ac31c01b4a2df79a512a7b6bde67002b3e5259e.zip |
Fixed header protection application with pn length > 1.
Diffstat (limited to 'src')
-rw-r--r-- | src/event/ngx_event_quic.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/event/ngx_event_quic.c b/src/event/ngx_event_quic.c index 7819e3f51..199284162 100644 --- a/src/event/ngx_event_quic.c +++ b/src/event/ngx_event_quic.c @@ -1637,7 +1637,10 @@ ngx_quic_decrypt(ngx_connection_t *c, ngx_quic_header_t *pkt) ngx_memcpy(ad.data, pkt->data, ad.len); ad.data[0] = clearflags; - ad.data[ad.len - pnl] = (u_char) pn; + + do { + ad.data[ad.len - pnl] = pn >> (8 * (pnl - 1)) % 256; + } while (--pnl); nonce = ngx_pstrdup(c->pool, &pkt->secret->iv); nonce[11] ^= pn; |