Commit 76bbd8f4 authored by Pier Angelo Vendrame's avatar Pier Angelo Vendrame 🎃
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 94349b10
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -142,3 +142,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
Original line number Diff line number Diff line
@@ -171,6 +171,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
@@ -218,5 +219,6 @@ category browser-quit-application-granted moz-src:///browser/components/search/S
category browser-quit-application-granted resource://gre/modules/UpdateListener.sys.mjs UpdateListener.reset
#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/onionservices/OnionAliasStore.sys.mjs OnionAliasStore.uninit

category browser-newtab-external-component moz-src:///browser/components/search/SearchUIUtils.sys.mjs SearchNewTabComponentsRegistrant
+15 −0
Original line number Diff line number Diff line
@@ -765,6 +765,21 @@ let JSWINDOWACTORS = {
    safeForUntrustedWebProcess: true,
  },

  Rulesets: {
    parent: {
      esModuleURI:
        "moz-src:///browser/components/rulesets/RulesetsParent.sys.mjs",
    },
    child: {
      esModuleURI:
        "moz-src:///browser/components/rulesets/RulesetsChild.sys.mjs",
      events: {
        DOMWindowCreated: {},
      },
    },
    matches: ["about:rulesets*"],
  },

  ScreenshotsComponent: {
    parent: {
      esModuleURI:
+5 −0
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
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