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/ac6b47d...