lists.torproject.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

tbb-commits

Thread Start a new thread
Download
Threads by month
  • ----- 2025 -----
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2021 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2020 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2019 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2018 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2017 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2016 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2015 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2014 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
tbb-commits@lists.torproject.org

  • 1 participants
  • 18594 discussions
[tor-browser-bundle/master] Bug 20761: Tor Browser 6.5a4 is ignoring additional SocksPorts
by gk@torproject.org 12 May '17

12 May '17
commit 3f32f7a6dd4970936cc49d988369a61efa87c031 Author: Kathy Brade <brade(a)pearlcrescent.com> Date: Tue Jan 31 11:49:41 2017 -0500 Bug 20761: Tor Browser 6.5a4 is ignoring additional SocksPorts Remove the SocksPort and ControlPort configuration from torrc-defaults. Tor Launcher configures the ports via args when starting tor, and we must avoid conflicts. Also, strengthen the warning to users about not editing torrc-defaults. --- Bundle-Data/linux/Data/Tor/torrc-defaults | 8 +++----- Bundle-Data/mac/TorBrowser/Data/Tor/torrc-defaults | 8 +++----- Bundle-Data/windows/Data/Tor/torrc-defaults | 8 +++----- 3 files changed, 9 insertions(+), 15 deletions(-) diff --git a/Bundle-Data/linux/Data/Tor/torrc-defaults b/Bundle-Data/linux/Data/Tor/torrc-defaults index 0a87e5f..f383525 100644 --- a/Bundle-Data/linux/Data/Tor/torrc-defaults +++ b/Bundle-Data/linux/Data/Tor/torrc-defaults @@ -1,6 +1,8 @@ # torrc-defaults for Tor Browser # -# This file is distributed with Tor Browser and should not be modified (it +# DO NOT EDIT THIS FILE +# +# This file is distributed with Tor Browser and SHOULD NOT be modified (it # may be overwritten during the next Tor Browser update). To customize your # Tor configuration, shut down Tor Browser and edit the torrc file. # @@ -9,8 +11,4 @@ AvoidDiskWrites 1 # Where to send logging messages. Format is minSeverity[-maxSeverity] # (stderr|stdout|syslog|file FILENAME). Log notice stdout -# Bind to this address to listen to connections from SOCKS-speaking -# applications. -SocksPort 9150 IPv6Traffic PreferIPv6 KeepAliveIsolateSOCKSAuth -ControlPort 9151 CookieAuthentication 1 diff --git a/Bundle-Data/mac/TorBrowser/Data/Tor/torrc-defaults b/Bundle-Data/mac/TorBrowser/Data/Tor/torrc-defaults index 0a87e5f..f383525 100644 --- a/Bundle-Data/mac/TorBrowser/Data/Tor/torrc-defaults +++ b/Bundle-Data/mac/TorBrowser/Data/Tor/torrc-defaults @@ -1,6 +1,8 @@ # torrc-defaults for Tor Browser # -# This file is distributed with Tor Browser and should not be modified (it +# DO NOT EDIT THIS FILE +# +# This file is distributed with Tor Browser and SHOULD NOT be modified (it # may be overwritten during the next Tor Browser update). To customize your # Tor configuration, shut down Tor Browser and edit the torrc file. # @@ -9,8 +11,4 @@ AvoidDiskWrites 1 # Where to send logging messages. Format is minSeverity[-maxSeverity] # (stderr|stdout|syslog|file FILENAME). Log notice stdout -# Bind to this address to listen to connections from SOCKS-speaking -# applications. -SocksPort 9150 IPv6Traffic PreferIPv6 KeepAliveIsolateSOCKSAuth -ControlPort 9151 CookieAuthentication 1 diff --git a/Bundle-Data/windows/Data/Tor/torrc-defaults b/Bundle-Data/windows/Data/Tor/torrc-defaults index 0a87e5f..f383525 100644 --- a/Bundle-Data/windows/Data/Tor/torrc-defaults +++ b/Bundle-Data/windows/Data/Tor/torrc-defaults @@ -1,6 +1,8 @@ # torrc-defaults for Tor Browser # -# This file is distributed with Tor Browser and should not be modified (it +# DO NOT EDIT THIS FILE +# +# This file is distributed with Tor Browser and SHOULD NOT be modified (it # may be overwritten during the next Tor Browser update). To customize your # Tor configuration, shut down Tor Browser and edit the torrc file. # @@ -9,8 +11,4 @@ AvoidDiskWrites 1 # Where to send logging messages. Format is minSeverity[-maxSeverity] # (stderr|stdout|syslog|file FILENAME). Log notice stdout -# Bind to this address to listen to connections from SOCKS-speaking -# applications. -SocksPort 9150 IPv6Traffic PreferIPv6 KeepAliveIsolateSOCKSAuth -ControlPort 9151 CookieAuthentication 1
1 0
0 0
[tor-launcher/master] Bug 20761: Tor Browser 6.5a4 is ignoring additional SocksPorts
by gk@torproject.org 12 May '17

