Pier Angelo Vendrame pushed to branch tor-browser-115.9.0esr-13.5-1 at The Tor Project / Applications / Tor Browser
Commits: c122e13b by Pier Angelo Vendrame at 2024-03-20T10:47:58+01:00 Bug 42428: Make RFP spoof the timezone of document.lastModified.
- - - - -
1 changed file:
- dom/base/Document.cpp
Changes:
===================================== dom/base/Document.cpp ===================================== @@ -4104,10 +4104,11 @@ void Document::SetDocumentURI(nsIURI* aURI) { } }
-static void GetFormattedTimeString(PRTime aTime, +static void GetFormattedTimeString(PRTime aTime, bool aUniversal, nsAString& aFormattedTimeString) { PRExplodedTime prtime; - PR_ExplodeTime(aTime, PR_LocalTimeParameters, &prtime); + PR_ExplodeTime(aTime, aUniversal ? PR_GMTParameters : PR_LocalTimeParameters, + &prtime); // "MM/DD/YYYY hh:mm:ss" char formatedTime[24]; if (SprintfLiteral(formatedTime, "%02d/%02d/%04d %02d:%02d:%02d", @@ -4125,7 +4126,9 @@ void Document::GetLastModified(nsAString& aLastModified) const { if (!mLastModified.IsEmpty()) { aLastModified.Assign(mLastModified); } else { - GetFormattedTimeString(PR_Now(), aLastModified); + GetFormattedTimeString(PR_Now(), + ShouldResistFingerprinting(RFPTarget::Unknown), + aLastModified); } }
@@ -11113,7 +11116,8 @@ void Document::RetrieveRelevantHeaders(nsIChannel* aChannel) {
mLastModified.Truncate(); if (modDate != 0) { - GetFormattedTimeString(modDate, mLastModified); + GetFormattedTimeString( + modDate, ShouldResistFingerprinting(RFPTarget::Unknown), mLastModified); } }
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/c122e13b...