diff options
author | jyasskin@chromium.org <jyasskin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-01 23:55:03 +0000 |
---|---|---|
committer | jyasskin@chromium.org <jyasskin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-01 23:55:03 +0000 |
commit | ab55c2b682d9770de2b46cc85b00bcc79c4ea315 (patch) | |
tree | 875cb25ac3ce7df01ac2117a2bdf49437601f43c /chrome/common/extensions/extension.h | |
parent | 1d424a13c881bde3c6f96c099e5b46215df3b243 (diff) | |
download | chromium_src-ab55c2b682d9770de2b46cc85b00bcc79c4ea315.zip chromium_src-ab55c2b682d9770de2b46cc85b00bcc79c4ea315.tar.gz chromium_src-ab55c2b682d9770de2b46cc85b00bcc79c4ea315.tar.bz2 |
Prevent developers from accidentally including their private keys in extensions.
This puts a warning on chrome://extensions in developer mode when an
unpacked extension includes a parsable .pem file, and fails an attempt
to pack such an extension.
This doesn't yet identify when an extension includes its own private
key because RSAPrivateKey currently requires loading from the
filesystem on Mac, and the utility process that first loads an
extension is prohibited from doing that.
BUG=130140
TEST=unit_tests --gtest_filter=Extension*;
Manually ran chrome and tried to load and pack an extension containing
a private key.
Review URL: https://chromiumcodereview.appspot.com/10451086
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@140128 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/extensions/extension.h')
-rw-r--r-- | chrome/common/extensions/extension.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/chrome/common/extensions/extension.h b/chrome/common/extensions/extension.h index 40311440..665043d 100644 --- a/chrome/common/extensions/extension.h +++ b/chrome/common/extensions/extension.h @@ -213,6 +213,10 @@ class Extension : public base::RefCountedThreadSafe<Extension> { // anywhere in the filesystem, rather than being restricted to the // extension directory. FOLLOW_SYMLINKS_ANYWHERE = 1 << 5, + + // |ERROR_ON_PRIVATE_KEY| means that private keys inside an + // extension should be errors rather than warnings. + ERROR_ON_PRIVATE_KEY = 1 << 6, }; static scoped_refptr<Extension> Create(const FilePath& path, @@ -592,6 +596,8 @@ class Extension : public base::RefCountedThreadSafe<Extension> { const ExtensionPermissionSet* required_permission_set() const { return required_permission_set_.get(); } + // Appends |new_warnings| to install_warnings(). + void AddInstallWarnings(const std::vector<std::string>& new_warnings); const std::vector<std::string>& install_warnings() const { return install_warnings_; } |