[tbb-commits] [Git][tpo/applications/tor-browser][tor-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:04:28 UTC 2024
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/c122e13b5ed696218272a5e34806afc5dceff8a9
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/c122e13b5ed696218272a5e34806afc5dceff8a9
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/19db5d6c/attachment-0001.htm>
More information about the tbb-commits
mailing list