comparison src/event/ngx_event_quic_protection.c @ 7717:c217a907ce42 quic

Added checks for permitted frame types. + cleanup in macros for packet types + some style fixes in quic_transport.h (case, indentation)
author Vladimir Homutov <vl@nginx.com>
date Fri, 20 Mar 2020 20:03:44 +0300
parents ae35ccba7aa6
children d45325e90221
comparison
equal deleted inserted replaced
7716:8f9cb6d66662 7717:c217a907ce42
902 902
903 if (ngx_quic_tls_hp(log, ciphers.hp, pkt->secret, mask, sample) != NGX_OK) { 903 if (ngx_quic_tls_hp(log, ciphers.hp, pkt->secret, mask, sample) != NGX_OK) {
904 return NGX_ERROR; 904 return NGX_ERROR;
905 } 905 }
906 906
907 if (pkt->flags & NGX_QUIC_PKT_LONG) { 907 if (ngx_quic_long_pkt(pkt->flags)) {
908 clearflags = pkt->flags ^ (mask[0] & 0x0f); 908 clearflags = pkt->flags ^ (mask[0] & 0x0f);
909 909
910 } else { 910 } else {
911 clearflags = pkt->flags ^ (mask[0] & 0x1f); 911 clearflags = pkt->flags ^ (mask[0] & 0x1f);
912 } 912 }
924 924
925 /* packet protection */ 925 /* packet protection */
926 926
927 in.data = p; 927 in.data = p;
928 928
929 if (pkt->flags & NGX_QUIC_PKT_LONG) { 929 if (ngx_quic_long_pkt(pkt->flags)) {
930 in.len = pkt->len - pnl; 930 in.len = pkt->len - pnl;
931 931
932 } else { 932 } else {
933 in.len = pkt->data + pkt->len - p; 933 in.len = pkt->data + pkt->len - p;
934 } 934 }