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

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: fix the bug of 'and' -> && 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 db81dc9486326b706861c15b93f65f8d90b90463..6b93d3af6ab669237ac7e42f1f410252b10febcb 100644
--- a/chrome/browser/safe_browsing/safe_browsing_database.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_database.cc
@@ -70,6 +70,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.
@@ -1608,3 +1614,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);
+};
« no previous file with comments | « chrome/browser/safe_browsing/safe_browsing_database.h ('k') | chrome/browser/safe_browsing/safe_browsing_database_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698