12 May '17
commit 5154173e0facfff26bede4c37d2c47669350d0ff Author: Kathy Brade <brade(a)pearlcrescent.com> Date: Fri May 5 14:37:52 2017 -0400 Bug 20761: Tor Browser 6.5a4 is ignoring additional SocksPorts When starting tor, pass "+__ControlPort" and "+__SocksPort" in the args. This causes Tor Launcher's control and SOCKS ports to be added to any ports the user has defined in their torrc and also prevents the ports defined by Tor Launcher from being written to torrc. Also, perform a one-time removal of the torrc lines that conflict with the ports that Tor Launcher will use when starting tor. This change depends on the fix for #20956. --- src/components/tl-process.js | 319 +++++++++++++++++++++++++++++++++++++++++- src/components/tl-protocol.js | 9 +- src/modules/tl-util.jsm | 11 +- 3 files changed, 332 insertions(+), 7 deletions(-) diff --git a/src/components/tl-process.js b/src/components/tl-process.js index 3284049..3db394e 100644 --- a/src/components/tl-process.js +++ b/src/components/tl-process.js @@ -1,4 +1,4 @@ -// Copyright (c) 2016, The Tor Project, Inc. +// Copyright (c) 2017, The Tor Project, Inc. // See LICENSE for licensing information. // // vim: set sw=2 sts=2 ts=8 et syntax=javascript: @@ -99,6 +99,17 @@ TorProcessService.prototype = } else if (TorLauncherUtil.shouldStartAndOwnTor) { + // If we have not already done so, perform a one-time fixup to remove + // any ControlPort and SocksPort lines from the user's torrc file that + // will conflict with the arguments we plan to pass when starting tor. + // See bug 20761. + const kTorrcFixupPref = "extensions.torlauncher.torrc_fixup_version"; + if ((TorLauncherUtil.getIntPref(kTorrcFixupPref, 0) < 1) + && this._fixupTorrc()) + { + TorLauncherUtil.setIntPref(kTorrcFixupPref, 1); + } + this._startTor(); this._controlTor(); } @@ -383,7 +394,10 @@ TorProcessService.prototype = args.push(hashedPassword); // Include a ControlPort argument to support switching between - // a TCP port and an IPC port (e.g., a Unix domain socket). + // a TCP port and an IPC port (e.g., a Unix domain socket). We + // include a "+__" prefix so that (1) this control port is added + // to any control ports that the user has defined in their torrc + // file and (2) it is never written to torrc. let controlPortArg; if (controlIPCFile) controlPortArg = this._ipcPortArg(controlIPCFile); @@ -391,12 +405,15 @@ TorProcessService.prototype = controlPortArg = "" + controlPort; if (controlPortArg) { - args.push("ControlPort"); + args.push("+__ControlPort"); args.push(controlPortArg); } // Include a SocksPort argument to support switching between - // a TCP port and an IPC port (e.g., a Unix domain socket). + // a TCP port and an IPC port (e.g., a Unix domain socket). We + // include a "+__" prefix so that (1) this SOCKS port is added + // to any SOCKS ports that the user has defined in their torrc + // file and (2) it is never written to torrc. if (socksPortInfo) { let socksPortArg; @@ -411,7 +428,7 @@ TorProcessService.prototype = "extensions.torlauncher.socks_port_flags"); if (socksPortFlags) socksPortArg += ' ' + socksPortFlags; - args.push("SocksPort"); + args.push("+__SocksPort"); args.push(socksPortArg); } } @@ -793,6 +810,298 @@ TorProcessService.prototype = return pid; }, + // Returns true if successful. + _fixupTorrc: function() + { + let torrcFile = TorLauncherUtil.getTorFile("torrc", true); + if (!torrcFile) + return true; // No torrc file; nothing to fixup. + + let torrcStr = this._getFileAsString(torrcFile); + if (torrcStr == undefined) + return false; + else if (torrcStr.length == 0) + return true; + + let controlIPCFile = this.mProtocolSvc.TorGetControlIPCFile(); + let controlPort = this.mProtocolSvc.TorGetControlPort(); + let socksPortInfo = this.mProtocolSvc.TorGetSOCKSPortInfo(); + + let lines = this._joinContinuedTorrcLines(torrcStr); + + let removedLinesCount = 0; + let revisedLines = []; + lines.forEach(aLine => + { + let removeLine = false; + // Look for "+ControlPort value" or "ControlPort value", skipping leading + // whitespace and ignoring case. + let matchResult = aLine.match(/\s*\+*controlport\s+(.*)/i); + if (matchResult) + { + if (controlIPCFile) + { + removeLine = this._valueContainsFilePath(matchResult[1], + controlIPCFile); + } + else + { + removeLine = this._valueContainsPort(matchResult[1], + controlPort); + } + } + else if (socksPortInfo) + { + // Look for "+SocksPort value" or "SocksPort value", skipping leading + // whitespace and ignoring case. + matchResult = aLine.match(/\s*\+*socksport\s+(.*)/i); + if (matchResult) + { + if (socksPortInfo.ipcFile) + { + removeLine = this._valueContainsFilePath(matchResult[1], + socksPortInfo.ipcFile); + } + else + { + removeLine = this._valueContainsPort(matchResult[1], + socksPortInfo.port); + } + } + } + + if (removeLine) + { + ++removedLinesCount; + TorLauncherLogger.log(3, "_fixupTorrc: removing " + aLine); + } + else + { + revisedLines.push(aLine); + } + }); + + if (removedLinesCount > 0) + { + let s = revisedLines.join('\n'); + if (!this._overwriteFile(torrcFile, s)) + return false; + + TorLauncherLogger.log(4, "_fixupTorrc: removed " + removedLinesCount + + " configuration options"); + } + + return true; + }, + + // Returns undefined if file contents could not be read. + _getFileAsString: function(aFile) + { + let str = "" + let inStream; + try + { + let fis = Cc['@mozilla.org/network/file-input-stream;1'] + .createInstance(Ci.nsIFileInputStream); + const kOpenFlagsReadOnly = 0x01; + fis.init(aFile, kOpenFlagsReadOnly, 0, 0); + inStream = Cc["@mozilla.org/intl/converter-input-stream;1"] + .createInstance(Ci.nsIConverterInputStream); + inStream.init(fis, "UTF-8", 0, + Ci.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER); + const kReadSize = 0xffffffff; // PR_UINT32_MAX + while (true) + { + let outStr = {}; + let count = inStream.readString(kReadSize, outStr); + if (count == 0) + break; + + str += outStr.value; + } + } + catch (e) + { + TorLauncherLogger.log(5, "_getFileAsString " + aFile.path + + " error: " + e); + str = undefined; + } + + if (inStream) + inStream.close(); + + return str; + }, + + // After making a backup, replace the contents of aFile with aStr. + // Returns true if successful. + _overwriteFile: function(aFile, aStr) + { + let backupFile; + + try + { + // Convert the data to UTF-8. + let conv = Cc["@mozilla.org/intl/scriptableunicodeconverter"] + .createInstance(Ci.nsIScriptableUnicodeConverter); + conv.charset = "UTF-8"; + let data = conv.ConvertFromUnicode(aStr) + conv.Finish(); + + // Rename the file to .bak (we avoid .orig because tor uses it). This + // backup will be left on disk so the user can recover the original + // file contents. + backupFile = aFile.clone(); + backupFile.leafName += ".bak"; + backupFile.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, aFile.permissions); + aFile.renameTo(null, backupFile.leafName); + TorLauncherLogger.log(3, "created backup of " + aFile.leafName + + " in " + backupFile.leafName); + + // Write the new data to the file. + let stream = Cc["@mozilla.org/network/safe-file-output-stream;1"] + .createInstance(Ci.nsIFileOutputStream); + stream.init(aFile, 0x02 | 0x08 | 0x20, /* WRONLY CREATE TRUNCATE */ + 0600, 0); + stream.write(data, data.length); + stream.QueryInterface(Ci.nsISafeOutputStream).finish(); + } + catch (e) + { + // Report an error and try to recover by renaming the backup to the + // original name. + TorLauncherLogger.log(5, "failed to overwrite file " + aFile.path + + ": " + e); + if (backupFile) + backupFile.renameTo(null, aFile.leafName); + + return false; + } + + return true; + }, + + // Split aTorrcStr into lines, joining continued lines. + _joinContinuedTorrcLines: function(aTorrcStr) + { + let lines = []; + let rawLines = aTorrcStr.split('\n'); + let isContinuedLine = false; + let tmpLine; + rawLines.forEach(aLine => + { + let len = aLine.length; + + // Strip trailing CR if present. + if ((len > 0) && aLine.substr(len - 1) == '\r') + { + --len; + aLine = aLine.substr(0, len); + } + + // Check for a continued line. This is indicated by a trailing \ or, if + // we are already within a continued line sequence, a trailing comment. + if ((len > 0) && (aLine.substr(len - 1) == '\\')) + { + --len; + aLine = aLine.substr(0, len); + + // If this is the start of a continued line and it only contains a + // keyword (i.e., no spaces are present), append a space so that + // the keyword will be recognized (as it is by tor) after we join + // the pieces of the continued line into one line. + if (!isContinuedLine && (aLine.indexOf(' ') < 0)) + aLine += ' '; + + isContinuedLine = true; + } + else if (isContinuedLine) + { + if (len == 0) + { + isContinuedLine = false; + } + else + { + // Check for a comment. According to tor's doc/torrc_format.txt, + // comments do not terminate a sequence of continued lines. + let idx = aLine.indexOf("#"); + if (idx < 0) + { + isContinuedLine = false; // Not a comment; end continued line. + } + else + { + // Remove trailing comment from continued line. The continued + // line sequence continues. + aLine = aLine.substr(0, idx); + } + } + } + + if (isContinuedLine) + { + if (tmpLine) + tmpLine += aLine; + else + tmpLine = aLine; + } + else if (tmpLine) + { + lines.push(tmpLine + aLine); + tmpLine = undefined; + } + else + { + lines.push(aLine); + } + }); + + return lines; + }, + + _valueContainsFilePath: function(aValue, aFile) + { + // Handle several cases: + // "unix:/path options" + // unix:"/path" options + // unix:/path options + if (aValue.startsWith('"')) + aValue = this.mProtocolSvc.TorUnescapeString(aValue); + + let path; + let matchResult = aValue.match(/^unix:("[^"]*")/); + if (matchResult) + path = this.mProtocolSvc.TorUnescapeString(matchResult[1]); + else + { + matchResult = aValue.match(/^unix:(\S*)/); + if (matchResult) + path = matchResult[1]; + } + + if (!path) + return false; + + let file = Cc['@mozilla.org/file/local;1'].createInstance(Ci.nsIFile); + file.initWithPath(path); + return file.equals(aFile); + }, + + _valueContainsPort: function(aValue, aPort) + { + // Check for a match, ignoring "127.0.0.1" and "localhost" prefixes. + let val = this.mProtocolSvc.TorUnescapeString(aValue); + let pieces = val.split(':'); + if ((pieces.length >= 2) + && ((pieces[0] == "127.0.0.1") + || (pieces[0].toLowerCase() == "localhost"))) + { + val = pieces[1]; + } + + return aPort === parseInt(val); + }, + endOfObject: true }; diff --git a/src/components/tl-protocol.js b/src/components/tl-protocol.js index 12f3910..d6323f4 100644 --- a/src/components/tl-protocol.js +++ b/src/components/tl-protocol.js @@ -1,4 +1,4 @@ -// Copyright (c) 2016, The Tor Project, Inc. +// Copyright (c) 2017, The Tor Project, Inc. // See LICENSE for licensing information. // TODO: Some code came from torbutton.js (pull in copyright and license?) // @@ -299,6 +299,13 @@ TorProtocolService.prototype = return this.mSOCKSPortInfo; }, + // Unescape Tor Control string aStr (removing surrounding "" and \ escapes). + // Returns a string. + TorUnescapeString: function(aStr) + { + return this._strUnescape(aStr); + }, + // Escape non-ASCII characters for use within the Tor Control protocol. // Returns a string. TorEscapeString: function(aStr) diff --git a/src/modules/tl-util.jsm b/src/modules/tl-util.jsm index 0d33267..2e45fd1 100644 --- a/src/modules/tl-util.jsm +++ b/src/modules/tl-util.jsm @@ -1,4 +1,4 @@ -// Copyright (c) 2016, The Tor Project, Inc. +// Copyright (c) 2017, The Tor Project, Inc. // See LICENSE for licensing information. // // vim: set sw=2 sts=2 ts=8 et syntax=javascript: @@ -231,6 +231,15 @@ let TorLauncherUtil = // Public return rv; }, + setIntPref: function(aPrefName, aVal) + { + var val = (undefined != aVal) ? aVal : 0; + try + { + TLUtilInternal.mPrefsSvc.setIntPref(aPrefName, val); + } catch (e) {} + }, + getCharPref: function(aPrefName, aDefaultVal) { var rv = aDefaultVal ? aDefaultVal : "";
1 0
0 0
[tor-launcher/master] By default, use TCP for the ControlPort and SocksPort.
by gk@torproject.org 12 May '17

