feat: update FET analyzer to better reflect what's described in the paper

This commit is contained in:
Toby 2024-02-26 15:27:35 -08:00
parent 420286a46c
commit 797dce3dc2

View File

@ -143,8 +143,11 @@ func isTLSorHTTP(bytes []byte) bool {
if len(bytes) < 3 { if len(bytes) < 3 {
return false return false
} }
if bytes[0] == 0x16 && bytes[1] == 0x03 && bytes[2] <= 0x03 { // "We observe that the GFW exempts any connection whose first
// TLS handshake for TLS 1.0-1.3 // three bytes match the following regular expression:
// [\x16-\x17]\x03[\x00-\x09]" - from the paper in Section 4.3
if bytes[0] >= 0x16 && bytes[0] <= 0x17 &&
bytes[1] == 0x03 && bytes[2] <= 0x09 {
return true return true
} }
// HTTP request // HTTP request