lists.torproject.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

tbb-commits

Thread Start a new thread
Download
Threads by month
  • ----- 2025 -----
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2021 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2020 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2019 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2018 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2017 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2016 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2015 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2014 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
tbb-commits@lists.torproject.org

  • 1 participants
  • 18632 discussions
[Git][tpo/applications/tor-browser-update-responses][main] release: new version, 13.0.8
by richard (@richard) 21 Dec '23

21 Dec '23
richard pushed to branch main at The Tor Project / Applications / Tor Browser update responses Commits: 94d633a9 by Richard Pospesel at 2023-12-21T13:34:35+00:00 release: new version, 13.0.8 - - - - - 30 changed files: - update_3/release/.htaccess - − update_3/release/13.0.1-13.0.7-linux-i686-ALL.xml - − update_3/release/13.0.1-13.0.7-linux-x86_64-ALL.xml - − update_3/release/13.0.1-13.0.7-macos-ALL.xml - − update_3/release/13.0.1-13.0.7-windows-i686-ALL.xml - − update_3/release/13.0.1-13.0.7-windows-x86_64-ALL.xml - − update_3/release/13.0.5-13.0.7-linux-i686-ALL.xml - − update_3/release/13.0.5-13.0.7-linux-x86_64-ALL.xml - − update_3/release/13.0.5-13.0.7-macos-ALL.xml - − update_3/release/13.0.5-13.0.7-windows-i686-ALL.xml - − update_3/release/13.0.5-13.0.7-windows-x86_64-ALL.xml - + update_3/release/13.0.5-13.0.8-linux-i686-ALL.xml - + update_3/release/13.0.5-13.0.8-linux-x86_64-ALL.xml - + update_3/release/13.0.5-13.0.8-macos-ALL.xml - + update_3/release/13.0.5-13.0.8-windows-i686-ALL.xml - + update_3/release/13.0.5-13.0.8-windows-x86_64-ALL.xml - − update_3/release/13.0.6-13.0.7-linux-i686-ALL.xml - − update_3/release/13.0.6-13.0.7-linux-x86_64-ALL.xml - − update_3/release/13.0.6-13.0.7-macos-ALL.xml - − update_3/release/13.0.6-13.0.7-windows-i686-ALL.xml - − update_3/release/13.0.6-13.0.7-windows-x86_64-ALL.xml - + update_3/release/13.0.6-13.0.8-linux-i686-ALL.xml - + update_3/release/13.0.6-13.0.8-linux-x86_64-ALL.xml - + update_3/release/13.0.6-13.0.8-macos-ALL.xml - + update_3/release/13.0.6-13.0.8-windows-i686-ALL.xml - + update_3/release/13.0.6-13.0.8-windows-x86_64-ALL.xml - + update_3/release/13.0.7-13.0.8-linux-i686-ALL.xml - + update_3/release/13.0.7-13.0.8-linux-x86_64-ALL.xml - + update_3/release/13.0.7-13.0.8-macos-ALL.xml - + update_3/release/13.0.7-13.0.8-windows-i686-ALL.xml The diff was not included because it is too large. View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-update-responses… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-update-responses… You're receiving this email because of your account on gitlab.torproject.org.
1 0
0 0
[Git][tpo/applications/tor-browser-build][maint-13.0] 2 commits: Bug 41056: Make it possible to use templates in var/torbrowser_incremental_from
by boklm (@boklm) 21 Dec '23

21 Dec '23
boklm pushed to branch maint-13.0 at The Tor Project / Applications / tor-browser-build Commits: f086ab55 by Nicolas Vigier at 2023-12-21T08:36:41+01:00 Bug 41056: Make it possible to use templates in var/torbrowser_incremental_from - - - - - 6733294b by Nicolas Vigier at 2023-12-21T08:40:11+01:00 Bug 41056: Use single var/torbrowser_incremental_from list - - - - - 2 changed files: - projects/release/update_responses_config.yml - rbm.conf Changes: ===================================== projects/release/update_responses_config.yml ===================================== @@ -43,9 +43,12 @@ versions: [% END -%] incremental_from: [% SET incr_from = c("var/nightly") ? c("var_p/nightly_torbrowser_incremental_from") : c("var/torbrowser_incremental_from"); - FOREACH v IN incr_from -%] - - [% v %] -[% END -%] + FOREACH v IN incr_from; + SET ver = tmpl(v); + IF ver -%] + - [% ver %] +[% END; + END -%] # for example, osx32: osx64 migrate_archs: # for example, pt-PT: pt-BR ===================================== rbm.conf ===================================== @@ -86,7 +86,7 @@ var: torbrowser_incremental_from: - '13.0.7' - '13.0.6' - - '13.0.5' + - '13.0.[% IF c("var/tor-browser") %]5[% ELSE %]4[% END %]' updater_enabled: 1 build_mar: 1 mar_channel_id: '[% c("var/projectname") %]-torproject-[% c("var/channel") %]' @@ -304,10 +304,6 @@ targets: - tr - zh-CN - zh-TW - torbrowser_incremental_from: - - '13.0.6' - - '13.0.4' - - '13.0.1' torbrowser-testbuild: - testbuild View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/compare/… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/compare/… You're receiving this email because of your account on gitlab.torproject.org.
1 0
0 0
[Git][tpo/applications/tor-browser-build][main] Bug 41056: Make it possible to use templates in var/torbrowser_incremental_from
by boklm (@boklm) 21 Dec '23

21 Dec '23
boklm pushed to branch main at The Tor Project / Applications / tor-browser-build Commits: 6858c6bd by Nicolas Vigier at 2023-12-20T16:40:56+01:00 Bug 41056: Make it possible to use templates in var/torbrowser_incremental_from - - - - - 1 changed file: - projects/release/update_responses_config.yml Changes: ===================================== projects/release/update_responses_config.yml ===================================== @@ -43,9 +43,12 @@ versions: [% END -%] incremental_from: [% SET incr_from = c("var/nightly") ? c("var_p/nightly_torbrowser_incremental_from") : c("var/torbrowser_incremental_from"); - FOREACH v IN incr_from -%] - - [% v %] -[% END -%] + FOREACH v IN incr_from; + SET ver = tmpl(v); + IF ver -%] + - [% ver %] +[% END; + END -%] # for example, osx32: osx64 migrate_archs: # for example, pt-PT: pt-BR View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/commit/6… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/commit/6… You're receiving this email because of your account on gitlab.torproject.org.
1 0
0 0
[Git][tpo/applications/tor-browser][tor-browser-115.6.0esr-13.5-1] 3 commits: fixup! Bug 40933: Add tor-launcher functionality
by Pier Angelo Vendrame (@pierov) 20 Dec '23

