1
0
mirror of https://github.com/bol-van/zapret.git synced 2025-05-02 03:42:58 +03:00

nfqws,tpws: fix tls protocol bounds check

This commit is contained in:
bol-van 2023-10-12 14:46:32 +03:00
parent 508d11811d
commit c4729c3006
22 changed files with 4 additions and 2 deletions
binaries
aarch64
arm
freebsd-x64
mac64
mips32r1-lsb
mips32r1-msb
mips64r2-msb
ppc
x86
x86_64
nfq
tpws

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -122,7 +122,7 @@ bool TLSFindExtInHandshake(const uint8_t *data, size_t len, uint16_t type, const
data += l; len -= l; data += l; len -= l;
l = pntoh16(data); l = pntoh16(data);
data += 2; len -= 2; data += 2; len -= 2;
if (l < len) return false; if (len < l) return false;
while (l >= 4) while (l >= 4)
{ {

@ -6,6 +6,8 @@
#include <ctype.h> #include <ctype.h>
#include <arpa/inet.h> #include <arpa/inet.h>
#include <string.h> #include <string.h>
#include <stdio.h>
const char *http_methods[] = { "GET /","POST /","HEAD /","OPTIONS /","PUT /","DELETE /","CONNECT /","TRACE /",NULL }; const char *http_methods[] = { "GET /","POST /","HEAD /","OPTIONS /","PUT /","DELETE /","CONNECT /","TRACE /",NULL };
bool IsHttp(const uint8_t *data, size_t len) bool IsHttp(const uint8_t *data, size_t len)
@ -86,7 +88,7 @@ bool TLSFindExt(const uint8_t *data, size_t len, uint16_t type, const uint8_t **
data+=l; len-=l; data+=l; len-=l;
l=pntoh16(data); l=pntoh16(data);
data+=2; len-=2; data+=2; len-=2;
if (l<len) return false; if (len<l) return false;
while(l>=4) while(l>=4)
{ {