Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1515)

Unified Diff: chrome/browser/safe_browsing/safe_browsing_database.cc

Issue 14999008: Add a killswitch for CSD malware IP match and report feature. Use a new killswitch whitelist URL wh… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comment, call ContainsWhitelistedHashes to check killswitch Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/safe_browsing/safe_browsing_database.cc
diff --git a/chrome/browser/safe_browsing/safe_browsing_database.cc b/chrome/browser/safe_browsing/safe_browsing_database.cc
index c969b66ce3a63dea81a5122916b6f311517895a4..7000701114d0bc649b96c9f1e3bcc3cb41509798 100644
--- a/chrome/browser/safe_browsing/safe_browsing_database.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_database.cc
@@ -67,6 +67,12 @@ const size_t kMaxWhitelistSize = 5000;
const char kWhitelistKillSwitchUrl[] =
"sb-ssl.google.com/safebrowsing/csd/killswitch"; // Don't change this!
+// If the hash of this exact expression is on a whitelist then the
+// malware IP blacklisting feature will be disabled in csd.
+// Don't change this!
+const char kMalwareIPKillSwitchUrl[] =
+ "sb-ssl.google.com/safebrowsing/csd/killswitch_malware";
+
// To save space, the incoming |chunk_id| and |list_id| are combined
// into an |encoded_chunk_id| for storage by shifting the |list_id|
// into the low-order bits. These functions decode that information.
@@ -1425,3 +1431,12 @@ void SafeBrowsingDatabaseNew::LoadWhitelist(
whitelist->first.swap(new_whitelist);
}
}
+
+bool SafeBrowsingDatabaseNew::MalwareIPMatchKillSwitchOn() {
+ SBFullHash malware_kill_switch;
+ crypto::SHA256HashString(kMalwareIPKillSwitchUrl, &malware_kill_switch,
+ sizeof(malware_kill_switch));
+ std::vector<SBFullHash> full_hashes;
+ full_hashes.push_back(malware_kill_switch);
+ return ContainsWhitelistedHashes(csd_whitelist_, full_hashes);
+};

Powered by Google App Engine
This is Rietveld 408576698