12 May '17
commit 485ba9456724e38b661c90dccc90322c74fa405f Author: Kathy Brade <brade(a)pearlcrescent.com> Date: Thu May 11 17:34:16 2017 -0400 By default, use TCP for the ControlPort and SocksPort. For the stable releases of Tor Browser, we want to continue to use TCP so that packages like TorBirdy that use the tor that is started by Tor Browser continue to work. Also see bugs 20111 and 20761. --- src/defaults/preferences/prefs.js | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/defaults/preferences/prefs.js b/src/defaults/preferences/prefs.js index 875c300..752514a 100644 --- a/src/defaults/preferences/prefs.js +++ b/src/defaults/preferences/prefs.js @@ -9,27 +9,27 @@ pref("extensions.torlauncher.loglevel", 4); // 1=verbose, 2=debug, 3=info, 4=no pref("extensions.torlauncher.logmethod", 1); // 0=stdout, 1=errorconsole, 2=debuglog pref("extensions.torlauncher.max_tor_log_entries", 1000); -// By default, an IPC object (e.g., a Unix domain socket) at a default -// location is used for the Tor control port. -// Change control_port_use_ipc to false to use a TCP connection instead, as -// defined by control_host and control_port. -// Modify control_ipc_path to override the default IPC object location. If a -// relative path is used, it is handled like torrc_path (see below). -pref("extensions.torlauncher.control_port_use_ipc", true); -pref("extensions.torlauncher.control_ipc_path", ""); +// By default, Tor Launcher configures a TCP listener for the Tor +// control port, as defined by control_host and control_port. +// Set control_port_use_ipc to true to use an IPC object (e.g., a Unix +// domain socket) instead. You may also modify control_ipc_path to +// override the default IPC object location. If a relative path is used, +// it is handled like torrc_path (see below). pref("extensions.torlauncher.control_host", "127.0.0.1"); pref("extensions.torlauncher.control_port", 9151); +pref("extensions.torlauncher.control_port_use_ipc", false); +pref("extensions.torlauncher.control_ipc_path", ""); -// By default, an IPC object (e.g., a Unix domain socket) at a default -// location is used for the Tor SOCKS port. -// Change socks_port_use_ipc to false to use a TCP connection. When a -// TCP connection is used, the host is taken from the network.proxy.socks -// pref and the port is taken from the network.proxy.socks_port pref. -// Modify socks_ipc_path to override the default IPC object location. If a -// relative path is used, it is handled like torrc_path (see below). +// By default, Tor Launcher configures a TCP listener for the Tor +// SOCKS port. The host is taken from the network.proxy.socks pref and +// the port is taken from the network.proxy.socks_port pref. +// Set socks_port_use_ipc to true to use an IPC object (e.g., a Unix +// domain socket) instead. You may also modify socks_ipc_path to +// override the default IPC object location. If a relative path is used, +// it is handled like torrc_path (see below). // Modify socks_port_flags to use a different set of SocksPort flags (but be // careful). -pref("extensions.torlauncher.socks_port_use_ipc", true); +pref("extensions.torlauncher.socks_port_use_ipc", false); pref("extensions.torlauncher.socks_ipc_path", ""); pref("extensions.torlauncher.socks_port_flags", "IPv6Traffic PreferIPv6 KeepAliveIsolateSOCKSAuth");
1 0
0 0
[tor-browser/tor-browser-52.1.0esr-7.0-2] fixup! TB4: Tor Browser's Firefox preference overrides.
by gk@torproject.org 12 May '17

