[tor-bugs] #30552 [Applications/Tor Browser]: Android - Clean up torrc
Tor Bug Tracker & Wiki
blackhole at torproject.org
Fri Nov 1 17:15:25 UTC 2019
#30552: Android - Clean up torrc
----------------------------------------------+----------------------------
Reporter: sysrqb | Owner: tbb-team
Type: defect | Status:
| needs_revision
Priority: Medium | Milestone:
Component: Applications/Tor Browser | Version:
Severity: Normal | Resolution:
Keywords: tbb-mobile, TorBrowserTeam201910 | Actual Points:
Parent ID: | Points: 0.5
Reviewer: | Sponsor:
----------------------------------------------+----------------------------
Comment (by sysrqb):
Replying to [comment:13 sisbell]:
> Replying to [comment:8 sysrqb]:
> >
> >
`universal/src/main/java/com/msopentech/thali/toronionproxy/DefaultSettings.java`
> > {{{
> > @Override
> > - public int getHttpTunnelPort() {
> > - return 8118;
> > + public String getHttpTunnelHost() {
> > + return null;
> > + }
> > +
> > + @Override
> > + public Integer getHttpTunnelPort() {
> > + return null;
> > }
> > }}}
> > This is changing the default port, is that intentional?
>
> Yes, I don't believe we use this by default. it can be set in tor-
android-service if needed.
> >
> > {{{
> > @Override
> > - public String transPort() {
> > - return "9040";
> > + public String getTransparentProxyAddress() {
> > + return null;
> > + }
> > +
> > + @Override
> > + public Integer getTransparentProxyPort() {
> > + return null;
> > }}}
> > This is changing the default port, is that intentional?
> Yes, I don't believe we use this by default. it can be set in tor-
android-service if needed.
> >
Okay, it seems a little weird to change the default value in TOPL instead
of change the values we want in `AndroidTorSettings` (in tor-android-
service), but if this will be accepted by upstream then that's fine.
> > {{{
> > + TorConfigBuilder addAddress(String fieldName, String address,
Integer port, String flags) {
> > + if(isNullOrEmpty(address) && port == null) {
> > + return this;
> > + }
> > + buffer.append(fieldName).append(" ");
> > + if(!isNullOrEmpty(address)) {
> > + buffer.append(address).append(":");
> > + }
> > + if (port != null) {
> > + buffer.append(port <= 0 ? "auto" : port);
> > }}}
> > Please pass this directly to tor, we shouldn't change the intended
behavior if the app configures a 0 or negative port number. Tor will emit
a warning which the app should handle itself.
> The negative int or null value is treated a "magic" number for "auto".
This is really because tor config accepts strings (auto) or int types for
port so we have to be able to handle this somehow.
The `null` check is fine, but `0` has a special meaning, so that should be
passed unmodified to tor. Do we need both `null` and negative integers
representing `auto`?
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/30552#comment:15>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
More information about the tor-bugs
mailing list