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

Unified Diff: extensions/browser/verified_contents.h

Issue 585583003: Fix case-sensitivity problems in extension content verification (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove old code 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 | « extensions/browser/content_hash_reader.cc ('k') | extensions/browser/verified_contents.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/verified_contents.h
diff --git a/extensions/browser/verified_contents.h b/extensions/browser/verified_contents.h
index 1cf0bdb16f867554a24d163fe9e5868fd409f74c..7e7b7f95bca4e311d0be5b5d5a56cde29dfac218 100644
--- a/extensions/browser/verified_contents.h
+++ b/extensions/browser/verified_contents.h
@@ -46,9 +46,10 @@ class VerifiedContents {
const std::string& extension_id() const { return extension_id_; }
const base::Version& version() const { return version_; }
- // This returns a pointer to the binary form of an expected sha256 root hash
- // for |relative_path| computing using a tree hash algorithm.
- const std::string* GetTreeHashRoot(const base::FilePath& relative_path);
+ bool HasTreeHashRoot(const base::FilePath& relative_path) const;
+
+ bool TreeHashRootEquals(const base::FilePath& relative_path,
+ const std::string& expected) const;
// If InitFrom has not been called yet, or was used in "ignore invalid
// signature" mode, this can return false.
@@ -83,8 +84,17 @@ class VerifiedContents {
std::string extension_id_;
base::Version version_;
- // The expected treehash root hashes for each file.
- std::map<base::FilePath, std::string> root_hashes_;
+ // The expected treehash root hashes for each file, lower cased so we can do
+ // case-insensitive lookups.
+ //
+ // We use a multi-map here so that we can do fast lookups of paths from
+ // requests on case-insensitive systems (windows, mac) where the request path
+ // might not have the exact right capitalization, but not break
+ // case-sensitive systems (linux, chromeos). TODO(asargent) - we should give
+ // developers client-side warnings in each of those cases, and have the
+ // webstore reject the cases they can statically detect. See crbug.com/29941
+ typedef std::multimap<base::FilePath::StringType, std::string> RootHashes;
+ RootHashes root_hashes_;
DISALLOW_COPY_AND_ASSIGN(VerifiedContents);
};
« no previous file with comments | « extensions/browser/content_hash_reader.cc ('k') | extensions/browser/verified_contents.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698