From 60dd3cb004b7a00eb1b4801050e9af56be0b3aa2 Mon Sep 17 00:00:00 2001 From: ValdikSS Date: Wed, 31 Jul 2024 12:23:37 +0300 Subject: [PATCH] Make ClientHello ignore --max-payload limits Receive TLS ClientHello despite max-payload limit set, to get all the benefits of the option (decreased CPU consumption) but still handle all TLS connections, including Kyber. --- src/goodbyedpi.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/goodbyedpi.c b/src/goodbyedpi.c index 65e3da8..886bd24 100644 --- a/src/goodbyedpi.c +++ b/src/goodbyedpi.c @@ -221,7 +221,10 @@ static void add_ip_id_str(int id) { static void add_maxpayloadsize_str(unsigned short maxpayload) { char *newstr; /* 0x47455420 is "GET ", 0x504F5354 is "POST", big endian. */ - const char *maxpayloadsize_str = "and (tcp.PayloadLength ? tcp.PayloadLength < %hu or tcp.Payload32[0] == 0x47455420 or tcp.Payload32[0] == 0x504F5354 : true)"; + const char *maxpayloadsize_str = + "and (tcp.PayloadLength ? tcp.PayloadLength < %hu " \ + "or tcp.Payload32[0] == 0x47455420 or tcp.Payload32[0] == 0x504F5354 " \ + "or (tcp.Payload[0] == 0x16 and tcp.Payload[1] == 0x03 and tcp.Payload[2] <= 0x03): true)"; char *addfilter = malloc(strlen(maxpayloadsize_str) + 16); sprintf(addfilter, maxpayloadsize_str, maxpayload);