[tor-commits] [Git][tpo/applications/tor-browser][tor-browser-128.3.0esr-14.0-1] 2 commits: fixup! Orfox: Centralized proxy applied to AbstractCommunicator and BaseResources.

Pier Angelo Vendrame (@pierov) git at gitlab.torproject.org
Wed Oct 2 16:16:45 UTC 2024



Pier Angelo Vendrame pushed to branch tor-browser-128.3.0esr-14.0-1 at The Tor Project / Applications / Tor Browser


Commits:
8acd4ac6 by Dan Ballard at 2024-10-02T16:09:15+00:00
fixup! Orfox: Centralized proxy applied to AbstractCommunicator and BaseResources.

This reverts commit a16d36fce768826615620ee73bec755fcd7081ea for tb-42660

- - - - -
10a39162 by Dan Ballard at 2024-10-02T16:09:15+00:00
Bug 42660: Disable ProxySelector.openConnectionWithProxy and NOPify CrashReporter.sendCrashReport

- - - - -


2 changed files:

- mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/ProxySelector.java
- mobile/android/geckoview/src/main/java/org/mozilla/geckoview/CrashReporter.java


Changes:

=====================================
mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/ProxySelector.java
=====================================
@@ -28,40 +28,19 @@ import java.net.URLConnection;
 import java.util.List;
 
 public class ProxySelector {
-  private static final String TOR_PROXY_ADDRESS = "127.0.0.1";
-  private static final int TOR_SOCKS_PROXY_PORT = 9150;
-  private static final int TOR_HTTP_PROXY_PORT = 8218;
-
   public static URLConnection openConnectionWithProxy(final URI uri) throws IOException {
-    final java.net.ProxySelector ps = java.net.ProxySelector.getDefault();
-    Proxy proxy = Proxy.NO_PROXY;
-    if (ps != null) {
-      final List<Proxy> proxies = ps.select(uri);
-      if (proxies != null && !proxies.isEmpty()) {
-        proxy = proxies.get(0);
-      }
-    }
-
-    /* Ignore the proxy we found from the VM, only use Tor. We can probably
-     * safely use the logic in this class in the future. */
-    return uri.toURL().openConnection(getProxy());
-  }
-
-  public static Proxy getProxy() {
-    // TODO make configurable
-    return new Proxy(Proxy.Type.SOCKS, new InetSocketAddress(TOR_PROXY_ADDRESS, TOR_SOCKS_PROXY_PORT));
-  }
-
-  public static String getProxyHostAddress() {
-    return TOR_PROXY_ADDRESS;
-  }
-
-  public static int getSocksProxyPort() {
-    return TOR_SOCKS_PROXY_PORT;
-  }
-
-  public static int getHttpProxyPort() {
-    return TOR_HTTP_PROXY_PORT;
+//  tb-42660: This should not be used: it cannot safely get tor configs so would be a proxy leak risk
+    throw new IOException("openConnectionWithProxy disabled by tb-42660");
+//    final java.net.ProxySelector ps = java.net.ProxySelector.getDefault();
+//    Proxy proxy = Proxy.NO_PROXY;
+//    if (ps != null) {
+//      final List<Proxy> proxies = ps.select(uri);
+//      if (proxies != null && !proxies.isEmpty()) {
+//        proxy = proxies.get(0);
+//      }
+//    }
+//
+//    return uri.toURL().openConnection(proxy);
   }
 
   public ProxySelector() {}


=====================================
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/CrashReporter.java
=====================================
@@ -169,6 +169,11 @@ public class CrashReporter {
       @NonNull final File minidumpFile,
       @NonNull final JSONObject extras)
       throws IOException, URISyntaxException {
+    // tb-42660: makeing a NOP
+    if (true) {
+      return GeckoResult.fromValue("0");
+    }
+    
     Log.d(LOGTAG, "Sending crash report: " + minidumpFile.getPath());
 
     HttpURLConnection conn = null;



View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/ac6b47d5a8034bd24608e591121ce0abdbe32d3d...10a39162374c5024a4028e08f6f5513b5fc37c99

-- 
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/ac6b47d5a8034bd24608e591121ce0abdbe32d3d...10a39162374c5024a4028e08f6f5513b5fc37c99
You're receiving this email because of your account on gitlab.torproject.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.torproject.org/pipermail/tor-commits/attachments/20241002/e98b0eda/attachment-0001.htm>


More information about the tor-commits mailing list