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

Unified Diff: components/safe_browsing_db/v4_local_database_manager.cc

Issue 2577963004: Correctly hash the input of MatchModuleWhitelistString() in pver4. (Closed)
Patch Set: nit Created 4 years 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
« no previous file with comments | « no previous file | components/safe_browsing_db/v4_local_database_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/safe_browsing_db/v4_local_database_manager.cc
diff --git a/components/safe_browsing_db/v4_local_database_manager.cc b/components/safe_browsing_db/v4_local_database_manager.cc
index 45748e4601eec7353fc74d4d88140c1aaccc994e..2c89b27cd0ea691631153460f958f37371f72596 100644
--- a/components/safe_browsing_db/v4_local_database_manager.cc
+++ b/components/safe_browsing_db/v4_local_database_manager.cc
@@ -17,6 +17,7 @@
#include "components/safe_browsing_db/v4_feature_list.h"
#include "components/safe_browsing_db/v4_protocol_manager_util.h"
#include "content/public/browser/browser_thread.h"
+#include "crypto/sha2.h"
using content::BrowserThread;
using base::TimeTicks;
@@ -312,8 +313,10 @@ bool V4LocalDatabaseManager::MatchModuleWhitelistString(
return true;
}
+ // str is the module's filename. Convert to hash.
+ FullHash hash = crypto::SHA256HashString(str);
return HandleHashSynchronously(
- str, StoresToCheck({GetChromeFilenameClientIncidentId()}));
+ hash, StoresToCheck({GetChromeFilenameClientIncidentId()}));
}
ThreatSource V4LocalDatabaseManager::GetThreatSource() const {
« no previous file with comments | « no previous file | components/safe_browsing_db/v4_local_database_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698