Commit Graph

13 Commits

Author SHA1 Message Date
Chris Peterson
a0c8081df4 Bug 870698 - Part 4: Replace Equals("") with EqualsLiteral(""). r=erahm
MozReview-Commit-ID: G1GhyvD29WK

--HG--
extra : rebase_source : 115842c37a40041bdca7b4e1ff0a5680b02ced15
extra : source : 90bfff9c01d80086cdc17637f310e898fea295ea
2017-09-06 01:13:45 -07:00
Ethan
6bbd2d88df Bug 1396468 - Spoof navigator.oscpu as 'Windows NT 6.1; Win64; x64' when resisting fingerprinting is enabled. r=ehsan 2017-09-04 11:30:37 +08:00
Ethan
d20c7d929c Bug 1393283 - Use the last ESR version as the spoofed Firefox version. r=tihuang, r=mcmanus 2017-09-01 17:29:44 +08:00
Wes Kocher
ef0d82bb2b Merge m-c to inbound, a=merge
MozReview-Commit-ID: HSkzFTcnhOy
2017-08-11 13:25:37 -07:00
Ethan
dd89a080a0 Bug 1383495 - Spoof Navigator API platform as win64 when resisting fingerprinting is enabled. r=ehsan 2017-08-11 09:51:09 +08:00
Tim Huang
7af48eb06f Bug 1369309 - Part 3: Making the media statistics reports a spoofed value when fingerprinting resistance is enabled. r=cpearce, r=arthuredelstein
This patch makes the media statistics report values with a fixed frames per second
and a dynamic dropped ratio when resistance fingerprinting is enabled. The dropped
rate is decided by the video resolution that it will report a fixed dropped rate
when the video resolution is greater than 480p. And It will report a zero dropped
rate if the video is below or equal to 480p. In addition, it adds three new prefs
that allow us to change the value of frames per second, the dropped ratio and the
threshold of target video resolution. The three prefs are
'privacy.resistFingerprinting.video_frames_per_sec', 'privacy.resistFingerprinting.video_dropped_ratio'
and 'privacy.resistFingerprinting.target_video_res'. The default values of them
are 30, 5 and 480, which means 30 frames per second, 5 percent dropped ratio and
480p.

This also adds a new helper function 'nsContentUtils::ShouldResistFingerprinting(nsIDocument* aDoc)'
for checking whether fingerprinting resistance is enabled for a given docuemnt.
If it is a chrome document, this function will indicate that fingerprinting
resistance is not enabled regardless of the pref 'privacy.resistFingerprinting'.
If it is a content document, the result will depend on the pref.

MozReview-Commit-ID: FbSuRq6Zdnn

--HG--
extra : rebase_source : a62a1be19d9b38520f9eed7164fb258e3354d228
2017-07-17 15:13:55 +08:00
Jan Beich
729edf3c9f Bug 1385597 - Properly restore system timezone on other POSIX systems. r=Ehsan
MozReview-Commit-ID: 4viT99nrph4

--HG--
extra : rebase_source : 2c9abd28d1c11fd6bfa0ffc4326c551ea31f9a7d
2017-07-29 16:16:02 +00:00
Tim Huang
87f6957631 Bug 1382840 - Making the nsRFPService::UpdatePref() to copy the string which been passed to PR_SetEnv(). r=Ehsan
The PR_SetEnv() needs the passing string been intentionally leaked. However,
nsRFPService::UpdatePref() uses PR_SetEnv() without leaking the input string.
This patch is going to fix this by using ToNewCString().

MozReview-Commit-ID: 97QQUk2sjM9

--HG--
extra : rebase_source : 10205fe2e9577d5c985572256a5e9842c46d39be
2017-07-21 11:49:21 +08:00
Doug Thayer
6ce2f09f36 Bug 1361500 - (2) Move e10s check after profile load r=Ehsan
Since user-provided values for the e10s prefs won't be loaded
until the profile's prefs.js file is loaded, we need to wait for
this to occur. The simplest way to do this while keeping the
logic neatly inside nsRFPService seemed to be to add an observer,
but another option would be to just directly call _tzset at the
right time during start-up, or add a static method in nsRFPService
doing this that we could call. This would avoid the overhead of an
observer, but since I don't know how significant that overhead
is I just went with the observer for now.

