-
Notifications
You must be signed in to change notification settings - Fork 351
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
Apply the obfuscation port to the entry configuration only #7199
Apply the obfuscation port to the entry configuration only #7199
Conversation
a930993
to
7432679
Compare
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.
Reviewed 8 of 8 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @rablador)
ios/MullvadREST/Relay/RelayPicking.swift
line 25 at r1 (raw file):
from candidates: [RelayWithLocation<REST.ServerRelay>], closeTo location: Location? = nil, obfuscate: Bool
I think this conveys the wrong information, and is misleading.
It's effectively saying "use obfuscation" when instead it should be saying "use the obfuscated port if present" since this doesn't decide whether obfuscation is ultimately used or not.
How about we rename it shouldUseObfuscatedPort
?
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.
Added fixes for issue https://linear.app/mullvad/issue/IOS-948/fix-port-selection-for-shadowsocks as well.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @buggmagnet)
ios/MullvadREST/Relay/RelayPicking.swift
line 25 at r1 (raw file):
Previously, buggmagnet wrote…
I think this conveys the wrong information, and is misleading.
It's effectively saying "use obfuscation" when instead it should be saying "use the obfuscated port if present" since this doesn't decide whether obfuscation is ultimately used or not.How about we rename it
shouldUseObfuscatedPort
?
Done.
7432679
to
b9cfdf5
Compare
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.
Looks good, but Unit Tests are broken now 🫠
Reviewed 4 of 5 files at r2, all commit messages.
Reviewable status: 9 of 10 files reviewed, all discussions resolved
b9cfdf5
to
b462d11
Compare
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.
Fixed!
Reviewable status: 9 of 10 files reviewed, all discussions resolved (waiting on @buggmagnet)
b462d11
to
3017226
Compare
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.
Reviewed 1 of 5 files at r2, 1 of 1 files at r3, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved
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.
Reviewed all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved
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.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @rablador)
ios/MullvadREST/Relay/RelayPicking.swift
line 14 at r2 (raw file):
protocol RelayPicking { var obfuscation: ObfuscatorPortSelection { get }
nit : that wouldn't be better to integrate all properties in another structure. since the it's growing up.
ios/MullvadREST/Relay/RelayPicking.swift
line 15 at r2 (raw file):
protocol RelayPicking { var obfuscation: ObfuscatorPortSelection { get } var relays: REST.ServerRelaysResponse { get }
there no need to make it an exposed computed property out of the object. instead of using that property I suggest to use obfuscation.relays
directly
ios/MullvadREST/Relay/RelayPicking.swift
line 54 at r2 (raw file):
var endpoint = match.endpoint if !portIsWithinRange {
I suggest to add some comment here about the process we are doing when the port is out of the range.
ios/MullvadREST/Relay/RelayPicking.swift
line 89 at r2 (raw file):
) let match = try findBestMatch(from: exitCandidates, useObfuscatedPort: true)
what is the reason behind setting that true in single hop?
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.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @mojganii)
ios/MullvadREST/Relay/RelayPicking.swift
line 14 at r2 (raw file):
Previously, mojganii wrote…
nit : that wouldn't be better to integrate all properties in another structure. since the it's growing up.
I think it's fine at this point, but maybe in the future. Adding a wrapper adds an extra layer that might make things harder to follow.
ios/MullvadREST/Relay/RelayPicking.swift
line 15 at r2 (raw file):
Previously, mojganii wrote…
there no need to make it an exposed computed property out of the object. instead of using that property I suggest to use
obfuscation.relays
directly
I thought it would be clearer to specify a generic relays
variable. It might not be obvious for a reader that the filtered relays from the obfuscation result is the thing you want.
ios/MullvadREST/Relay/RelayPicking.swift
line 54 at r2 (raw file):
Previously, mojganii wrote…
I suggest to add some comment here about the process we are doing when the port is out of the range.
Done.
ios/MullvadREST/Relay/RelayPicking.swift
line 89 at r2 (raw file):
Previously, mojganii wrote…
what is the reason behind setting that true in single hop?
It's not very obvious here, I agree, but useObfuscatedPort
means that we should use the obfuscated port if there's one available. In singlehop there's only one (exit) relay, so obfuscation should always be applied in that case. In multihop we only set useObfuscatedPort
to true if it's the entry relay.
0be972c
to
5e02d88
Compare
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.
Reviewed 2 of 2 files at r4, all commit messages.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @mojganii)
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.
Reviewable status: complete! all files reviewed, all discussions resolved
5e02d88
to
e3f0540
Compare
e3f0540
to
ddfa220
Compare
🚨 End to end tests failed. Please check the failed workflow run. |
Currently, the obfuscation port is applied to the exit configuration at all times. Instead, it should be applied to the entry configuration when using multihop.
This change is