20 Dec '23
Pier Angelo Vendrame pushed to branch tor-browser-115.6.0esr-13.5-1 at The Tor Project / Applications / Tor Browser Commits: 8649662e by Pier Angelo Vendrame at 2023-12-20T19:16:35+01:00 fixup! Bug 40933: Add tor-launcher functionality Removed a redundant wrappedJSObject that broke stuff. - - - - - 7cb6472f by Pier Angelo Vendrame at 2023-12-20T21:49:35+01:00 fixup! Bug 42247: Android helpers for the TorProvider Bug 42251: Wired bootstrap updates. - - - - - d980086a by Pier Angelo Vendrame at 2023-12-20T21:49:46+01:00 fixup! Temporary changes to about:torconnect for Android. Temporary message to open Android settings from about:torconnect - - - - - 4 changed files: - mobile/android/geckoview/src/main/java/org/mozilla/geckoview/TorIntegrationAndroid.java - toolkit/components/tor-launcher/TorProvider.sys.mjs - toolkit/modules/TorAndroidIntegration.sys.mjs - toolkit/modules/TorConnect.sys.mjs Changes: ===================================== mobile/android/geckoview/src/main/java/org/mozilla/geckoview/TorIntegrationAndroid.java ===================================== @@ -46,6 +46,11 @@ public class TorIntegrationAndroid implements BundleEventListener { private static final String EVENT_TOR_STOP = "GeckoView:Tor:StopTor"; private static final String EVENT_MEEK_START = "GeckoView:Tor:StartMeek"; private static final String EVENT_MEEK_STOP = "GeckoView:Tor:StopMeek"; + private static final String EVENT_BOOTSTRAP_STATE_CHANGED = "GeckoView:Tor:BootstrapStateChanged"; + private static final String EVENT_BOOTSTRAP_PROGRESS = "GeckoView:Tor:BootstrapProgress"; + private static final String EVENT_BOOTSTRAP_COMPLETE = "GeckoView:Tor:BootstrapComplete"; + private static final String EVENT_BOOTSTRAP_ERROR = "GeckoView:Tor:BootstrapError"; + private static final String EVENT_SETTINGS_OPEN = "GeckoView:Tor:OpenSettings"; // Events we emit private static final String EVENT_SETTINGS_GET = "GeckoView:Tor:SettingsGet"; @@ -106,7 +111,12 @@ public class TorIntegrationAndroid implements BundleEventListener { EVENT_TOR_START, EVENT_MEEK_START, EVENT_MEEK_STOP, - EVENT_SETTINGS_READY); + EVENT_SETTINGS_READY, + EVENT_BOOTSTRAP_STATE_CHANGED, + EVENT_BOOTSTRAP_PROGRESS, + EVENT_BOOTSTRAP_COMPLETE, + EVENT_BOOTSTRAP_ERROR, + EVENT_SETTINGS_OPEN); } @Override // BundleEventListener @@ -122,6 +132,32 @@ public class TorIntegrationAndroid implements BundleEventListener { stopMeek(message, callback); } else if (EVENT_SETTINGS_READY.equals(event)) { loadSettings(message); + } else if (EVENT_BOOTSTRAP_STATE_CHANGED.equals(event)) { + String state = message.getString("state"); + for (BootstrapStateChangeListener listener: mBootstrapStateListeners) { + listener.onBootstrapStateChange(state); + } + } else if (EVENT_BOOTSTRAP_PROGRESS.equals(event)) { + double progress = message.getDouble("progress"); + String status = message.getString("status"); + boolean hasWarnings = message.getBoolean("hasWarnings"); + for (BootstrapStateChangeListener listener: mBootstrapStateListeners) { + listener.onBootstrapProgress(progress, status, hasWarnings); + } + } else if (EVENT_BOOTSTRAP_COMPLETE.equals(event)) { + for (BootstrapStateChangeListener listener: mBootstrapStateListeners) { + listener.onBootstrapComplete(); + } + } else if (EVENT_BOOTSTRAP_ERROR.equals(event)) { + String msg = message.getString("message"); + String details = message.getString("details"); + for (BootstrapStateChangeListener listener: mBootstrapStateListeners) { + listener.onBootstrapError(msg, details); + } + } else if (EVENT_SETTINGS_OPEN.equals(event)) { + for (BootstrapStateChangeListener listener: mBootstrapStateListeners) { + listener.onSettingsRequested(); + } } } @@ -467,17 +503,12 @@ public class TorIntegrationAndroid implements BundleEventListener { } } - public static class BootstrapState { - // FIXME: We can do better than this :) - public GeckoBundle mBundle; - - BootstrapState(GeckoBundle bundle) { - mBundle = bundle; - } - } - public interface BootstrapStateChangeListener { - void onBootstrapStateChange(BootstrapState state); + void onBootstrapStateChange(String state); + void onBootstrapProgress(double progress, String status, boolean hasWarnings); + void onBootstrapComplete(); + void onBootstrapError(String message, String details); + void onSettingsRequested(); } public @NonNull GeckoResult<GeckoBundle> getSettings() { @@ -514,16 +545,6 @@ public class TorIntegrationAndroid implements BundleEventListener { return EventDispatcher.getInstance().queryVoid(EVENT_BOOTSTRAP_CANCEL); } - public @NonNull GeckoResult<BootstrapState> getBootstrapState() { - return EventDispatcher.getInstance().queryBundle(EVENT_BOOTSTRAP_GET_STATE).map(new GeckoResult.OnValueMapper<>() { - @AnyThread - @Nullable - public BootstrapState onValue(@Nullable GeckoBundle value) throws Throwable { - return new BootstrapState(value); - } - }); - } - public void registerBootstrapStateChangeListener(BootstrapStateChangeListener listener) { mBootstrapStateListeners.add(listener); } ===================================== toolkit/components/tor-launcher/TorProvider.sys.mjs ===================================== @@ -875,10 +875,7 @@ export class TorProvider { */ #processBootstrapStatus(statusObj, isNotification) { // Notify observers - Services.obs.notifyObservers( - { wrappedJSObject: statusObj }, - TorProviderTopics.BootstrapStatus - ); + Services.obs.notifyObservers(statusObj, TorProviderTopics.BootstrapStatus); if (statusObj.PROGRESS === 100) { this.#isBootstrapDone = true; ===================================== toolkit/modules/TorAndroidIntegration.sys.mjs ===================================== @@ -25,9 +25,13 @@ const logger = new ConsoleAPI({ prefix: "TorAndroidIntegration", }); -const EmittedEvents = Object.freeze( { +const EmittedEvents = Object.freeze({ settingsReady: "GeckoView:Tor:SettingsReady", settingsChanged: "GeckoView:Tor:SettingsChanged", + bootstrapStateChanged: "GeckoView:Tor:BootstrapStateChanged", + bootstrapProgress: "GeckoView:Tor:BootstrapProgress", + bootstrapComplete: "GeckoView:Tor:BootstrapComplete", + bootstrapError: "GeckoView:Tor:BootstrapError", }); const ListenedEvents = Object.freeze({ @@ -89,6 +93,30 @@ class TorAndroidIntegrationImpl { } break; case lazy.TorConnectTopics.StateChange: + lazy.EventDispatcher.instance.sendRequest({ + type: EmittedEvents.bootstrapStateChanged, + state: subj.wrappedJSObject.state ?? "", + }); + break; + case lazy.TorConnectTopics.BootstrapProgress: + lazy.EventDispatcher.instance.sendRequest({ + type: EmittedEvents.bootstrapProgress, + progress: subj.wrappedJSObject.progress ?? "", + status: subj.wrappedJSObject.status ?? 0, + hasWarnings: subj.wrappedJSObject.hasWarnings ?? false, + }); + break; + case lazy.TorConnectTopics.BootstrapComplete: + lazy.EventDispatcher.instance.sendRequest({ + type: EmittedEvents.bootstrapComplete, + }); + break; + case lazy.TorConnectTopics.BootstrapError: + lazy.EventDispatcher.instance.sendRequest({ + type: EmittedEvents.bootstrapError, + message: subj.wrappedJSObject.message ?? "", + details: subj.wrappedJSObject.details ?? "", + }); break; case lazy.TorSettingsTopics.Ready: lazy.EventDispatcher.instance.sendRequest({ ===================================== toolkit/modules/TorConnect.sys.mjs ===================================== @@ -7,6 +7,7 @@ import { setTimeout, clearTimeout } from "resource://gre/modules/Timer.sys.mjs"; const lazy = {}; ChromeUtils.defineESModuleGetters(lazy, { + EventDispatcher: "resource://gre/modules/Messaging.sys.mjs", MoatRPC: "resource://gre/modules/Moat.sys.mjs", TorBootstrapRequest: "resource://gre/modules/TorBootstrapRequest.sys.mjs", }); @@ -1092,6 +1093,12 @@ export const TorConnect = (() => { Further external commands and helper methods */ openTorPreferences() { + if (TorLauncherUtil.isAndroid) { + lazy.EventDispatcher.instance.sendRequest({ + type: "GeckoView:Tor:OpenSettings", + }); + return; + } const win = lazy.BrowserWindowTracker.getTopWindow(); win.switchToTabHavingURI("about:preferences#connection", true); }, View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/e9cc48… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/e9cc48… You're receiving this email because of your account on gitlab.torproject.org.
1 0
0 0
[Git][tpo/applications/tor-browser][tor-browser-115.6.0esr-13.5-1] 2 commits: fixup! Bug 42247: Android helpers for the TorProvider
by Pier Angelo Vendrame (@pierov) 20 Dec '23

20 Dec '23
Pier Angelo Vendrame pushed to branch tor-browser-115.6.0esr-13.5-1 at The Tor Project / Applications / Tor Browser Commits: 1edf6cd0 by Pier Angelo Vendrame at 2023-12-20T17:50:17+00:00 fixup! Bug 42247: Android helpers for the TorProvider Some wiring for TorSettings and TorConnect stuff and fixes to the one I created previously. - - - - - e9cc4840 by Dan Ballard at 2023-12-20T17:50:17+00:00 fixup! Bug 42247: Android helpers for the TorProvider Bug 42301: fix and implement loading settings and saving them to TorSettings.sys.mjs from Java - - - - - 6 changed files: - mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoRuntime.java - mobile/android/geckoview/src/main/java/org/mozilla/geckoview/TorIntegrationAndroid.java - + mobile/android/geckoview/src/main/java/org/mozilla/geckoview/TorSettings.java - + mobile/android/geckoview/src/main/java/org/mozilla/geckoview/androidlegacysettings/Prefs.java - + mobile/android/geckoview/src/main/java/org/mozilla/geckoview/androidlegacysettings/TorLegacyAndroidSettings.java - toolkit/modules/TorAndroidIntegration.sys.mjs Changes: ===================================== mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoRuntime.java ===================================== @@ -1008,6 +1008,14 @@ public final class GeckoRuntime implements Parcelable { return mPushController; } + /** + * Get the Tor integration controller for this runtime. + */ + @UiThread + public @NonNull TorIntegrationAndroid getTorIntegrationController() { + return mTorIntegration; + } + /** * Appends notes to crash report. * ===================================== mobile/android/geckoview/src/main/java/org/mozilla/geckoview/TorIntegrationAndroid.java ===================================== @@ -9,6 +9,10 @@ package org.mozilla.geckoview; import android.content.Context; import android.util.Log; +import androidx.annotation.AnyThread; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; + import java.io.BufferedReader; import java.io.File; import java.io.IOException; @@ -22,9 +26,9 @@ import java.nio.file.attribute.PosixFilePermission; import java.nio.file.attribute.PosixFilePermissions; import java.util.ArrayList; import java.util.HashMap; +import java.util.HashSet; import java.util.Map; import java.util.Set; -import java.util.UUID; import org.mozilla.gecko.EventDispatcher; import org.mozilla.gecko.GeckoAppShell; @@ -32,13 +36,27 @@ import org.mozilla.gecko.util.BundleEventListener; import org.mozilla.gecko.util.EventCallback; import org.mozilla.gecko.util.GeckoBundle; -/* package */ class TorIntegrationAndroid implements BundleEventListener { +import org.mozilla.geckoview.androidlegacysettings.TorLegacyAndroidSettings; + +public class TorIntegrationAndroid implements BundleEventListener { private static final String TAG = "TorIntegrationAndroid"; - private static final String TOR_EVENT_START = "GeckoView:Tor:StartTor"; - private static final String TOR_EVENT_STOP = "GeckoView:Tor:StopTor"; - private static final String MEEK_EVENT_START = "GeckoView:Tor:StartMeek"; - private static final String MEEK_EVENT_STOP = "GeckoView:Tor:StopMeek"; + // Events we listen to + private static final String EVENT_TOR_START = "GeckoView:Tor:StartTor"; + private static final String EVENT_TOR_STOP = "GeckoView:Tor:StopTor"; + private static final String EVENT_MEEK_START = "GeckoView:Tor:StartMeek"; + private static final String EVENT_MEEK_STOP = "GeckoView:Tor:StopMeek"; + + // Events we emit + private static final String EVENT_SETTINGS_GET = "GeckoView:Tor:SettingsGet"; + private static final String EVENT_SETTINGS_SET = "GeckoView:Tor:SettingsSet"; + private static final String EVENT_SETTINGS_APPLY = "GeckoView:Tor:SettingsApply"; + private static final String EVENT_SETTINGS_SAVE = "GeckoView:Tor:SettingsSave"; + private static final String EVENT_BOOTSTRAP_BEGIN = "GeckoView:Tor:BootstrapBegin"; + private static final String EVENT_BOOTSTRAP_BEGIN_AUTO = "GeckoView:Tor:BootstrapBeginAuto"; + private static final String EVENT_BOOTSTRAP_CANCEL = "GeckoView:Tor:BootstrapCancel"; + private static final String EVENT_BOOTSTRAP_GET_STATE = "GeckoView:Tor:BootstrapGetState"; + private static final String EVENT_SETTINGS_READY = "GeckoView:Tor:SettingsReady"; private static final String CONTROL_PORT_FILE = "/control-ipc"; private static final String SOCKS_FILE = "/socks-ipc"; @@ -63,7 +81,9 @@ import org.mozilla.gecko.util.GeckoBundle; private final HashMap<Integer, MeekTransport> mMeeks = new HashMap<>(); private int mMeekCounter; - public TorIntegrationAndroid(Context context) { + private TorSettings mSettings = null; + + /* package */ TorIntegrationAndroid(Context context) { mLibraryDir = context.getApplicationInfo().nativeLibraryDir; mCacheDir = context.getCacheDir().toPath(); mIpcDirectory = mCacheDir + "/tor-private"; @@ -71,7 +91,7 @@ import org.mozilla.gecko.util.GeckoBundle; registerListener(); } - public synchronized void shutdown() { + /* package */ synchronized void shutdown() { // FIXME: It seems this never gets called if (mTorProcess != null) { mTorProcess.shutdown(); @@ -83,22 +103,36 @@ import org.mozilla.gecko.util.GeckoBundle; EventDispatcher.getInstance() .registerUiThreadListener( this, - TOR_EVENT_START, - MEEK_EVENT_START, - MEEK_EVENT_STOP); + EVENT_TOR_START, + EVENT_MEEK_START, + EVENT_MEEK_STOP, + EVENT_SETTINGS_READY); } @Override // BundleEventListener public synchronized void handleMessage( final String event, final GeckoBundle message, final EventCallback callback) { - if (TOR_EVENT_START.equals(event)) { + if (EVENT_TOR_START.equals(event)) { startDaemon(message, callback); - } else if (TOR_EVENT_STOP.equals(event)) { + } else if (EVENT_TOR_STOP.equals(event)) { stopDaemon(message, callback); - } else if (MEEK_EVENT_START.equals(event)) { + } else if (EVENT_MEEK_START.equals(event)) { startMeek(message, callback); - } else if (MEEK_EVENT_STOP.equals(event)) { + } else if (EVENT_MEEK_STOP.equals(event)) { stopMeek(message, callback); + } else if (EVENT_SETTINGS_READY.equals(event)) { + loadSettings(message); + } + } + + private void loadSettings(GeckoBundle message) { + if (TorLegacyAndroidSettings.unmigrated()) { + mSettings = TorLegacyAndroidSettings.loadTorSettings(); + setSettings(mSettings); + TorLegacyAndroidSettings.setMigrated(); + } else { + GeckoBundle bundle = message.getBundle("settings"); + mSettings = new TorSettings(bundle); } } @@ -145,9 +179,9 @@ import org.mozilla.gecko.util.GeckoBundle; } class TorProcess extends Thread { - private static final String TOR_EVENT_STARTED = "GeckoView:Tor:TorStarted"; - private static final String TOR_EVENT_START_FAILED = "GeckoView:Tor:TorStartFailed"; - private static final String TOR_EVENT_EXITED = "GeckoView:Tor:TorExited"; + private static final String EVENT_TOR_STARTED = "GeckoView:Tor:TorStarted"; + private static final String EVENT_TOR_START_FAILED = "GeckoView:Tor:TorStartFailed"; + private static final String EVENT_TOR_EXITED = "GeckoView:Tor:TorExited"; private final String mHandle; private Process mProcess = null; @@ -202,14 +236,14 @@ import org.mozilla.gecko.util.GeckoBundle; final GeckoBundle data = new GeckoBundle(2); data.putString("handle", mHandle); data.putString("error", e.getMessage()); - EventDispatcher.getInstance().dispatch(TOR_EVENT_START_FAILED, data); + EventDispatcher.getInstance().dispatch(EVENT_TOR_START_FAILED, data); return; } Log.i(TAG, "Tor process " + mHandle + " started."); { final GeckoBundle data = new GeckoBundle(1); data.putString("handle", mHandle); - EventDispatcher.getInstance().dispatch(TOR_EVENT_STARTED, data); + EventDispatcher.getInstance().dispatch(EVENT_TOR_STARTED, data); } try { BufferedReader reader = new BufferedReader(new InputStreamReader(mProcess.getInputStream())); @@ -232,7 +266,7 @@ import org.mozilla.gecko.util.GeckoBundle; // FIXME: We usually don't reach this when the application is killed! // So, we don't do our cleanup. Log.i(TAG, "Tor process " + mHandle + " has exited."); - EventDispatcher.getInstance().dispatch(TOR_EVENT_EXITED, data); + EventDispatcher.getInstance().dispatch(EVENT_TOR_EXITED, data); } private void cleanIpcDirectory() { @@ -432,4 +466,71 @@ import org.mozilla.gecko.util.GeckoBundle; } } } + + public static class BootstrapState { + // FIXME: We can do better than this :) + public GeckoBundle mBundle; + + BootstrapState(GeckoBundle bundle) { + mBundle = bundle; + } + } + + public interface BootstrapStateChangeListener { + void onBootstrapStateChange(BootstrapState state); + } + + public @NonNull GeckoResult<GeckoBundle> getSettings() { + return EventDispatcher.getInstance().queryBundle(EVENT_SETTINGS_GET); + } + + public @NonNull GeckoResult<Void> setSettings(final TorSettings settings) { + return EventDispatcher.getInstance().queryVoid(EVENT_SETTINGS_SET, settings.asGeckoBundle()); + } + + public @NonNull GeckoResult<Void> applySettings() { + return EventDispatcher.getInstance().queryVoid(EVENT_SETTINGS_APPLY); + } + + public @NonNull GeckoResult<Void> saveSettings() { + return EventDispatcher.getInstance().queryVoid(EVENT_SETTINGS_SAVE); + } + + public @NonNull GeckoResult<Void> beginBootstrap() { + return EventDispatcher.getInstance().queryVoid(EVENT_BOOTSTRAP_BEGIN); + } + + public @NonNull GeckoResult<Void> beginAutoBootstrap(final String countryCode) { + final GeckoBundle bundle = new GeckoBundle(1); + bundle.putString("countryCode", countryCode); + return EventDispatcher.getInstance().queryVoid(EVENT_BOOTSTRAP_BEGIN_AUTO, bundle); + } + + public @NonNull GeckoResult<Void> beginAutoBootstrap() { + return beginAutoBootstrap(null); + } + + public @NonNull GeckoResult<Void> cancelBootstrap() { + return EventDispatcher.getInstance().queryVoid(EVENT_BOOTSTRAP_CANCEL); + } + + public @NonNull GeckoResult<BootstrapState> getBootstrapState() { + return EventDispatcher.getInstance().queryBundle(EVENT_BOOTSTRAP_GET_STATE).map(new GeckoResult.OnValueMapper<>() { + @AnyThread + @Nullable + public BootstrapState onValue(@Nullable GeckoBundle value) throws Throwable { + return new BootstrapState(value); + } + }); + } + + public void registerBootstrapStateChangeListener(BootstrapStateChangeListener listener) { + mBootstrapStateListeners.add(listener); + } + + public void unregisterBootstrapStateChangeListener(BootstrapStateChangeListener listener) { + mBootstrapStateListeners.remove(listener); + } + + private final HashSet<BootstrapStateChangeListener> mBootstrapStateListeners = new HashSet<>(); } ===================================== mobile/android/geckoview/src/main/java/org/mozilla/geckoview/TorSettings.java ===================================== @@ -0,0 +1,172 @@ +package org.mozilla.geckoview; + +import android.util.Log; + +import org.json.JSONArray; +import org.json.JSONObject; +import org.mozilla.gecko.util.GeckoBundle; + +import java.io.ByteArrayInputStream; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.PrintStream; +import java.io.SequenceInputStream; +import java.io.UnsupportedEncodingException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Locale; +import java.util.stream.Collectors; + +public class TorSettings { + + public enum BridgeSource { + Invalid(-1), + BuiltIn(0), + BridgeDB(1), + UserProvided(2); + + private int source; + + BridgeSource(final int source) { + this.source = source; + } + + public static BridgeSource fromInt(int i) { + switch (i) { + case -1: return Invalid; + case 0: return BuiltIn; + case 1: return BridgeDB; + case 2: return UserProvided; + } + return Invalid; + } + + public int toInt() { + return this.source; + } + } + + public enum ProxyType { + Invalid(-1), + Socks4(0), + Socks5(1), + HTTPS(2); + + private int type; + + ProxyType(final int type) { + this.type = type; + } + + public int toInt() { + return type; + } + + public static ProxyType fromInt(int i) { + switch (i) { + case -1: return Invalid; + case 0: return Socks4; + case 1: return Socks5; + case 2: return HTTPS; + } + return Invalid; + } + } + + private boolean loaded = false; + + public boolean enabled = true; + + public boolean quickstart = false; + + // bridges section + public boolean bridgesEnabled = false; + public BridgeSource bridgesSource = BridgeSource.Invalid; + public String bridgesBuiltinType = ""; + public String[] bridgeBridgeStrings; + + // proxy section + public boolean proxyEnabled = false; + public ProxyType proxyType = ProxyType.Invalid; + public String proxyAddress = ""; + public int proxyPort = 0; + public String proxyUsername = ""; + public String proxyPassword = ""; + + // firewall section + public boolean firewallEnabled = false; + public int[] firewallAllowedPorts; + + public TorSettings() { + } + + public TorSettings(GeckoBundle bundle) { + try { + GeckoBundle qs = bundle.getBundle("quickstart"); + GeckoBundle bridges = bundle.getBundle("bridges"); + GeckoBundle proxy = bundle.getBundle("proxy"); + GeckoBundle firewall = bundle.getBundle("firewall"); + + bridgesEnabled = bridges.getBoolean("enabled"); + bridgesSource = BridgeSource.fromInt(bridges.getInt("source")); + bridgesBuiltinType = bridges.getString("builtin_type"); + bridgeBridgeStrings = bridges.getStringArray("bridge_strings"); + + quickstart = qs.getBoolean("enabled"); + + firewallEnabled = firewall.getBoolean("enabled"); + firewallAllowedPorts = firewall.getIntArray("allowed_ports"); + + proxyEnabled = proxy.getBoolean("enabled"); + proxyAddress = proxy.getString("address"); + proxyUsername = proxy.getString("username"); + proxyPassword = proxy.getString("password"); + proxyPort = proxy.getInt("port"); + proxyType = ProxyType.fromInt(proxy.getInt("type")); + + loaded = true; + } catch (Exception e) { + Log.e("TorSettings", "bundle access error: " + e.toString(), e); + } + } + + public GeckoBundle asGeckoBundle() { + GeckoBundle bundle = new GeckoBundle(); + + GeckoBundle qs = new GeckoBundle(); + GeckoBundle bridges = new GeckoBundle(); + GeckoBundle proxy = new GeckoBundle(); + GeckoBundle firewall = new GeckoBundle(); + + bridges.putBoolean("enabled", bridgesEnabled); + bridges.putInt("source", bridgesSource.toInt()); + bridges.putString("builtin_type", bridgesBuiltinType); + bridges.putStringArray("bridge_strings", bridgeBridgeStrings); + + qs.putBoolean("enabled", quickstart); + + firewall.putBoolean("enabled", firewallEnabled); + firewall.putIntArray("allowed_ports", firewallAllowedPorts); + + proxy.putBoolean("enabled", proxyEnabled); + proxy.putString("address", proxyAddress); + proxy.putString("username", proxyUsername); + proxy.putString("password", proxyPassword); + proxy.putInt("port", proxyPort); + proxy.putInt("type", proxyType.toInt()); + + bundle.putBundle("quickstart", qs); + bundle.putBundle("bridges", bridges); + bundle.putBundle("proxy", proxy); + bundle.putBundle("firewall", firewall); + + return bundle; + } + + public boolean isLoaded() { + return this.loaded; + } +} ===================================== mobile/android/geckoview/src/main/java/org/mozilla/geckoview/androidlegacysettings/Prefs.java ===================================== @@ -0,0 +1,64 @@ +package org.mozilla.geckoview.androidlegacysettings; + +import android.content.Context; +import android.content.SharedPreferences; +import org.mozilla.gecko.GeckoAppShell; + +import java.util.Locale; + +// tor-android-service utils/Prefs.java + +/* package */ class Prefs { + private final static String PREF_BRIDGES_ENABLED = "pref_bridges_enabled"; + private final static String PREF_BRIDGES_LIST = "pref_bridges_list"; + + private static SharedPreferences prefs; + + // OrbotConstants + private final static String PREF_TOR_SHARED_PREFS = "org.torproject.android_preferences"; + + + // tor-android-service utils/TorServiceUtil.java + + private static void setContext() { + if (prefs == null) { + prefs = GeckoAppShell.getApplicationContext().getSharedPreferences(PREF_TOR_SHARED_PREFS, + Context.MODE_MULTI_PROCESS); + } + } + + public static boolean getBoolean(String key, boolean def) { + setContext(); + return prefs.getBoolean(key, def); + } + + public static void putBoolean(String key, boolean value) { + setContext(); + prefs.edit().putBoolean(key, value).apply(); + } + + public static void putString(String key, String value) { + setContext(); + prefs.edit().putString(key, value).apply(); + } + + public static String getString(String key, String def) { + setContext(); + return prefs.getString(key, def); + } + + public static boolean bridgesEnabled() { + setContext(); + return prefs.getBoolean(PREF_BRIDGES_ENABLED, false); + } + + public static String getBridgesList() { + setContext(); + // was "meek" for (Locale.getDefault().getLanguage().equals("fa")) and "obfs4" for the rest from a 2019 commit + // but that has stopped representing a good default sometime since so not importing for new users + String list = prefs.getString(PREF_BRIDGES_LIST, ""); + return list; + } + + +} ===================================== mobile/android/geckoview/src/main/java/org/mozilla/geckoview/androidlegacysettings/TorLegacyAndroidSettings.java ===================================== @@ -0,0 +1,84 @@ +package org.mozilla.geckoview.androidlegacysettings; + +import java.io.IOException; + +import android.content.SharedPreferences; + +import org.mozilla.gecko.GeckoAppShell; + +import org.mozilla.geckoview.TorSettings; + +public class TorLegacyAndroidSettings { + + private static String PREF_USE_MOZ_PREFS = "tor_use_moz_prefs"; + + public static boolean unmigrated() { + return !Prefs.getBoolean(PREF_USE_MOZ_PREFS, false); + } + + public static void setUnmigrated() { + Prefs.putBoolean(PREF_USE_MOZ_PREFS, false); + } + + public static void setMigrated() { + Prefs.putBoolean(PREF_USE_MOZ_PREFS, true); + } + + public static TorSettings loadTorSettings() { + TorSettings settings = new TorSettings(); + + // always true, tor is enabled in TB + settings.enabled = true; + + // firefox-android disconnected quick start a while ago so it's untracked + settings.quickstart = false; + + settings.bridgesEnabled = Prefs.bridgesEnabled(); + + // tor-android-service CustomTorInstaller.java +/* + BridgesList is an overloaded field, which can cause some confusion. + The list can be: + 1) a filter like obfs4, meek, or snowflake OR + 2) it can be a custom bridge + For (1), we just pass back all bridges, the filter will occur + elsewhere in the library. + For (2) we return the bridge list as a raw stream. + If length is greater than 9, then we know this is a custom bridge + */ + String userDefinedBridgeList = Prefs.getBridgesList(); + boolean userDefinedBridge = userDefinedBridgeList.length() > 9; + // Terrible hack. Must keep in sync with topl::addBridgesFromResources. + if (!userDefinedBridge) { + settings.bridgesSource = TorSettings.BridgeSource.BuiltIn; + switch (userDefinedBridgeList) { + case "obfs4": + settings.bridgesBuiltinType = "objs4"; + break; + case "meek": + settings.bridgesBuiltinType = "meek_azure"; + break; + case "snowflake": + settings.bridgesBuiltinType = "snowflake"; + break; + default: + settings.bridgesSource = TorSettings.BridgeSource.Invalid; + break; + } + } else { + settings.bridgesSource = TorSettings.BridgeSource.UserProvided; // user provided + settings.bridgeBridgeStrings = userDefinedBridgeList.split("\r\n"); + } + + // Tor Browser Android doesn't take proxy and firewall settings + settings.proxyEnabled = false; + + settings.firewallEnabled = false; + settings.firewallAllowedPorts = new int[0]; + + return settings; + } +} + + + ===================================== toolkit/modules/TorAndroidIntegration.sys.mjs ===================================== @@ -8,6 +8,8 @@ const lazy = {}; ChromeUtils.defineESModuleGetters(lazy, { EventDispatcher: "resource://gre/modules/Messaging.sys.mjs", TorConnect: "resource://gre/modules/TorConnect.sys.mjs", + TorConnectTopics: "resource://gre/modules/TorConnect.sys.mjs", + TorSettingsTopics: "resource://gre/modules/TorSettings.sys.mjs", TorProviderBuilder: "resource://gre/modules/TorProviderBuilder.sys.mjs", TorSettings: "resource://gre/modules/TorSettings.sys.mjs", }); @@ -23,11 +25,22 @@ const logger = new ConsoleAPI({ prefix: "TorAndroidIntegration", }); +const EmittedEvents = Object.freeze( { + settingsReady: "GeckoView:Tor:SettingsReady", + settingsChanged: "GeckoView:Tor:SettingsChanged", +}); + const ListenedEvents = Object.freeze({ settingsGet: "GeckoView:Tor:SettingsGet", + // The data is passed directly to TorSettings. settingsSet: "GeckoView:Tor:SettingsSet", settingsApply: "GeckoView:Tor:SettingsApply", settingsSave: "GeckoView:Tor:SettingsSave", + bootstrapBegin: "GeckoView:Tor:BootstrapBegin", + // Optionally takes a countryCode, as data.countryCode. + bootstrapBeginAuto: "GeckoView:Tor:BootstrapBeginAuto", + bootstrapCancel: "GeckoView:Tor:BootstrapCancel", + bootstrapGetState: "GeckoView:Tor:BootstrapGetState", }); class TorAndroidIntegrationImpl { @@ -41,6 +54,14 @@ class TorAndroidIntegrationImpl { this.#bootstrapMethodReset(); Services.prefs.addObserver(Prefs.useNewBootstrap, this); + + for (const topic in lazy.TorConnectTopics) { + Services.obs.addObserver(this, lazy.TorConnectTopics[topic]); + } + + for (const topic in lazy.TorSettingsTopics) { + Services.obs.addObserver(this, lazy.TorSettingsTopics[topic]); + } } async #initNewBootstrap() { @@ -67,6 +88,14 @@ class TorAndroidIntegrationImpl { this.#bootstrapMethodReset(); } break; + case lazy.TorConnectTopics.StateChange: + break; + case lazy.TorSettingsTopics.Ready: + lazy.EventDispatcher.instance.sendRequest({ + type: EmittedEvents.settingsReady, + settings: lazy.TorSettings.getSettings(), + }); + break; } } @@ -74,24 +103,36 @@ class TorAndroidIntegrationImpl { logger.debug(`Received event ${event}`, data); try { switch (event) { - case settingsGet: + case ListenedEvents.settingsGet: callback?.onSuccess(lazy.TorSettings.getSettings()); return; - case settingsSet: + case ListenedEvents.settingsSet: // This does not throw, so we do not have any way to report the error! lazy.TorSettings.setSettings(data); break; - case settingsApply: + case ListenedEvents.settingsApply: await lazy.TorSettings.applySettings(); break; - case settingsSave: + case ListenedEvents.settingsSave: await lazy.TorSettings.saveSettings(); break; + case ListenedEvents.bootstrapBegin: + lazy.TorConnect.beginBootstrap(); + break; + case ListenedEvents.bootstrapBeginAuto: + lazy.TorConnect.beginAutoBootstrap(data.countryCode); + break; + case ListenedEvents.bootstrapCancel: + lazy.TorConnect.cancelBootstrap(); + break; + case ListenedEvents.bootstrapGetState: + callback?.onSuccess(lazy.TorConnect.state); + return; } callback?.onSuccess(); } catch (e) { - logger.error(); - callback?.sendError(e); + logger.error(`Error while handling event ${event}`, e); + callback?.onError(e); } } View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/d823a7… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/d823a7… You're receiving this email because of your account on gitlab.torproject.org.
1 0
0 0
[Git][tpo/applications/tor-browser-build] Pushed new tag tbb-13.0.8-build1
by richard (@richard) 20 Dec '23

20 Dec '23
richard pushed new tag tbb-13.0.8-build1 at The Tor Project / Applications / tor-browser-build -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/tree/tbb… You're receiving this email because of your account on gitlab.torproject.org.
1 0
0 0
[Git][tpo/applications/tor-browser-build][maint-13.0] Bug 41055: Prepare Tor Browser 13.0.8
by richard (@richard) 20 Dec '23

20 Dec '23
richard pushed to branch maint-13.0 at The Tor Project / Applications / tor-browser-build Commits: 2ff8efa4 by Richard Pospesel at 2023-12-20T16:22:50+00:00 Bug 41055: Prepare Tor Browser 13.0.8 - - - - - 2 changed files: - projects/browser/Bundle-Data/Docs-TBB/ChangeLog.txt - rbm.conf Changes: ===================================== projects/browser/Bundle-Data/Docs-TBB/ChangeLog.txt ===================================== @@ -1,3 +1,14 @@ +Tor Browser 13.0.8 - December 20 2023 + * Windows + * Bug 41053: All PT's crash instantly in 13.0.7 [tor-browser-build] + * Bug 42179: PTs on Tor Browser 13 do not work with Windows 7 [tor-browser] + * Linux + * Bug 41050: Improve the disk leak sanitization on start-$browser [tor-browser-build] + * Build System + * All Platforms + * Bug 41042: Add options to include updates in the changelog scripts [tor-browser-build] + * Bug 41043: Create script to push build requests to Mullvad build servers [tor-browser-build] + Tor Browser 13.0.7 - December 19 2023 * All Platforms * Updated tor to 0.4.8.10 ===================================== rbm.conf ===================================== @@ -81,12 +81,12 @@ buildconf: git_signtag_opt: '-s' var: - torbrowser_version: '13.0.7' + torbrowser_version: '13.0.8' torbrowser_build: 'build1' torbrowser_incremental_from: + - '13.0.7' - '13.0.6' - '13.0.5' - - '13.0.1' updater_enabled: 1 build_mar: 1 mar_channel_id: '[% c("var/projectname") %]-torproject-[% c("var/channel") %]' View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/commit/2… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/commit/2… You're receiving this email because of your account on gitlab.torproject.org.
1 0
0 0
[Git][tpo/applications/tor-browser-build][maint-13.0] Bug 41053: Use Go 1.20 on Windows, except for Snowflake
by richard (@richard) 20 Dec '23

20 Dec '23
richard pushed to branch maint-13.0 at The Tor Project / Applications / tor-browser-build Commits: 346521f9 by Pier Angelo Vendrame at 2023-12-20T16:21:41+00:00 Bug 41053: Use Go 1.20 on Windows, except for Snowflake Go 1.21 removed support for Windows 7 and 8. However, Firefox still supports them, so some users try Tor Browser but cannot use PTs. We cannot replicate the problem on our Windows 7 systems, but using Go 1.20.x for Windows should solve the problem for them. Snowflake is still on 1.21 because it is needed for some Pion changes. - - - - - 1 changed file: - projects/go/config Changes: ===================================== projects/go/config ===================================== @@ -1,10 +1,11 @@ # vim: filetype=yaml sw=2 -version: 1.21.5 +version: '[% IF c("var/use_go_1_20") %]1.20.12[% ELSE %]1.21.5[% END %]' filename: '[% project %]-[% c("version") %]-[% c("var/osname") %]-[% c("var/build_id") %].tar.[% c("compress_tar") %]' container: use_container: 1 var: + use_go_1_20: 0 setup: | mkdir -p /var/tmp/dist tar -C /var/tmp/dist -xf $rootdir/[% c("go_tarfile") %] @@ -72,6 +73,7 @@ targets: windows: var: GOOS: windows + use_go_1_20: '[% c("origin_project") != "snowflake" %]' windows-i686: var: GOARCH: 386 @@ -117,9 +119,14 @@ input_files: - name: '[% c("var/compiler") %]' project: '[% c("var/compiler") %]' enable: '[% ! c("var/linux") %]' - - URL: 'https://golang.org/dl/go[% c("version") %].src.tar.gz' + - URL: 'https://go.dev/dl/go[% c("version") %].src.tar.gz' name: go sha256sum: 285cbbdf4b6e6e62ed58f370f3f6d8c30825d6e56c5853c66d3c23bcdb09db19 + enable: '[% !c("var/use_go_1_20") %]' + - URL: 'https://go.dev/dl/go[% c("version") %].src.tar.gz' + name: go + sha256sum: c5bf934751d31c315c1d0bb5fb02296545fa6d08923566f7a5afec81f2ed27d6 + enable: '[% c("var/use_go_1_20") %]' - project: go-bootstrap name: go-bootstrap target_replace: View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/commit/3… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/commit/3… You're receiving this email because of your account on gitlab.torproject.org.
1 0
0 0
[Git][tpo/applications/tor-browser][tor-browser-115.6.0esr-13.5-1] fixup! Bug 40458: Implement .tor.onion aliases
by ma1 (@ma1) 20 Dec '23

20 Dec '23
ma1 pushed to branch tor-browser-115.6.0esr-13.5-1 at The Tor Project / Applications / Tor Browser Commits: d823a7e7 by hackademix at 2023-12-20T17:06:45+01:00 fixup! Bug 40458: Implement .tor.onion aliases Bug 42099: Blind cross-site .onion requests. - - - - - 3 changed files: - browser/components/onionservices/OnionAliasStore.sys.mjs - + browser/components/onionservices/TorRequestWatch.sys.mjs - browser/components/onionservices/moz.build Changes: ===================================== browser/components/onionservices/OnionAliasStore.sys.mjs ===================================== @@ -7,6 +7,7 @@ const lazy = {}; ChromeUtils.defineESModuleGetters(lazy, { JSONFile: "resource://gre/modules/JSONFile.sys.mjs", + TorRequestWatch: "resource:///modules/TorRequestWatch.sys.mjs", }); /* OnionAliasStore observer topics */ @@ -272,6 +273,7 @@ class _OnionAliasStore { } async init() { + lazy.TorRequestWatch.start(); await this._loadSettings(); if (this.enabled) { await this._startUpdates(); @@ -286,6 +288,7 @@ class _OnionAliasStore { } this._rulesetTimeout = null; Services.prefs.removeObserver(kPrefOnionAliasEnabled, this); + lazy.TorRequestWatch.stop(); } async getChannels() { ===================================== browser/components/onionservices/TorRequestWatch.sys.mjs ===================================== @@ -0,0 +1,124 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/* + * This module implements Tor-specific Web Request policies, such as + * preventing observable cross-site requests to .tor.onion and .bit.onion sites. + */ + +import { ConsoleAPI } from "resource://gre/modules/Console.sys.mjs"; + +const log = new ConsoleAPI({ + maxLogLevel: "warn", + maxLogLevelPref: "browser.torRequestWatch.log_level", + prefix: "TorRequestWatch", +}); + +class RequestObserver { + static #topics = [ + "http-on-modify-request", + "http-on-examine-response", + "http-on-examine-cached-response", + "http-on-examine-merged-response", + ]; + #asObserver(addOrRemove) { + const action = Services.obs[`${addOrRemove}Observer`].bind(Services.obs); + for (const topic of RequestObserver.#topics) { + action(this, topic); + } + } + + start() { + this.#asObserver("add"); + log.debug("Started"); + } + stop() { + this.#asObserver("remove"); + log.debug("Stopped"); + } + + // nsIObserver implementation + observe(subject, topic, data) { + try { + let channel = ChannelWrapper.get( + subject.QueryInterface(Ci.nsIHttpChannel) + ); + switch (topic) { + case "http-on-modify-request": + this.onRequest(channel); + break; + case "http-on-examine-cached-response": + case "http-on-examine-merged-response": + channel.isCached = true; + // falls through + case "http-on-examine-response": + this.onResponse(channel); + break; + } + } catch (e) { + log.error(e); + } + } + + onRequest(channel) { + if (this.shouldBlind(channel, channel.documentURL)) { + log.warn(`Blocking cross-site ${channel.finalURL} ${channel.type} load.`); + channel.cancel(Cr.NS_ERROR_ABORT); + } + } + onResponse(channel) { + if (!channel.documentURL && this.shouldBlind(channel, channel.originURL)) { + const COOP = "cross-origin-opener-policy"; + // we break window.opener references if needed to mitigate XS-Leaks + for (let h of channel.getResponseHeaders()) { + if (h.name.toLowerCase() === COOP && h.value === "same-origin") { + log.debug(`${COOP} is already same-origin, nothing to do.`); + return; + } + } + log.warn(`Blinding cross-site ${channel.finalURL} load.`); + channel.setResponseHeader(COOP, "same-origin-allow-popups"); + } + } + + isCrossOrigin(url1, url2) { + return new URL(url1).origin !== new URL(url2).origin; + } + shouldBlindCrossOrigin(uri) { + try { + let { host } = uri; + if (host.endsWith(".onion")) { + const previousPart = host.slice(-10, -6); + return ( + previousPart && (previousPart === ".tor" || previousPart === ".bit") + ); + } + } catch (e) { + // no host + } + return false; + } + shouldBlind(channel, sourceURL) { + return ( + sourceURL && + this.shouldBlindCrossOrigin(channel.finalURI) && + this.isCrossOrigin(channel.finalURL, sourceURL) + ); + } +} + +let observer; +export const TorRequestWatch = { + start() { + if (!observer) { + (observer = new RequestObserver()).start(); + } + }, + stop() { + if (observer) { + observer.stop(); + observer = null; + } + }, +}; ===================================== browser/components/onionservices/moz.build ===================================== @@ -4,4 +4,5 @@ EXTRA_JS_MODULES += [ "OnionAliasStore.sys.mjs", "OnionLocationChild.sys.mjs", "OnionLocationParent.sys.mjs", + "TorRequestWatch.sys.mjs", ] View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/d823a7e… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/d823a7e… You're receiving this email because of your account on gitlab.torproject.org.
1 0
0 0
[Git][tpo/applications/tor-browser-build][main] Bug 41053: Use Go 1.20 on Windows, except for Snowflake
by Pier Angelo Vendrame (@pierov) 20 Dec '23

20 Dec '23
Pier Angelo Vendrame pushed to branch main at The Tor Project / Applications / tor-browser-build Commits: 22731a74 by Pier Angelo Vendrame at 2023-12-20T10:14:18+01:00 Bug 41053: Use Go 1.20 on Windows, except for Snowflake Go 1.21 removed support for Windows 7 and 8. However, Firefox still supports them, so some users try Tor Browser but cannot use PTs. We cannot replicate the problem on our Windows 7 systems, but using Go 1.20.x for Windows should solve the problem for them. Snowflake is still on 1.21 because it is needed for some Pion changes. - - - - - 1 changed file: - projects/go/config Changes: ===================================== projects/go/config ===================================== @@ -1,10 +1,11 @@ # vim: filetype=yaml sw=2 -version: 1.21.5 +version: '[% IF c("var/use_go_1_20") %]1.20.12[% ELSE %]1.21.5[% END %]' filename: '[% project %]-[% c("version") %]-[% c("var/osname") %]-[% c("var/build_id") %].tar.[% c("compress_tar") %]' container: use_container: 1 var: + use_go_1_20: 0 setup: | mkdir -p /var/tmp/dist tar -C /var/tmp/dist -xf $rootdir/[% c("go_tarfile") %] @@ -72,6 +73,7 @@ targets: windows: var: GOOS: windows + use_go_1_20: '[% c("origin_project") != "snowflake" %]' windows-i686: var: GOARCH: 386 @@ -117,9 +119,14 @@ input_files: - name: '[% c("var/compiler") %]' project: '[% c("var/compiler") %]' enable: '[% ! c("var/linux") %]' - - URL: 'https://golang.org/dl/go[% c("version") %].src.tar.gz' + - URL: 'https://go.dev/dl/go[% c("version") %].src.tar.gz' name: go sha256sum: 285cbbdf4b6e6e62ed58f370f3f6d8c30825d6e56c5853c66d3c23bcdb09db19 + enable: '[% !c("var/use_go_1_20") %]' + - URL: 'https://go.dev/dl/go[% c("version") %].src.tar.gz' + name: go + sha256sum: c5bf934751d31c315c1d0bb5fb02296545fa6d08923566f7a5afec81f2ed27d6 + enable: '[% c("var/use_go_1_20") %]' - project: go-bootstrap name: go-bootstrap target_replace: View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/commit/2… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/commit/2… You're receiving this email because of your account on gitlab.torproject.org.
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 304
  • 305
  • 306
  • 307
  • 308
  • 309
  • 310
  • ...
  • 1864
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.