From 453aca007971a294a15425e926f84b28bf318b20 Mon Sep 17 00:00:00 2001 From: klzgrad Date: Sat, 13 Jun 2020 16:02:14 +0800 Subject: [PATCH] Raise initial padding number to 8 Protect initial handshake lengths. Common client initial sequence: - TLS: ClientHello - TLS: ChangeCipherSpec, Finished - H2: Magic, SETTINGS, WINDOW_UPDATE - H2: HEADERS: GET - H2: SETTINGS ACK Common server initial sequence: - TLS: ServerHello, ChangeCipherSpec, ... - TLS: Certificate, ... - H2: SETTINGS - H2: WINDOW_UPDATE - H2: SETTINGS ACK - H2: HEADERS: 200 OK --- src/net/tools/naive/naive_connection.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/net/tools/naive/naive_connection.cc b/src/net/tools/naive/naive_connection.cc index 80dca93f0e..590685aa73 100644 --- a/src/net/tools/naive/naive_connection.cc +++ b/src/net/tools/naive/naive_connection.cc @@ -41,7 +41,7 @@ namespace net { namespace { constexpr int kBufferSize = 64 * 1024; -constexpr int kFirstPaddings = 4; +constexpr int kFirstPaddings = 8; constexpr int kPaddingHeaderSize = 3; constexpr int kMaxPaddingSize = 255; } // namespace