[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor-launcher/master] Bug 40002: After rebasing to 80.0b2 moat is broken



commit 9f77f5a02cd02b71fdb06fd934de26569d6876be
Author: Kathy Brade <brade@xxxxxxxxxxxxxxxxx>
Date:   Tue Aug 18 13:59:24 2020 -0400

    Bug 40002: After rebasing to 80.0b2 moat is broken
    
    Mozilla renamed some of the nsILoadInfo security flags.
---
 src/modules/tl-bridgedb.jsm | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/modules/tl-bridgedb.jsm b/src/modules/tl-bridgedb.jsm
index 8cc7919..6f088e1 100644
--- a/src/modules/tl-bridgedb.jsm
+++ b/src/modules/tl-bridgedb.jsm
@@ -1,4 +1,4 @@
-// Copyright (c) 2019, The Tor Project, Inc.
+// Copyright (c) 2020, The Tor Project, Inc.
 // See LICENSE for licensing information.
 //
 // vim: set sw=2 sts=2 ts=8 et syntax=javascript:
@@ -546,10 +546,18 @@ _MoatRequestor.prototype =
 
     // There does not seem to be a way to directly create an nsILoadInfo from
     // JavaScript, so we create a throw away non-proxied channel to get one.
+    // In Firefox 80 the nsILoadInfo security flags were renamed. When
+    // backwards compatibility with older Firefox code is no longer a
+    // requirement we can remove the following conditional and always use
+    // Ci.nsILoadInfo.SEC_ALLOW_CROSS_ORIGIN_SEC_CONTEXT_IS_NULL.
+    const secFlags =
+      "SEC_ALLOW_CROSS_ORIGIN_SEC_CONTEXT_IS_NULL" in Ci.nsILoadInfo
+        ? Ci.nsILoadInfo.SEC_ALLOW_CROSS_ORIGIN_SEC_CONTEXT_IS_NULL
+        : Ci.nsILoadInfo.SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL;
     let loadInfo = Services.io.newChannelFromURI(uri, undefined,
                         Services.scriptSecurityManager.getSystemPrincipal(),
                         undefined,
-                        Ci.nsILoadInfo.SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL,
+                        secFlags,
                         Ci.nsIContentPolicy.TYPE_OTHER).loadInfo;
     let httpHandler = Services.io.getProtocolHandler("http")
                                  .QueryInterface(Ci.nsIHttpProtocolHandler);

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits