Mercurial > hg > nginx
comparison 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 |
comparison
equal
deleted
inserted
replaced
8393:e169cce912c7 | 8394:df18ae7161b8 |
---|---|
912 | 912 |
913 ad.data = res->data; | 913 ad.data = res->data; |
914 ad.len = ngx_quic_create_retry_itag(pkt, ad.data, &start); | 914 ad.len = ngx_quic_create_retry_itag(pkt, ad.data, &start); |
915 | 915 |
916 itag.data = ad.data + ad.len; | 916 itag.data = ad.data + ad.len; |
917 itag.len = EVP_GCM_TLS_TAG_LEN; | |
917 | 918 |
918 #ifdef NGX_QUIC_DEBUG_CRYPTO | 919 #ifdef NGX_QUIC_DEBUG_CRYPTO |
919 ngx_quic_hexdump(pkt->log, "quic retry itag", ad.data, ad.len); | 920 ngx_quic_hexdump(pkt->log, "quic retry itag", ad.data, ad.len); |
920 #endif | 921 #endif |
921 | 922 |
958 } | 959 } |
959 | 960 |
960 *pos = p; | 961 *pos = p; |
961 | 962 |
962 expected_pn = *largest_pn + 1; | 963 expected_pn = *largest_pn + 1; |
963 pn_win = 1 << pn_nbits; | 964 pn_win = 1ULL << pn_nbits; |
964 pn_hwin = pn_win / 2; | 965 pn_hwin = pn_win / 2; |
965 pn_mask = pn_win - 1; | 966 pn_mask = pn_win - 1; |
966 | 967 |
967 candidate_pn = (expected_pn & ~pn_mask) | truncated_pn; | 968 candidate_pn = (expected_pn & ~pn_mask) | truncated_pn; |
968 | 969 |