[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

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



Title: GitLab

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:

Changes:

  • dom/base/Document.cpp
    ... ... @@ -4104,10 +4104,11 @@ void Document::SetDocumentURI(nsIURI* aURI) {
    4104 4104
       }
    
    4105 4105
     }
    
    4106 4106
     
    
    4107
    -static void GetFormattedTimeString(PRTime aTime,
    
    4107
    +static void GetFormattedTimeString(PRTime aTime, bool aUniversal,
    
    4108 4108
                                        nsAString& aFormattedTimeString) {
    
    4109 4109
       PRExplodedTime prtime;
    
    4110
    -  PR_ExplodeTime(aTime, PR_LocalTimeParameters, &prtime);
    
    4110
    +  PR_ExplodeTime(aTime, aUniversal ? PR_GMTParameters : PR_LocalTimeParameters,
    
    4111
    +                 &prtime);
    
    4111 4112
       // "MM/DD/YYYY hh:mm:ss"
    
    4112 4113
       char formatedTime[24];
    
    4113 4114
       if (SprintfLiteral(formatedTime, "%02d/%02d/%04d %02d:%02d:%02d",
    
    ... ... @@ -4125,7 +4126,9 @@ void Document::GetLastModified(nsAString& aLastModified) const {
    4125 4126
       if (!mLastModified.IsEmpty()) {
    
    4126 4127
         aLastModified.Assign(mLastModified);
    
    4127 4128
       } else {
    
    4128
    -    GetFormattedTimeString(PR_Now(), aLastModified);
    
    4129
    +    GetFormattedTimeString(PR_Now(),
    
    4130
    +                           ShouldResistFingerprinting(RFPTarget::Unknown),
    
    4131
    +                           aLastModified);
    
    4129 4132
       }
    
    4130 4133
     }
    
    4131 4134
     
    
    ... ... @@ -11113,7 +11116,8 @@ void Document::RetrieveRelevantHeaders(nsIChannel* aChannel) {
    11113 11116
     
    
    11114 11117
       mLastModified.Truncate();
    
    11115 11118
       if (modDate != 0) {
    
    11116
    -    GetFormattedTimeString(modDate, mLastModified);
    
    11119
    +    GetFormattedTimeString(
    
    11120
    +        modDate, ShouldResistFingerprinting(RFPTarget::Unknown), mLastModified);
    
    11117 11121
       }
    
    11118 11122
     }
    
    11119 11123
     
    

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