From e4a8f517753f6b9cea13edaf42b122539712865b Mon Sep 17 00:00:00 2001 From: bol-van Date: Sun, 28 Dec 2025 18:04:41 +0300 Subject: [PATCH] nfqws2: do not treat quic handshake messages as initials --- docs/changes.txt | 1 + nfq2/protocol.c | 7 +++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index 6b26acc..36e9393 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -139,3 +139,4 @@ v0.7.7 * init.d: 50-dht4all NFQWS_OPT_DHT_PKT_OUT * nfqws2: support 48-bit arithmetics * github actions: remove arm-old target - luajit fail reason revealed +* nfqws2: do not treat quic handshake messages as initials diff --git a/nfq2/protocol.c b/nfq2/protocol.c index 2621dc7..39a31ef 100644 --- a/nfq2/protocol.c +++ b/nfq2/protocol.c @@ -1317,9 +1317,9 @@ bool QUICDefragCrypto(const uint8_t *clean,size_t clean_len, uint8_t *defrag,siz bool IsQUICInitial(const uint8_t *data, size_t len) { - // too small packets are not likely to be initials with client hello + // too small packets are not likely to be initials // long header, fixed bit - if (len < 256 || (data[0] & 0xC0)!=0xC0) return false; + if (len < 128 || (data[0] & 0xF0)!=0xC0) return false; uint32_t ver = QUICExtractVersion(data,len); if (QUICDraftVersion(ver) < 11) return false; @@ -1349,8 +1349,7 @@ bool IsQUICInitial(const uint8_t *data, size_t len) offset += sz; if (offset > len) return false; - // client hello cannot be too small. likely ACK - return sz>=96; + return true; }