Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions net/net-tcp-rpc-ext-server.c
Original file line number Diff line number Diff line change
Expand Up @@ -1043,8 +1043,6 @@ int tcp_rpcs_compact_parse_execute (connection_job_t C) {

if (D->in_packet_num == -3) {
vkprintf (1, "trying to determine type of connection from %s:%d\n", show_remote_ip (C), c->remote_port);
vkprintf (2, "packet_len=0x%08x, ext_secret_cnt=%d, allow_only_tls=%d, C_IS_TLS=%d\n",
packet_len, ext_secret_cnt, allow_only_tls, !!(c->flags & C_IS_TLS));
#if __ALLOW_UNOBFS__
if ((packet_len & 0xff) == 0xef) {
D->flags |= RPC_F_COMPACT;
Expand Down Expand Up @@ -1112,9 +1110,7 @@ int tcp_rpcs_compact_parse_execute (connection_job_t C) {
assert (rwm_fetch_lookup (&c->in, &packet_len, 4) == 4);

c->left_tls_packet_length -= 64; // skip header length
} else if ((packet_len & 0xFF) == 0x16 && ((packet_len >> 8) & 0xFF) == 0x03 && (packet_len >> 24) >= 2 && ext_secret_cnt > 0 && allow_only_tls) {
// TLS ClientHello detection: 0x16 (handshake), 0x03 (SSL/TLS version major), any minor version (0x01=TLS1.0, 0x03=TLS1.2/1.3)
vkprintf (2, "Detected TLS ClientHello: packet_len=0x%08x, version=0x03%02x\n", packet_len, (packet_len >> 16) & 0xFF);
} else if ((packet_len & 0xFFFFFF) == 0x010316 && (packet_len >> 24) >= 2 && ext_secret_cnt > 0 && allow_only_tls) {
unsigned char header[5];
assert (rwm_fetch_lookup (&c->in, header, 5) == 5);
min_len = 5 + 256 * header[3] + header[4];
Expand Down Expand Up @@ -1319,10 +1315,6 @@ int tcp_rpcs_compact_parse_execute (connection_job_t C) {
unsigned tag = *(unsigned *)(random_header + 56);

if (tag == 0xdddddddd || ((tag == 0xeeeeeeee || tag == 0xefefefef) && !ext_rand_pad_only)) {
if (tag == 0xdddddddd && allow_only_tls) {
vkprintf (1, "Expected Fake-TLS mode (EE/EF), got random padding mode (DD)\n");
RETURN_TLS_ERROR(default_domain_info);
}
assert (rwm_skip_data (&c->in, 64) == 64);
rwm_union (&c->in_u, &c->in);
rwm_init (&c->in, 0);
Expand Down