"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/liblsquic/lsquic_hspack_valid.c" between
lsquic-2.22.1.tar.gz and lsquic-2.23.1.tar.gz

About: LSQUIC is LiteSpeed’s QUIC and HTTP/3 Library. A hint: HTTP/3 uses QUIC as the underlying transport protocol instead of TCP.

lsquic_hspack_valid.c  (lsquic-2.22.1):lsquic_hspack_valid.c  (lsquic-2.23.1)
skipping to change at line 86 skipping to change at line 86
return 0; return 0;
} }
memcpy(tag, buf + 1 + 8, sizeof(*tag)); memcpy(tag, buf + 1 + 8, sizeof(*tag));
return 1; return 1;
} }
int int
lsquic_is_valid_hs_packet (struct lsquic_engine *engine, lsquic_is_valid_hs_packet (struct lsquic_engine *engine,
const unsigned char *buf, size_t bufsz, size_t packet_in_sz) const unsigned char *buf, size_t bufsz)
{ {
lsquic_ver_tag_t tag; lsquic_ver_tag_t tag;
int is_valid; int is_valid;
if (bufsz < 1) if (bufsz < 1)
return 0; return 0;
switch (buf[0] & 0xF8) switch (buf[0] & 0xF8)
{ {
/* Xs vary, Gs are iGnored: */ /* Xs vary, Gs are iGnored: */
/* 1X11 XGGG: Q046 long header */ /* 1X11 XGGG: Q046 long header */
case 0x80|0x40|0x20|0x10|0x08: case 0x80|0x40|0x20|0x10|0x08:
case 0x80|0x00|0x20|0x10|0x08: case 0x80|0x00|0x20|0x10|0x08:
case 0x80|0x40|0x20|0x10|0x00: case 0x80|0x40|0x20|0x10|0x00:
case 0x80|0x00|0x20|0x10|0x00: case 0x80|0x00|0x20|0x10|0x00:
is_valid = packet_in_sz >= IQUIC_MIN_INIT_PACKET_SZ is_valid = bufsz >= IQUIC_MIN_INIT_PACKET_SZ
&& lsquic_is_valid_iquic_hs_packet(buf, bufsz, &tag); && lsquic_is_valid_iquic_hs_packet(buf, bufsz, &tag);
break; break;
/* 1X00 XGGG: ID-22 long header */ /* 1X00 XGGG: ID-22 long header */
case 0x80|0x40|0x00|0x00|0x08: case 0x80|0x40|0x00|0x00|0x08:
case 0x80|0x00|0x00|0x00|0x08: case 0x80|0x00|0x00|0x00|0x08:
case 0x80|0x40|0x00|0x00|0x00: case 0x80|0x40|0x00|0x00|0x00:
case 0x80|0x00|0x00|0x00|0x00: case 0x80|0x00|0x00|0x00|0x00:
/* 1X01 XGGG: ID-22 long header */ /* 1X01 XGGG: ID-22 long header */
case 0x80|0x40|0x00|0x10|0x08: case 0x80|0x40|0x00|0x10|0x08:
case 0x80|0x00|0x00|0x10|0x08: case 0x80|0x00|0x00|0x10|0x08:
case 0x80|0x40|0x00|0x10|0x00: case 0x80|0x40|0x00|0x10|0x00:
case 0x80|0x00|0x00|0x10|0x00: case 0x80|0x00|0x00|0x10|0x00:
/* 1X10 XGGG: ID-22 long header */ /* 1X10 XGGG: ID-22 long header */
case 0x80|0x40|0x20|0x00|0x08: case 0x80|0x40|0x20|0x00|0x08:
case 0x80|0x00|0x20|0x00|0x08: case 0x80|0x00|0x20|0x00|0x08:
case 0x80|0x40|0x20|0x00|0x00: case 0x80|0x40|0x20|0x00|0x00:
case 0x80|0x00|0x20|0x00|0x00: case 0x80|0x00|0x20|0x00|0x00:
is_valid = packet_in_sz >= IQUIC_MIN_INIT_PACKET_SZ is_valid = bufsz >= IQUIC_MIN_INIT_PACKET_SZ
&& lsquic_is_valid_ietf_v1_or_Q046plus_hs_packet(buf, bufsz, &tag); && lsquic_is_valid_ietf_v1_or_Q046plus_hs_packet(buf, bufsz, &tag);
break; break;
/* 01XX XGGG: ID-22 short header */ /* 01XX XGGG: ID-22 short header */
case 0x00|0x40|0x00|0x00|0x00: case 0x00|0x40|0x00|0x00|0x00:
case 0x00|0x40|0x00|0x00|0x08: case 0x00|0x40|0x00|0x00|0x08:
case 0x00|0x40|0x00|0x10|0x00: case 0x00|0x40|0x00|0x10|0x00:
case 0x00|0x40|0x00|0x10|0x08: case 0x00|0x40|0x00|0x10|0x08:
case 0x00|0x40|0x20|0x00|0x00: case 0x00|0x40|0x20|0x00|0x00:
case 0x00|0x40|0x20|0x00|0x08: case 0x00|0x40|0x20|0x00|0x08:
case 0x00|0x40|0x20|0x10|0x00: case 0x00|0x40|0x20|0x10|0x00:
 End of changes. 3 change blocks. 
3 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)