Verified Commit 91e057ca authored by cypherpunks1's avatar cypherpunks1 Committed by ma1
Browse files

fixup! Bug 23247: Communicating security expectations for .onion

Bug 42231: Improve the network monitor patch for http onion resources
parent 92139ee5
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -41,7 +41,7 @@ class SecurityState extends Component {

    const {
      securityState,
      urlDetails: { isLocal },
      urlDetails: { host, isLocal },
    } = item;
    const iconClassList = ["requests-security-state-icon"];

@@ -50,7 +50,11 @@ class SecurityState extends Component {

    // Locally delivered files such as http://localhost and file:// paths
    // are considered to have been delivered securely.
    if (isLocal) {
    if (
      isLocal ||
      (host?.endsWith(".onion") &&
        Services.prefs.getBoolPref("dom.securecontext.allowlist_onions", false))
    ) {
      realSecurityState = "secure";
    }

+1 −8
Original line number Diff line number Diff line
@@ -596,9 +596,6 @@ export var NetworkHelper = {

    // The request did not contain any security info.
    if (!securityInfo) {
      if (httpActivity.hostname && httpActivity.hostname.endsWith(".onion")) {
        info.state = "secure";
      }
      return info;
    }

@@ -650,11 +647,7 @@ export var NetworkHelper = {
        // schemes other than https and wss are subject to
        // downgrade/etc at the scheme level and should always be
        // considered insecure
        if (httpActivity.hostname && httpActivity.hostname.endsWith(".onion")) {
          info.state = "secure";
        } else {
        info.state = "insecure";
        }
      } else if (state & wpl.STATE_IS_SECURE) {
        // The connection is secure if the scheme is sufficient
        info.state = "secure";