[tor-commits] [tor-browser/tor-browser-60.2.1esr-8.5-1] Bug 1441345 - Force the use of the Linux phishing list on Android. r=dimi, a=pascalc

gk at torproject.org gk at torproject.org
Thu Oct 18 18:48:43 UTC 2018


commit 9ec06f1b4bb17e562e10cb7d39e1af8370522538
Author: Francois Marier <francois at mozilla.com>
Date:   Wed Sep 12 18:07:26 2018 +0300

    Bug 1441345 - Force the use of the Linux phishing list on Android. r=dimi, a=pascalc
    
    Reviewers: dimi
    
    Reviewed By: dimi
    
    Subscribers: dveditz, francois, dimi
    
    Bug #: 1441345
    
    Differential Revision: https://phabricator.services.mozilla.com/D5479
    
    --HG--
    extra : source : 3fa9372e4c5f05713fe1a9f758487fa443ce7500
---
 .../url-classifier/nsUrlClassifierUtils.cpp        | 22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)

diff --git a/toolkit/components/url-classifier/nsUrlClassifierUtils.cpp b/toolkit/components/url-classifier/nsUrlClassifierUtils.cpp
index ce445d4a473e..b8ca0539550a 100644
--- a/toolkit/components/url-classifier/nsUrlClassifierUtils.cpp
+++ b/toolkit/components/url-classifier/nsUrlClassifierUtils.cpp
@@ -112,7 +112,15 @@ InitListUpdateRequest(ThreatType aThreatType,
                       ListUpdateRequest* aListUpdateRequest)
 {
   aListUpdateRequest->set_threat_type(aThreatType);
-  aListUpdateRequest->set_platform_type(GetPlatformType());
+  PlatformType platform = GetPlatformType();
+#if defined(ANDROID)
+  // Temporary hack to fix bug 1441345.
+  if ((aThreatType == SOCIAL_ENGINEERING_PUBLIC) ||
+      (aThreatType == SOCIAL_ENGINEERING)) {
+    platform = LINUX_PLATFORM;
+  }
+#endif
+  aListUpdateRequest->set_platform_type(platform);
   aListUpdateRequest->set_threat_entry_type(URL);
 
   Constraints* contraints = new Constraints();
@@ -418,6 +426,8 @@ nsUrlClassifierUtils::MakeFindFullHashRequestV4(const char** aListNames,
   // Set up FindFullHashesRequest.threat_info.
   auto threatInfo = r.mutable_threat_info();
 
+  PlatformType platform = GetPlatformType();
+
   // 1) Set threat types.
   for (uint32_t i = 0; i < aListCount; i++) {
     // Add threat types.
@@ -433,6 +443,14 @@ nsUrlClassifierUtils::MakeFindFullHashRequestV4(const char** aListNames,
     }
     threatInfo->add_threat_types((ThreatType)threatType);
 
+#if defined(ANDROID)
+    // Temporary hack to fix bug 1441345.
+    if (((ThreatType)threatType == SOCIAL_ENGINEERING_PUBLIC) ||
+        ((ThreatType)threatType == SOCIAL_ENGINEERING)) {
+      platform = LINUX_PLATFORM;
+    }
+#endif
+
     // Add client states for index 'i' only when the threat type is available
     // on current platform.
     nsCString stateBinary;
@@ -442,7 +460,7 @@ nsUrlClassifierUtils::MakeFindFullHashRequestV4(const char** aListNames,
   }
 
   // 2) Set platform type.
-  threatInfo->add_platform_types(GetPlatformType());
+  threatInfo->add_platform_types(platform);
 
   // 3) Set threat entry type.
   threatInfo->add_threat_entry_types(URL);





More information about the tor-commits mailing list