12 May '17
commit 611b3ff60078725f036e253c5d10a3d01d8fde90 Author: Arthur Edelstein <arthuredelstein(a)gmail.com> Date: Fri May 12 01:29:04 2017 -0700 fixup! TB4: Tor Browser's Firefox preference overrides. Bug 21685: Disable remote new tab pages --- browser/app/profile/000-tor-browser.js | 1 + 1 file changed, 1 insertion(+) diff --git a/browser/app/profile/000-tor-browser.js b/browser/app/profile/000-tor-browser.js index be74849..98cfec5 100644 --- a/browser/app/profile/000-tor-browser.js +++ b/browser/app/profile/000-tor-browser.js @@ -95,6 +95,7 @@ pref("browser.newtabpage.directory.source", "data:text/plain,"); // Bug 16316 - pref("browser.newtabpage.enhanced", false); // Bug 16316 - Avoid potential confusion over tiles for now. pref("browser.newtabpage.introShown", true); // Bug 16316 - Avoid potential confusion over tiles for now. pref("browser.newtabpage.preload", false); // Bug 16316 - Avoid potential confusion over tiles for now. +pref("browser.newtabpage.remote", false); // Bug 21685: Disable remote new tab pages pref("browser.search.countryCode", "US"); // The next three prefs disable GeoIP search lookups (#16254) pref("browser.search.region", "US"); pref("browser.search.geoip.url", "");
1 0
0 0
[tor-browser/tor-browser-52.1.0esr-7.0-2] Bug 10286: Touch API fingerprinting resistance
by gk@torproject.org 12 May '17

12 May '17
commit 331f089d6b6ba62463d8362d7ca01641a4cc92dc Author: Arthur Edelstein <arthuredelstein(a)gmail.com> Date: Mon Apr 24 08:18:25 2017 -0700 Bug 10286: Touch API fingerprinting resistance --- dom/events/Touch.cpp | 7 +++++++ dom/events/Touch.h | 16 ++++++++++------ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/dom/events/Touch.cpp b/dom/events/Touch.cpp index a538fa6..39d50e3 100644 --- a/dom/events/Touch.cpp +++ b/dom/events/Touch.cpp @@ -188,5 +188,12 @@ Touch::GetParentObject() return mTarget->GetOwnerGlobal(); } +bool +Touch::ResistFingerprinting() const +{ + return !nsContentUtils::LegacyIsCallerChromeOrNativeCode() && + nsContentUtils::ResistFingerprinting(); +} + } // namespace dom } // namespace mozilla diff --git a/dom/events/Touch.h b/dom/events/Touch.h index f98f7f9..858fb16 100644 --- a/dom/events/Touch.h +++ b/dom/events/Touch.h @@ -67,16 +67,19 @@ public: // WebIDL int32_t Identifier() const { return mIdentifier; } EventTarget* GetTarget() const; - int32_t ScreenX() const { return mScreenPoint.x; } - int32_t ScreenY() const { return mScreenPoint.y; } + int32_t ScreenX() const { return ResistFingerprinting() ? + mClientPoint.x : mScreenPoint.x; } + int32_t ScreenY() const { return ResistFingerprinting() ? + mClientPoint.y : mScreenPoint.y; } int32_t ClientX() const { return mClientPoint.x; } int32_t ClientY() const { return mClientPoint.y; } int32_t PageX() const { return mPagePoint.x; } int32_t PageY() const { return mPagePoint.y; } - int32_t RadiusX() const { return mRadius.x; } - int32_t RadiusY() const { return mRadius.y; } - float RotationAngle() const { return mRotationAngle; } - float Force() const { return mForce; } + int32_t RadiusX() const { return ResistFingerprinting() ? 1 : mRadius.x; } + int32_t RadiusY() const { return ResistFingerprinting() ? 1 : mRadius.y; } + float RotationAngle() const { return ResistFingerprinting() ? + 0.0 : mRotationAngle; } + float Force() const { return ResistFingerprinting() ? 0.0 : mForce; } nsCOMPtr<EventTarget> mTarget; LayoutDeviceIntPoint mRefPoint; @@ -90,6 +93,7 @@ public: float mRotationAngle; float mForce; protected: + bool ResistFingerprinting() const; ~Touch(); bool mPointsInitialized;
1 0
0 0
[tor-browser/tor-browser-52.1.0esr-7.0-2] Bug 10286: Regression tests for Touch API fingerprinting resistance
by gk@torproject.org 12 May '17

12 May '17
commit 00d2bfb5067659c352690c06cb85a8b76bc7addb Author: Arthur Edelstein <arthuredelstein(a)gmail.com> Date: Wed Apr 26 08:57:21 2017 -0700 Bug 10286: Regression tests for Touch API fingerprinting resistance Also, fix typo in EventUtils.js --- dom/events/test/mochitest.ini | 1 + .../test_touchevent_resist_fingerprinting.html | 68 ++++++++++++++++++++++ testing/mochitest/tests/SimpleTest/EventUtils.js | 2 +- 3 files changed, 70 insertions(+), 1 deletion(-) diff --git a/dom/events/test/mochitest.ini b/dom/events/test/mochitest.ini index 4322a7b..92e68f3 100644 --- a/dom/events/test/mochitest.ini +++ b/dom/events/test/mochitest.ini @@ -185,3 +185,4 @@ skip-if = toolkit == 'android' #CRASH_DUMP, RANDOM [test_wheel_default_action.html] [test_bug687787.html] [test_bug1298970.html] +[test_touchevent_resist_fingerprinting.html] diff --git a/dom/events/test/test_touchevent_resist_fingerprinting.html b/dom/events/test/test_touchevent_resist_fingerprinting.html new file mode 100644 index 0000000..8ba7925 --- /dev/null +++ b/dom/events/test/test_touchevent_resist_fingerprinting.html @@ -0,0 +1,68 @@ +<!DOCTYPE HTML> +<html> +<!-- +https://trac.torproject.org/10286 +--> + <head> + <meta charset="utf-8"> + <title>Test for Tor Bug 10286</title> + <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> + <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script> + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> + </head> + <body> + <div id="target0">target0</div> + <script type="application/javascript"> + SimpleTest.waitForExplicitFinish(); + + let promiseEvent = (target, eventName) => { + return new Promise(resolve => { + target.addEventListener(eventName, function eventOccurred(event) { + target.removeEventListener(eventName, eventOccurred, false); + resolve(event); + }, false); + }); + } + + let promiseTouchEvent = (target, type, offsetX, offsetY, params) => { + let touchEventPromise = promiseEvent(target, type); + params.type = type; + synthesizeTouch(target, offsetX, offsetY, params); + return touchEventPromise; + }; + + let target0 = document.getElementById("target0"); + let touchParams = { force: 1.0, angle: 1.0, rx: 2, ry: 3 }; + + let runTest = async () => { + await SpecialPowers.pushPrefEnv( + { set: [["dom.w3c_touch_events.enabled", 1]] }); + for (let resist of [false, true]) { + await SpecialPowers.pushPrefEnv( + { set: [["privacy.resistFingerprinting", resist]] }); + info("starting test with fingerprinting resistance " + + (resist ? "on" : "off")); + let touchEvent = await promiseTouchEvent(target0, "touchstart", + 5, 5, touchParams); + info("touch event received"); + let touch = touchEvent.touches[0]; + if (resist) { + is(touch.screenX, touch.clientX, + "touch.screenX should be the same as touch.clientX"); + is(touch.screenY, touch.clientY, + "touch.screenY should be the same as touch.clientY"); + } + is(touch.force, resist ? 0.0 : touchParams.force, "touch.force"); + is(touch.radiusX, resist ? 1 : touchParams.rx, "touch.radiusX"); + is(touch.radiusY, resist ? 1 : touchParams.ry, "touch.radiusY"); + is(touch.rotationAngle, resist ? 0 : touchParams.angle, + "touch.rotationAngle"); + } + } + + window.onload = () => { + runTest().then(() => SimpleTest.finish()); + }; + </script> + </body> +</html> diff --git a/testing/mochitest/tests/SimpleTest/EventUtils.js b/testing/mochitest/tests/SimpleTest/EventUtils.js index a0df2d5..c36a480 100644 --- a/testing/mochitest/tests/SimpleTest/EventUtils.js +++ b/testing/mochitest/tests/SimpleTest/EventUtils.js @@ -395,7 +395,7 @@ function synthesizeTouchAtPoint(left, top, aEvent, aWindow = window) if (utils) { var id = aEvent.id || 0; var rx = aEvent.rx || 1; - var ry = aEvent.rx || 1; + var ry = aEvent.ry || 1; var angle = aEvent.angle || 0; var force = aEvent.force || 1; var modifiers = _parseModifiers(aEvent, aWindow);
1 0
0 0
[tor-browser/tor-browser-52.1.0esr-7.0-2] fixup! TB4: Tor Browser's Firefox preference overrides.
by gk@torproject.org 12 May '17

12 May '17
commit 1b6559c0763f2ae0c9ad56307642e6d6462c3ede Author: Arthur Edelstein <arthuredelstein(a)gmail.com> Date: Tue Apr 25 11:46:52 2017 -0700 fixup! TB4: Tor Browser's Firefox preference overrides. Bug 10286: Disable Touch API --- browser/app/profile/000-tor-browser.js | 1 + 1 file changed, 1 insertion(+) diff --git a/browser/app/profile/000-tor-browser.js b/browser/app/profile/000-tor-browser.js index b8c3f41..be74849 100644 --- a/browser/app/profile/000-tor-browser.js +++ b/browser/app/profile/000-tor-browser.js @@ -160,6 +160,7 @@ pref("privacy.use_utc_timezone", true); pref("media.webspeech.synth.enabled", false); // Bug 10283: Disable SpeechSynthesis API pref("dom.webaudio.enabled", false); // Bug 13017: Disable Web Audio API pref("dom.maxHardwareConcurrency", 1); // Bug 21675: Spoof single-core cpu +pref("dom.w3c_touch_events.enabled", 0); // Bug 10286: Always disable Touch API // Third party stuff pref("network.cookie.cookieBehavior", 1);
1 0
0 0
[tor-browser/tor-browser-52.1.0esr-7.0-2] Bug 13612: Disable Social API
by gk@torproject.org 12 May '17

12 May '17
commit bd30c7b878b8c4a3a033db65f1f6dbfa46f543d4 Author: Arthur Edelstein <arthuredelstein(a)gmail.com> Date: Thu May 11 15:13:36 2017 -0700 Bug 13612: Disable Social API --- browser/app/profile/000-tor-browser.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/browser/app/profile/000-tor-browser.js b/browser/app/profile/000-tor-browser.js index d422694..b8c3f41 100644 --- a/browser/app/profile/000-tor-browser.js +++ b/browser/app/profile/000-tor-browser.js @@ -107,6 +107,14 @@ pref("browser.pocket.api", ""); pref("browser.pocket.site", ""); pref("network.http.referer.hideOnionSource", true); +// Disable Social API and related stuff (Bug #13612) +pref("social.directories", ""); +pref("social.remote-install.enabled", false); +pref("social.share.activationPanelEnabled", false); +pref("social.shareDirectory", ""); +pref("social.toast-notifications.enabled", false); +pref("social.whitelist", ""); + // Fingerprinting pref("webgl.min_capability_mode", true); pref("webgl.disable-extensions", true);
1 0
0 0
[tor-browser-build/master] Allow changing logs directory using RBM_LOGS_DIR environment variable
by boklm@torproject.org 11 May '17

11 May '17
commit 43276de96ca5907cd07d388d8027bf3210a9e067 Author: Nicolas Vigier <boklm(a)torproject.org> Date: Thu May 11 17:38:02 2017 +0200 Allow changing logs directory using RBM_LOGS_DIR environment variable --- rbm.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rbm.conf b/rbm.conf index 969922c..ce70215 100644 --- a/rbm.conf +++ b/rbm.conf @@ -2,7 +2,7 @@ debug: '[% GET ! ENV.RBM_NO_DEBUG %]' compress_tar: gz output_dir: "out/[% project %]" -build_log: 'logs/[% project %]-[% c("var/osname") %].log' +build_log: '[% GET ENV.RBM_LOGS_DIR ? ENV.RBM_LOGS_DIR : "logs" %]/[% project %]-[% c("var/osname") %].log' pkg_type: build
1 0
0 0
[tor-browser-bundle/master] Bug 21779: Non-admin users can't access Tor Browser on macOS.
by gk@torproject.org 10 May '17

10 May '17
commit f27d2cab4ed80a4c7b4f594b593b6b90f6148a82 Author: Kathy Brade <brade(a)pearlcrescent.com> Date: Wed May 10 15:14:05 2017 -0400 Bug 21779: Non-admin users can't access Tor Browser on macOS. Use chmod to grant permission for "other" to access files within TorBrowser.app. --- gitian/descriptors/mac/gitian-bundle.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/gitian/descriptors/mac/gitian-bundle.yml b/gitian/descriptors/mac/gitian-bundle.yml index a2c8408..54ce237 100644 --- a/gitian/descriptors/mac/gitian-bundle.yml +++ b/gitian/descriptors/mac/gitian-bundle.yml @@ -303,7 +303,11 @@ script: | rm -f precomplete python $MARTOOLS/createprecomplete.py popd - # + + # Ensure that files and directories are accessible by non-admin users + # if the app bundle is placed in /Applications. See bug 21779. + chmod -R o+rX ~/build/$TORBROWSER_NAME.app + # Create full MAR file and disk image. MAR_FILE=tor-browser-osx${GBUILD_BITS}-${TORBROWSER_VERSION}_${PKG_LOCALE}.mar MAR=$MARTOOLS/mar MBSDIFF=$MARTOOLS/mbsdiff $MARTOOLS/make_full_update.sh -q $OUTDIR/$MAR_FILE ~/build/$TORBROWSER_NAME.app @@ -341,7 +345,12 @@ script: | rm -f precomplete python $MARTOOLS/createprecomplete.py popd - # + + # Ensure that files and directories are accessible by non-admin users + # if the app bundle is placed in /Applications. See bug 21779. + chmod -R o+rX ~/build/dmg/$DEST.app + + # Create full MAR file and disk image. MAR_FILE=tor-browser-osx${GBUILD_BITS}-${TORBROWSER_VERSION}_$LANG.mar MAR=$MARTOOLS/mar MBSDIFF=$MARTOOLS/mbsdiff $MARTOOLS/make_full_update.sh -q $OUTDIR/$MAR_FILE ~/build/dmg/$DEST.app # Rename the Japanese bundle to not confuse users
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 1572
  • 1573
  • 1574
  • 1575
  • 1576
  • 1577
  • 1578
  • ...
  • 1860
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.