-
Notifications
You must be signed in to change notification settings - Fork 292
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
feat: Add username/password SOCKS5 auth #1683
base: master
Are you sure you want to change the base?
Conversation
@nurupo Does this still need testing? I'm willing to test it. |
Yep, so far no one has tested it as far as I'm aware. |
1f15b48
to
b5f2735
Compare
abbf3db
to
bbb3a45
Compare
Fixed a couple of issues I have noticed after reviewing with a fresh set of eyes. |
I managed to verify that SOCKS5 authenticated connections work. Currently I've only tested with |
Update: I managed to verify that SOCKS5 authenticated connections work in qTox too. When using correct credentials, the client connects to a TCP relay and all traffic goes through it. In the case of incorrect credentials or lack of credentials, qTox fails to connect. In all cases, I noticed this in the log: EDIT (comment from IRC): |
Cool, thanks for testing.
This is a qTox-specific thing, it says nothing about toxcore or this PR working or non-working. Would be great if someone else could test this too, I'm not too sure if @cryptogospod tested it correctly. The way it should have been tested, that Since @cryptogospod has asked this on IRC, I want to point it out here too: for this to be merged, there are a few more steps that need to be done:
|
@nurupo I walked through testing with qTox with @cryptogospod at the time, the diff was adding the calls to the new API here: https://github.com/qTox/qTox/blob/da5c165f4116dce736def63b1b917523b848db09/src/core/toxoptions.cpp#L133. The Agreed that the error doesn't say anything about toxcore, but I do think that @cryptogospod's testing showing that toxcore either connects or doesn't connect when using the proxy with the correct or incorrect password shows password support's working. |
Ok, makes sense and also explains why That's a valid way to test it too, so it sounds like it was tested correctly. |
@nurupo what's the state of this? Can it be merged? Mentioned in: |
4213205
to
f6e42c9
Compare
Regarding #1683 (comment), after a discussion with @iphydf on IRC it was decided to keep the username and password setter functions separate, as a single setter function setting both would be bad for binding generation. (An alternative could have been an opaque username-password-socks5-auth struct with a separate constructior/destructor/setter/getter functions, which we would set on Tox_Options, but it seemed a bit excessive). |
@nurupo can you rebase this pr? |
f6e42c9
to
3a40adf
Compare
3a40adf
to
e4203a3
Compare
@Green-Sky done |
toxcore/tox_options.h
Outdated
* @brief Owned pointer to the SOCKS5 proxy username. | ||
* @private | ||
*/ | ||
uint8_t *owned_proxy_socks5_username; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're introducing new data members here. Do we need them to not be owned by default as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would make the API inconsistent - some things are not owned and require a flag to be set, but others are owned.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it functionally matter? If clients think it's not owned, they will save their pointers. If they enable the flag or happen to know that it is owned, they don't. It's making things more complicated, and 0.3.0 will get rid of this un-owned mode entirely.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe I got this addressed now.
Per the IRC discussion:
<iphy> Maybe name the fields internal_do_not_set_directly_proxy_socks5_username etc
<iphy> No new code should be setting those fields, and we shouldn't build complexity to cover for that case
169bd2f
to
bd81c1f
Compare
bd81c1f
to
c3f5aa8
Compare
c3f5aa8
to
083bfd4
Compare
Fixes #1682
Not tested. Can someone with a SOCKS5 proxy with username/password test this?
I'm not sure how to prevent APIDSL from generating
tox_options_set_proxy_socks5_username_length()
andtox_options_set_proxy_socks5_password_length()
function declarations. Those seem pointless as the user already sets the length intox_options_set_proxy_socks5_username()
andtox_options_set_proxy_socks5_password()
. Savedata has the same issue with a pointlesstox_options_set_savedata_length()
.This change is![Reviewable](https://camo.githubusercontent.com/1541c4039185914e83657d3683ec25920c672c6c5c7ab4240ee7bff601adec0b/68747470733a2f2f72657669657761626c652e696f2f7265766965775f627574746f6e2e737667)