Skip to content
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

fix(faketls): fix encoding SNI in faketls ClientHello #1400

Merged
merged 1 commit into from
Jul 3, 2024

Conversation

markpash
Copy link
Contributor

Hi, I found a really annoying bug that prevented me from being able to use faketls based mtproto proxies.
It took a couple of days to figure out why, but I finally found the problem. Luckily it's a quick fix.

Just FYI, the telegram android and desktop codebases have updated their faketls implementation and I was wondering if you'd be interested in me contributing a follow-up PR with those improvements.

The offset calculation used in the stack code in the ClientHello creation function was incorrect, resulting in the SNI field not being correctly encoded and therefore not being able to connect to faketls mtproto proxies.

Added parenthesis to fix the math.

@ernado
Copy link
Member

ernado commented Jun 30, 2024

Hi, thank you for contribution!
Please update tests so I can merge this.

The offset calculation used in the stack code in the ClientHello
creation function was incorrect, resulting in the SNI field not
being correctly encoded and therefore not being able to connect
to faketls mtproto proxies.

Added parenthesis to fix the math.

Signed-off-by: Mark Pashmfouroush <mark@markpash.me>
@markpash
Copy link
Contributor Author

markpash commented Jul 3, 2024

Hi, thank you for contribution! Please update tests so I can merge this.

Hey no problem. I've updated the test.

Copy link

codecov bot commented Jul 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 71.10%. Comparing base (1a7623f) to head (736dd57).
Report is 31 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1400      +/-   ##
==========================================
+ Coverage   70.99%   71.10%   +0.10%     
==========================================
  Files         442      442              
  Lines       17722    17723       +1     
==========================================
+ Hits        12582    12602      +20     
+ Misses       4203     4191      -12     
+ Partials      937      930       -7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ernado ernado merged commit 4ab00a7 into gotd:main Jul 3, 2024
14 checks passed
@markpash markpash deleted the pr/markpash/faketls-bug branch July 3, 2024 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants