Skip to content

Commit bd49a7f

Browse files
committed
stealth: S1 padding rand, S7 ALPS codepoint fix, S20 ECH policy
1 parent 085c4ba commit bd49a7f

9 files changed

Lines changed: 850 additions & 556 deletions

Telegram/SourceFiles/mtproto/details/mtproto_tls_client_hello.cpp

Lines changed: 592 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
This file is part of Telegram Desktop,
3+
the official desktop application for the Telegram messaging service.
4+
5+
For license and copyright information please follow this link:
6+
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
7+
*/
8+
#pragma once
9+
10+
#include "base/bytes.h"
11+
#include "scheme.h"
12+
13+
#include <QtCore/QByteArray>
14+
15+
namespace MTP::details {
16+
17+
struct TlsClientHelloGenerated {
18+
QByteArray data;
19+
QByteArray digest;
20+
};
21+
22+
// Synthetic TLS ClientHello rules for MTProxy (ee) transport. When include_ech
23+
// is false, the ECH extension permutation branch is omitted (conservative
24+
// egress; see tdlib-obf-stealth-plan V6 / S20).
25+
[[nodiscard]] MTPTlsClientHello TlsClientHelloDefaultRules(bool include_ech = true);
26+
27+
// Whether to include ECH for this process / connection policy (compile-time
28+
// default + optional TDESKTOP_TLS_ECH_OFF / TDESKTOP_TLS_ECH_ON env).
29+
[[nodiscard]] bool TlsClientHelloIncludeEch();
30+
31+
[[nodiscard]] TlsClientHelloGenerated GenerateTlsClientHello(
32+
const MTPTlsClientHello &rules,
33+
bytes::const_span domain,
34+
bytes::const_span key);
35+
36+
} // namespace MTP::details

0 commit comments

Comments
 (0)