Commit fc4e597b authored by Pier Angelo Vendrame's avatar Pier Angelo Vendrame 🎃 Committed by brizental
Browse files

TB 40458: Implement .tor.onion aliases

We have enabled HTTPS-Only mode, therefore we do not need
HTTPS-Everywhere anymore.
However, we want to keep supporting .tor.onion aliases (especially for
securedrop).
Therefore, in this patch we implemented the parsing of HTTPS-Everywhere
rulesets, and the redirect of .tor.onion domains.
Actually, Tor Browser believes they are actual domains. We change them
on the fly on the SOCKS proxy requests to resolve the domain, and on
the code that verifies HTTPS certificates.
parent f0a0fd4a
Loading
Loading
Loading
Loading
+2 −0
Changes for browser/app/profile/000-tor-browser.js: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -143,3 +143,5 @@ pref("browser.torcircuitpanel.loglevel", "Log");
pref("browser.tor_android.log_level", "Info");
pref("browser.dragdropfilter.log_level", "Warn");
pref("browser.onionAuthPrompt.loglevel", "Warn");
pref("browser.onionalias.log_level", "Warn");
pref("browser.torRequestWatch.log_level", "Warn");
+2 −0
Changes for browser/components/BrowserComponents.manifest: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -127,6 +127,7 @@ category browser-first-window-ready moz-src:///browser/modules/ClipboardPrivacy.
category browser-first-window-ready moz-src:///browser/modules/SecurityLevelNotification.sys.mjs SecurityLevelNotification.ready
category browser-first-window-ready moz-src:///toolkit/modules/DragDropFilter.sys.mjs DragDropFilter.init
category browser-first-window-ready moz-src:///browser/modules/TorSettingsNotification.sys.mjs TorSettingsNotification.ready
category browser-first-window-ready moz-src:///browser/components/onionservices/OnionAliasStore.sys.mjs OnionAliasStore.init

category browser-idle-startup moz-src:///browser/components/places/PlacesUIUtils.sys.mjs PlacesUIUtils.unblockToolbars
category browser-idle-startup resource:///modules/BuiltInThemes.sys.mjs BuiltInThemes.ensureBuiltInThemes
@@ -174,5 +175,6 @@ category browser-quit-application-granted resource://gre/modules/UpdateListener.
#endif
category browser-quit-application-granted moz-src:///browser/components/urlbar/UrlbarSearchTermsPersistence.sys.mjs UrlbarSearchTermsPersistence.uninit
category browser-quit-application-granted moz-src:///browser/components/ipprotection/IPProtectionHelpers.sys.mjs IPProtectionActivator.uninit
category browser-quit-application-granted moz-src:///browser/components/onionservices/OnionAliasStore.sys.mjs OnionAliasStore.uninit

category browser-newtab-external-component moz-src:///browser/components/search/SearchUIUtils.sys.mjs SearchNewTabComponentsRegistrant
+13 −0
Changes for browser/components/DesktopActorRegistry.sys.mjs: 13 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -737,6 +737,19 @@ let JSWINDOWACTORS = {
    enablePreference: "accessibility.blockautorefresh",
  },

  Rulesets: {
    parent: {
      esModuleURI: "resource:///modules/RulesetsParent.sys.mjs",
    },
    child: {
      esModuleURI: "resource:///modules/RulesetsChild.sys.mjs",
      events: {
        DOMWindowCreated: {},
      },
    },
    matches: ["about:rulesets*"],
  },

  ScreenshotsComponent: {
    parent: {
      esModuleURI:
+5 −0
Changes for browser/components/about/AboutRedirector.cpp: 5 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -112,6 +112,11 @@ static const RedirEntry kRedirMap[] = {
     nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT |
         nsIAboutModule::ALLOW_SCRIPT},
#endif
    {"rulesets", "chrome://browser/content/rulesets/aboutRulesets.html",
     nsIAboutModule::ALLOW_SCRIPT | nsIAboutModule::URI_MUST_LOAD_IN_CHILD |
         nsIAboutModule::URI_CAN_LOAD_IN_PRIVILEGEDABOUT_PROCESS |
         nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT |
         nsIAboutModule::IS_SECURE_CHROME_UI},
    {"sessionrestore", "chrome://browser/content/aboutSessionRestore.xhtml",
     nsIAboutModule::ALLOW_SCRIPT | nsIAboutModule::HIDE_FROM_ABOUTABOUT |
         nsIAboutModule::IS_SECURE_CHROME_UI},
+1 −0
Changes for browser/components/about/components.conf: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ pages = [
    'restartrequired',
    # Removed 'rights'. tor-browser#43901.
    # Removed 'robots'. tor-browser#42831.
    'rulesets',
    'sessionrestore',
    'settings',
    'tabcrashed',
Loading