Pier Angelo Vendrame pushed to branch tor-browser-140.11.0esr-15.0-1 at The Tor Project / Applications / Tor Browser

Commits:

4 changed files:

Changes:

  • browser/app/profile/000-tor-browser.js
    ... ... @@ -126,8 +126,7 @@ pref("extensions.torlauncher.torrc_path", "");
    126 126
     pref("extensions.torlauncher.tordatadir_path", "");
    
    127 127
     
    
    128 128
     // BridgeDB-related preferences (used for Moat).
    
    129
    -pref("extensions.torlauncher.bridgedb_front", "vuejs.org");
    
    130
    -pref("extensions.torlauncher.bridgedb_reflector", "https://bespoke-strudel-c243cc.netlify.app");
    
    129
    +pref("extensions.torlauncher.bridgedb_targets", "https://1723079976.rsc.cdn77.org|cdn.zk.mk+www.cdn77.com");
    
    131 130
     pref("extensions.torlauncher.moat_service", "https://bridges.torproject.org/moat");
    
    132 131
     
    
    133 132
     // Log levels
    

  • toolkit/components/lox/Lox.sys.mjs
    ... ... @@ -1077,15 +1077,12 @@ class LoxImpl {
    1077 1077
         if (this.#domainFrontedRequests === null) {
    
    1078 1078
           this.#domainFrontedRequests = new Promise((resolve, reject) => {
    
    1079 1079
             // TODO: Customize to the values for Lox
    
    1080
    -        const reflector = Services.prefs.getStringPref(
    
    1081
    -          "extensions.torlauncher.bridgedb_reflector"
    
    1082
    -        );
    
    1083
    -        const front = Services.prefs.getStringPref(
    
    1084
    -          "extensions.torlauncher.bridgedb_front"
    
    1080
    +        const targets = Services.prefs.getStringPref(
    
    1081
    +          "extensions.torlauncher.bridgedb_targets"
    
    1085 1082
             );
    
    1086 1083
             const builder = new lazy.DomainFrontRequestBuilder();
    
    1087 1084
             builder
    
    1088
    -          .init(reflector, front)
    
    1085
    +          .init(targets)
    
    1089 1086
               .then(() => resolve(builder))
    
    1090 1087
               .catch(reject);
    
    1091 1088
           });
    

  • toolkit/modules/DomainFrontedRequests.sys.mjs
    ... ... @@ -22,38 +22,20 @@ ChromeUtils.defineESModuleGetters(lazy, {
    22 22
      * proxy credentials, which can be prepared with this function.
    
    23 23
      *
    
    24 24
      * @param {string} proxyType The proxy type (socks for socks5 or socks4)
    
    25
    - * @param {string} reflector The URL of the service hosted by the CDN
    
    26
    - * @param {string} front The domain to use as a front
    
    25
    + * @param {string} targets The string to pass to meek as the targets argument
    
    27 26
      * @returns {string[]} An array containing [username, password]
    
    28 27
      */
    
    29
    -function makeMeekCredentials(proxyType, reflector, front) {
    
    30
    -  // Construct the per-connection arguments.
    
    31
    -  let meekClientEscapedArgs = "";
    
    32
    -
    
    28
    +function makeMeekCredentials(proxyType, targets) {
    
    33 29
       // Escape aValue per section 3.5 of the PT specification:
    
    34 30
       //   First the "<Key>=<Value>" formatted arguments MUST be escaped,
    
    35 31
       //   such that all backslash, equal sign, and semicolon characters
    
    36 32
       //   are escaped with a backslash.
    
    37
    -  const escapeArgValue = aValue =>
    
    38
    -    aValue
    
    39
    -      ? aValue
    
    40
    -          .replaceAll("\\", "\\\\")
    
    41
    -          .replaceAll("=", "\\=")
    
    42
    -          .replaceAll(";", "\\;")
    
    43
    -      : "";
    
    44
    -
    
    45
    -  if (reflector) {
    
    46
    -    meekClientEscapedArgs += "url=";
    
    47
    -    meekClientEscapedArgs += escapeArgValue(reflector);
    
    48
    -  }
    
    49
    -
    
    50
    -  if (front) {
    
    51
    -    if (meekClientEscapedArgs.length) {
    
    52
    -      meekClientEscapedArgs += ";";
    
    53
    -    }
    
    54
    -    meekClientEscapedArgs += "front=";
    
    55
    -    meekClientEscapedArgs += escapeArgValue(front);
    
    56
    -  }
    
    33
    +  targets = targets
    
    34
    +    .replaceAll("\\", "\\\\")
    
    35
    +    .replaceAll("=", "\\=")
    
    36
    +    .replaceAll(";", "\\;");
    
    37
    +  // Construct the per-connection arguments.
    
    38
    +  const meekClientEscapedArgs = `targets=${targets}`;
    
    57 39
     
    
    58 40
       // socks5
    
    59 41
       if (proxyType === "socks") {
    
    ... ... @@ -86,7 +68,7 @@ class MeekTransport {
    86 68
       #meekClientProcess = null;
    
    87 69
     
    
    88 70
       // launches the meekprocess
    
    89
    -  async init(reflector, front) {
    
    71
    +  async init(targets) {
    
    90 72
         // ensure we haven't already init'd
    
    91 73
         if (this.#inited) {
    
    92 74
           throw new Error("MeekTransport: Already initialized");
    
    ... ... @@ -265,8 +247,7 @@ class MeekTransport {
    265 247
           });
    
    266 248
           [this.proxyUsername, this.proxyPassword] = makeMeekCredentials(
    
    267 249
             this.proxyType,
    
    268
    -        reflector,
    
    269
    -        front
    
    250
    +        targets
    
    270 251
           );
    
    271 252
           this.#inited = true;
    
    272 253
         } catch (ex) {
    
    ... ... @@ -319,7 +300,7 @@ class MeekTransportAndroid {
    319 300
        */
    
    320 301
       #id = 0;
    
    321 302
     
    
    322
    -  async init(reflector, front) {
    
    303
    +  async init(targets) {
    
    323 304
         // ensure we haven't already init'd
    
    324 305
         if (this.#id) {
    
    325 306
           throw new Error("MeekTransport: Already initialized");
    
    ... ... @@ -333,8 +314,7 @@ class MeekTransportAndroid {
    333 314
         this.proxyPort = details.port;
    
    334 315
         [this.proxyUsername, this.proxyPassword] = makeMeekCredentials(
    
    335 316
           this.proxyType,
    
    336
    -      reflector,
    
    337
    -      front
    
    317
    +      targets
    
    338 318
         );
    
    339 319
       }
    
    340 320
     
    
    ... ... @@ -455,7 +435,7 @@ export class DomainFrontRequestBuilder {
    455 435
         return this.#inited;
    
    456 436
       }
    
    457 437
     
    
    458
    -  async init(reflector, front) {
    
    438
    +  async init(targets) {
    
    459 439
         if (this.#inited) {
    
    460 440
           throw new Error("DomainFrontRequestBuilder: Already initialized");
    
    461 441
         }
    
    ... ... @@ -464,7 +444,7 @@ export class DomainFrontRequestBuilder {
    464 444
           Services.appinfo.OS === "Android"
    
    465 445
             ? new MeekTransportAndroid()
    
    466 446
             : new MeekTransport();
    
    467
    -    await meekTransport.init(reflector, front);
    
    447
    +    await meekTransport.init(targets);
    
    468 448
         this.#meekTransport = meekTransport;
    
    469 449
         this.#inited = true;
    
    470 450
       }
    

  • toolkit/modules/Moat.sys.mjs
    ... ... @@ -18,8 +18,7 @@ ChromeUtils.defineESModuleGetters(lazy, {
    18 18
     });
    
    19 19
     
    
    20 20
     const TorLauncherPrefs = Object.freeze({
    
    21
    -  bridgedb_front: "extensions.torlauncher.bridgedb_front",
    
    22
    -  bridgedb_reflector: "extensions.torlauncher.bridgedb_reflector",
    
    21
    +  bridgedb_targets: "extensions.torlauncher.bridgedb_targets",
    
    23 22
       moat_service: "extensions.torlauncher.moat_service",
    
    24 23
     });
    
    25 24
     
    
    ... ... @@ -68,13 +67,12 @@ export class MoatRPC {
    68 67
           return;
    
    69 68
         }
    
    70 69
     
    
    71
    -    const reflector = Services.prefs.getStringPref(
    
    72
    -      TorLauncherPrefs.bridgedb_reflector
    
    70
    +    const targets = Services.prefs.getStringPref(
    
    71
    +      TorLauncherPrefs.bridgedb_targets
    
    73 72
         );
    
    74
    -    const front = Services.prefs.getStringPref(TorLauncherPrefs.bridgedb_front);
    
    75 73
         this.#requestBuilder = new lazy.DomainFrontRequestBuilder();
    
    76 74
         try {
    
    77
    -      await this.#requestBuilder.init(reflector, front);
    
    75
    +      await this.#requestBuilder.init(targets);
    
    78 76
         } catch (e) {
    
    79 77
           this.#requestBuilder = null;
    
    80 78
           throw e;