diff src/event/ngx_event_quic_protection.c @ 8394:df18ae7161b8 quic

Assorted fixes. Found by Clang Static Analyzer.
author Sergey Kandaurov <pluknet@nginx.com>
date Wed, 20 May 2020 15:36:24 +0300
parents 81f85c479d7e
children 125cbfa77013
line wrap: on
line diff
--- a/src/event/ngx_event_quic_protection.c
+++ b/src/event/ngx_event_quic_protection.c
@@ -914,6 +914,7 @@ ngx_quic_create_retry_packet(ngx_quic_he
     ad.len = ngx_quic_create_retry_itag(pkt, ad.data, &start);
 
     itag.data = ad.data + ad.len;
+    itag.len = EVP_GCM_TLS_TAG_LEN;
 
 #ifdef NGX_QUIC_DEBUG_CRYPTO
     ngx_quic_hexdump(pkt->log, "quic retry itag", ad.data, ad.len);
@@ -960,7 +961,7 @@ ngx_quic_parse_pn(u_char **pos, ngx_int_
     *pos = p;
 
     expected_pn = *largest_pn + 1;
-    pn_win = 1 << pn_nbits;
+    pn_win = 1ULL << pn_nbits;
     pn_hwin = pn_win / 2;
     pn_mask = pn_win - 1;