Compare commits

..

4 Commits

4 changed files with 10 additions and 14 deletions

View File

@ -1321,7 +1321,6 @@ static bool logical_net_filter_match_rate_limited(void)
static HANDLE windivert_init_filter(const char *filter, UINT64 flags)
{
LPSTR errormessage = NULL;
DWORD errorcode = 0;
HANDLE h, hMutex;
const char *mutex_name = "Global\\winws_windivert_mutex";

View File

@ -486,8 +486,8 @@ static uint8_t dpi_desync_tcp_packet_play(bool replay, size_t reasm_offset, uint
size_t pkt1_len = sizeof(pkt1), pkt2_len;
memset (pkt1, 0, pkt1_len);
uint8_t ttl_orig,ttl_fake = 0, flags_orig = 0,scale_factor = 0;
uint32_t *timestamps = NULL;
uint8_t ttl_orig,ttl_fake,flags_orig,scale_factor;
uint32_t *timestamps;
ttl_orig = ip ? ip->ip_ttl : ip6hdr->ip6_ctlun.ip6_un1.ip6_un1_hlim;
uint32_t desync_fwmark = fwmark | params.desync_fwmark;
@ -1237,13 +1237,10 @@ static uint8_t dpi_desync_udp_packet_play(bool replay, size_t reasm_offset, uint
uint32_t desync_fwmark = fwmark | params.desync_fwmark;
if (ip6hdr) {
ttl_orig = ip ? ip->ip_ttl : ip6hdr->ip6_ctlun.ip6_un1.ip6_un1_hlim;
ttl_fake = params.desync_ttl6 ? params.desync_ttl6 : ttl_orig;
} else {
ttl_orig = ip ? ip->ip_ttl : 0;
ttl_fake = params.desync_ttl ? params.desync_ttl : ttl_orig;
}
ttl_orig = ip ? ip->ip_ttl : (ip6hdr ? ip6hdr->ip6_ctlun.ip6_un1.ip6_un1_hlim : 0);
if (ip6hdr) ttl_fake = params.desync_ttl6 ? params.desync_ttl6 : ttl_orig;
else ttl_fake = params.desync_ttl ? params.desync_ttl : ttl_orig;
extract_endpoints(ip, ip6hdr, NULL, udphdr, &src, &dst);
if (len_payload)

View File

@ -277,11 +277,11 @@ static bool TLSExtractHostFromExt(const uint8_t *ext, size_t elen, char *host, s
// u16 data+0 - name list length
// u8 data+2 - server name type. 0=host_name
// u16 data+3 - server name length
if (elen < 5 || (ext && ext[2] != 0)) return false;
if (elen < 5 || ext[2] != 0) return false;
size_t slen = pntoh16(ext + 3);
ext += 5; elen -= 5;
if (slen < elen) return false;
if (ext && len_host)
if (host && len_host)
{
if (slen >= len_host) slen = len_host - 1;
for (size_t i = 0; i < slen; i++) host[i] = tolower(ext[i]);

View File

@ -267,11 +267,11 @@ static bool TLSExtractHostFromExt(const uint8_t *ext, size_t elen, char *host, s
// u16 data+0 - name list length
// u8 data+2 - server name type. 0=host_name
// u16 data+3 - server name length
if (elen < 5 || (ext && ext[2] != 0)) return false;
if (elen < 5 || ext[2] != 0) return false;
size_t slen = pntoh16(ext + 3);
ext += 5; elen -= 5;
if (slen < elen) return false;
if (ext && len_host)
if (host && len_host)
{
if (slen >= len_host) slen = len_host - 1;
for (size_t i = 0; i < slen; i++) host[i] = tolower(ext[i]);