Expand description
TLS record byte-stream framing used by the FakeTLS (0xEE) MTProxy
transport.
Real MTProxy FakeTLS is the same Obfuscated2/PaddedIntermediate
transport used by dd secrets. It is simply carried inside a decoy TLS
1.3 handshake and TLS record byte-stream framing so the traffic looks
like ordinary HTTPS to DPI. These helpers only deal with that outer
record framing – they know nothing about the inner Obfuscated2 cipher
or PaddedIntermediate frame shape, so they’re pure and independently
testable.
Structs§
- RawRecord
- A single raw TLS record as read during the handshake: its type byte and full wire bytes (5-byte header included).
- Unwrapped
- Result of scanning a byte buffer for complete TLS records.
Constants§
- RECORD_
APPLICATION_ DATA - RECORD_
CHANGE_ CIPHER_ SPEC - RECORD_
HANDSHAKE - RECORD_
HEADER_ LEN - RECORD_
MAX_ CHUNK - TLS max plaintext record payload size (2^14), the same chunk ceiling tdesktop and other clients split at.
Functions§
- change_
cipher_ spec_ record - The one-time leading ChangeCipherSpec decoy record
(
0x14 0x03 0x03 0x00 0x01 0x01) real MTProxy FakeTLS servers expect before the first real Application Data record. - read_
one_ record - Read exactly one TLS record from
stream, blocking until the 5-byte header and its declared-length payload have both arrived. - unwrap_
records - Scan
pendingfor complete TLS records during steady-state (post handshake) I/O. - wrap_
application_ data - Wrap already-encrypted bytes into one or more TLS Application Data
records (
0x17 0x03 0x03 <len(be16)> <data>), splitting atRECORD_MAX_CHUNK. Appends toout.