[tbb-commits] [Git][tpo/applications/tor-browser][base-browser-115.9.0esr-13.5-1] Bug 42428: Make RFP spoof the timezone of document.lastModified.

Pier Angelo Vendrame (@pierov) git at gitlab.torproject.org
Wed Mar 20 10:05:48 UTC 2024



Pier Angelo Vendrame pushed to branch base-browser-115.9.0esr-13.5-1 at The Tor Project / Applications / Tor Browser


Commits:
369e1367 by Pier Angelo Vendrame at 2024-03-20T11:05:38+01:00
Bug 42428: Make RFP spoof the timezone of document.lastModified.

- - - - -


1 changed file:

- dom/base/Document.cpp


Changes:

=====================================
dom/base/Document.cpp
=====================================
@@ -4103,10 +4103,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",
@@ -4124,7 +4125,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);
   }
 }
 
@@ -11053,7 +11056,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/369e136705bf5c1aa141aadd6d0ad0f3183431dc

-- 
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/369e136705bf5c1aa141aadd6d0ad0f3183431dc
You're receiving this email because of your account on gitlab.torproject.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.torproject.org/pipermail/tbb-commits/attachments/20240320/be76f7f5/attachment-0001.htm>


More information about the tbb-commits mailing list