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


Commits:
96ab6401 by Pier Angelo Vendrame at 2024-03-20T11:06:04+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/mullvad-browser/-/commit/96ab6401af562a726620e438435bbd0790d6b98e

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


_______________________________________________
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits

Reply via email to