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

Unified Diff: extensions/browser/content_hash_fetcher.cc

Issue 585583003: Fix case-sensitivity problems in extension content verification (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: undo change to extension_protocols.cc Created 6 years, 3 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
« no previous file with comments | « no previous file | extensions/browser/content_hash_reader.cc » ('j') | extensions/browser/verified_contents.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/content_hash_fetcher.cc
diff --git a/extensions/browser/content_hash_fetcher.cc b/extensions/browser/content_hash_fetcher.cc
index aa3475e94e1c448dfbb04a287e6a5eebef154832..3ffdcc01465144e2a5a4497e03762fe4b3d29f66 100644
--- a/extensions/browser/content_hash_fetcher.cc
+++ b/extensions/browser/content_hash_fetcher.cc
@@ -379,9 +379,7 @@ bool ContentHashFetcherJob::CreateHashes(const base::FilePath& hashes_file) {
extension_path_.AppendRelativePath(full_path, &relative_path);
relative_path = relative_path.NormalizePathSeparatorsTo('/');
- const std::string* expected_root =
- verified_contents_->GetTreeHashRoot(relative_path);
- if (!expected_root)
+ if (!verified_contents_->HasTreeHashRoot(relative_path))
continue;
std::string contents;
@@ -396,7 +394,7 @@ bool ContentHashFetcherJob::CreateHashes(const base::FilePath& hashes_file) {
ComputedHashes::ComputeHashesForContent(contents, block_size_, &hashes);
std::string root =
ComputeTreeHashRoot(hashes, block_size_ / crypto::kSHA256Length);
- if (expected_root && *expected_root != root) {
+ if (!verified_contents_->TreeHashRootEquals(relative_path, root)) {
VLOG(1) << "content mismatch for " << relative_path.AsUTF8Unsafe();
hash_mismatch_paths_.insert(relative_path);
continue;
« no previous file with comments | « no previous file | extensions/browser/content_hash_reader.cc » ('j') | extensions/browser/verified_contents.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698