ZaStoGram_desktop/Telegram/SourceFiles/mtproto/auth
Repository files (latest commit first)
Filename Latest commit message Latest commit date
loop-uh 958d05339b Record that a server told us the time, not that it moved the clock
The clock reference was inferred from the correction being nonzero, which
inverts the warning. base::unixtime::update() returns without applying a
shift smaller than kIgnoreTimeDifference, three seconds - so a machine whose
clock is right keeps a zero shift and looks exactly like one that never heard
from a server. The HTTP correction does not cover for it either: the Date
fetch runs only off a fake TLS failure path, so a client that works never
performs one.

Put together, clock_ref=none would have been logged on every hello of every
healthy user, and stayed silent for the users already off by the three
seconds a relay refuses. A warning everyone sees stops being read, and the
first thing to stop being read is the one case it exists for.

So the flag now records the event it was always meant to record: a server
time arrived. It is raised at all four places one can arrive - three in
receive.cpp, one in the key creator - next to the update call rather than
inside it, because the update is exactly what may decide to do nothing. The
flag lives in the runtime layer as process-wide atomic state; base::unixtime
would be the natural home, but it is a submodule, and its own ValueUpdated
has the same hole on the ignore path.

The guard test now pins both halves: that the reference comes from
ServerTimeReceived(), and that every update call site has a matching mark.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-26 14:08:52 +03:00
..
mtproto_auth_key.cpp Restructure mtproto ownership 2026-07-08 00:07:46 +03:00
mtproto_auth_key.h Fix storage cache auth key access 2026-07-08 22:35:03 +03:00
mtproto_bound_key_creator.cpp
mtproto_bound_key_creator.h
mtproto_dc_key_binder.cpp
mtproto_dc_key_binder.h Restructure mtproto ownership 2026-07-08 00:07:46 +03:00
mtproto_dc_key_creator.cpp Record that a server told us the time, not that it moved the clock 2026-07-26 14:08:52 +03:00
mtproto_dc_key_creator.h Restructure mtproto ownership 2026-07-08 00:07:46 +03:00
mtproto_dc_key_crypto.cpp Fix MTProto crypto raw AES include 2026-07-08 01:01:57 +03:00
mtproto_dc_key_crypto.h распил 2026-07-08 00:44:27 +03:00
mtproto_dh_utils.cpp
mtproto_dh_utils.h