[tor-bugs] #30552 [Applications/Tor Browser]: Android - Clean up torrc

Tor Bug Tracker & Wiki blackhole at torproject.org
Tue Oct 29 15:56:42 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, TorBrowserTeam201910R  |  Actual Points:
Parent ID:                                     |         Points:  0.5
 Reviewer:                                     |        Sponsor:
-----------------------------------------------+---------------------------
Changes (by sysrqb):

 * status:  needs_review => needs_revision


Comment:

 Replying to [comment:6 sisbell]:
 > I made the following changes to tor-onion-proxy-library. If the changes
 look good, I will need to make it compatible with tor-android-service.

 I think it would make more sense leaving TOPL's defaults unchanged, as
 much as possible. I don't see a problem with explicitly setting default
 values in the torrc (like `TestSocks 0`), but I do like cleaner defaults
 and a cleaner/smaller generated torrc.


 >
 > * StrictNodes, UseBridges, SafeSocks, TestSocks will not be included in
 the torrc if they have a 0 value

 I don't have a strong opinion on this. It doesn't really have any impact
 until tor's default values change for whatever reason.


 > * DnsPort, HttpTunnelPort, TransparentProxyPort are now all Integers. I
 also added an associated host field for each one.
 > * ProxyPort, ProxySocks5ServerPort are now an Integers rather than
 Strings.
 > * HttpTunnelPort and TransPort values are set to null so it won't appear
 in torrc by default.
 > * AutomapHostsOnResolve is set to false so won't appear in torrc by
 default

 These are the more important changes.


 >
 > The remaining field VirtualAddrNetwork will need to be removed in tor-
 android-service
 >
 >
 https://github.com/sisbell/Tor_Onion_Proxy_Library/commit/73aeed144259a66930e605c7804946c9f6041b59
 >

 `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?

 {{{
      @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?

 {{{
 +    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.

 `universal/src/test/java/com/msopentech/thali/toronionproxy/TorConfigBuilderTest.java`

 {{{
 +    /**
 +     * SHould be empty
 +     */
 }}}
 nit.

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/30552#comment:8>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list