MozReview-Commit-ID: 6yhvwEoADDy

--HG--
extra : rebase_source : fcb6bfe7136993d2a10bee4f707e4a21230fab27
2017-07-06 09:14:02 -07:00
Doug Thayer
366ebfc80f Bug 1361500 - Don't call _tzset on startup r=arthuredelstein,Ehsan
The reason we call _tzset inside DateTime.cpp is to allow the
privacy.resistFingerprinting pref to mask our timezone by setting
the TZ environment variable. Without _tzset, the changes to the
environment variable won't actually change anything. However, if
a process is started with the TZ environment variable set to
something (like "UTC"), then those changes will be active in
that process. Since we're only masking timezone to JS running in
the content process, and since those content processes will be
started by the parent process which has already set its TZ to UTC,
and will copy that variable to its children, we only need to call
_tzset() when the pref changes, and only in the content process,
provided we are on e10s.

MozReview-Commit-ID: CPU99BGDUPj

--HG--
extra : rebase_source : 4cdf6b5e2aebeff34decd11efa62783f2364dd3a
2017-06-23 12:56:03 -04:00
Tim Huang
b6286c46af Bug 1333651 - Part 2: Spoofing Navigator object when 'privacy.resistFingerprinting' is true. r=arthuredelstein,Ehsan
This patch makes navigator object to return spoofed value for fields have fingerprintable
concerns. This changes the worker navigator as well.

MozReview-Commit-ID: E2SLNZRfuVP

--HG--
extra : rebase_source : 960bafbe41382eba891ad807c37a822ba6a758c8
2017-06-01 14:54:59 +08:00
Jonathan Hao
dca1a28633 Bug 1217238 - Reduce time precision when privacy.resistFingerprinting is on. r=mystor
This patch is adapted from Tor bug 1517.

To offer some protection against timing attacks by JS content pages, in this
patch we round the various time-exposing APIs (such as Date and
Event.timeStamps) to the nearest 100 ms when the pref "privacy.resistFingerprinting" is on.

MozReview-Commit-ID: eGucM9nGTn

--HG--
extra : rebase_source : 3ee600b07943f3954e9a2a9561391f2f7821bb86
2017-06-06 11:45:14 +08:00
Tim Huang
a0b6e42c61 Bug 1330890 - Part 1: Spoofing the time zone as UTC when fingerprinting resistance is enabled (adopt from Tor #16622). r=arthuredelstein,Ehsan
This patch adds a new service for fingerprinting resistance, which is called
nsRFPService. This service will be put in /toolkit/components/resistfingerprinting.
This service is responsible for observing the change of pref 'privacy.resistfingerprinting'
and doing underlying jobs. And it also in charge of caching pref setting of
'privacy.resistfingerprinting' and changing environment value 'TZ'.

This service will be initialized within nsContentUtils::Init(). During initialization,
it will store the original TZ value and set the value according to 'privacy.resistfingerprinting'.
It also changes environment value 'TZ' and calls nsJSUtils::ResetTimeZone() in
response to the change of the pref.

This service is only a nsIObserver for now. In the future, however, it will be
responsible for more fingerprinting resistance jobs, like changing prefs after
'privacy.resistfingerprinting' is changed.

The environment variable 'TZ' will be set to 'UTC' when 'privacy.resistFingerprinting'
is true. By doing so, Firefox will use UTC as its local time zone instead of the
default local time zone. This prevents a browser be fingerprinted through the local time zone.
After the 'privacy.resistFingerprinting' is turned off, the service will restore
'TZ' back to the original TZ setting, the user's setting or the default system timezone.

MozReview-Commit-ID: 8V47ZATgrKE

--HG--
extra : rebase_source : a35d35e8f8bbf5f5015271d3df3c32420702506c
2017-05-02 15:21:04 +08:00