Igor Artamonov ccb349f3d2
Go / Lint (old) (push) Failing after 4m40s
Go / Lint (latest) (push) Failing after 4m39s
Go / Lint (old) (pull_request) Failing after 4m41s
Go / Lint (latest) (pull_request) Failing after 4m40s
obfuscated2: only XOR bytes actually delivered on Read
Read called XORKeyStream(b, b) — XOR-ing the entire caller buffer even
when the underlying transport returned fewer bytes. AES-CTR's keystream
position is then advanced by len(b), but the peer only consumed n
bytes' worth of keystream. After a single short read the two
keystreams diverge for the lifetime of the connection, every
subsequent MTProto message decrypts to garbage, and the engine fails
with "consume message: decrypt: msg_key is invalid".

The faketls layer makes short reads routine: each Read returns at most
one TLS Application record's payload, regardless of how big the caller
buffer is. So in practice the stream desynced almost immediately on
high-traffic clients (active supergroups, post-relogin catch-up) and
intermittently on quiet ones.

Match the upstream gotd/td fix and only XOR the n bytes that came out
of the transport. Add a regression test (chunkConn delivers ciphertext
in 7-byte chunks; client reads through Obfuscated2.Read with a 128-byte
buffer; plaintext must round-trip).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-01 12:33:44 +03:00
2025-12-03 17:11:19 +02:00
2026-04-20 16:51:51 +03:00
2026-03-29 00:26:40 +02:00
2026-04-30 15:49:10 +03:00
2026-04-30 15:49:10 +03:00
2018-03-08 23:49:56 +02:00
2026-04-05 21:25:00 +03:00
2026-04-01 21:36:14 +03:00

mautrix-telegram

Languages License Release GitLab CI

A Matrix-Telegram puppeting/relaybot bridge.

Sponsors

Documentation

All setup and usage instructions are located on docs.mau.fi. Some quick links:

Features & Roadmap

ROADMAP.md contains a general overview of what is supported by the bridge.

Discussion

Matrix room: #telegram:maunium.net

Telegram chat: mautrix_telegram (bridged to Matrix room)

Languages
Go 96.5%
Go Template 3%
Teal 0.3%