-
Notifications
You must be signed in to change notification settings - Fork 22
Fix Fake-TLS (EE mode) rejected when domain option specified #24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Remove incorrect check that was rejecting 0xeeeeeeee tag when allow_only_tls flag is set. This allows EE mode (Fake-TLS + Padding) to work properly when -D domain option is specified. Co-authored-by: dvershinin <250071+dvershinin@users.noreply.github.com>
|
@copilot why remove the validation entirely? Perhaps just relaxing it a bit is a better approach. |
Instead of removing validation entirely, now properly validates that when -D (Fake-TLS) option is used: - DD mode (0xdddddddd - random padding only) is rejected - EE mode (0xeeeeeeee - Fake-TLS + Padding) is allowed - EF mode (0xefefefef - Fake-TLS compact) is allowed This maintains proper security validation while fixing the original bug. Co-authored-by: dvershinin <250071+dvershinin@users.noreply.github.com>
You're right. I've refined the validation instead of removing it entirely. The new check inverts the logic to properly reject DD mode (random padding only) when |
Co-authored-by: dvershinin <250071+dvershinin@users.noreply.github.com>
Co-authored-by: dvershinin <250071+dvershinin@users.noreply.github.com>
|
@copilot still not working, still same behavior as in https://github.com/user-attachments/files/24359663/mtproto-verbose.log |
|
@copilot hello |
This fix reverts the problematic changes from PR #24 and PR #25 that broke Fake-TLS connections: 1. Revert TLS ClientHello detection to original pattern: The change in PR #25 incorrectly checked the length byte instead of TLS version, which could cause detection failures. 2. Remove the tag validation check that was incorrectly rejecting EE/EF modes: - For Fake-TLS connections (C_IS_TLS set), any valid tag should be accepted - For non-TLS connections with allow_only_tls=1, connection is rejected earlier - This check was unnecessary and was causing EE mode to fail Fixes #23 Co-authored-by: dvershinin <250071+dvershinin@users.noreply.github.com>
When
-Ddomain option is used to enable Fake-TLS mode, connections using EE mode (tag0xeeeeeeee) were incorrectly rejected with "Expected random padding mode" error. This prevented the documented EE mode secret format (ee+ secret + domain_hex) from working.Changes
net/net-tcp-rpc-ext-server.c(lines 1318-1321) to properly allow EE/EF modes and reject DD mode whenallow_only_tlsflag is setThe original buggy check was:
This incorrectly rejected EE/EF modes (Fake-TLS) and only allowed DD mode (random padding only) when
-Dwas used.The fixed validation is:
This properly rejects DD mode and allows EE/EF modes when
-Dis specified, maintaining security validation while fixing the bug.Behavior
When
-Doption is used:The logic correctly separates two orthogonal concerns:
-Doption setsallow_only_tlsto enforce Fake-TLS transport modes (EE/EF)-Roption setsext_rand_pad_onlyto restrict to DD mode onlyOriginal prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.