| Index: chrome/browser/extensions/extension_creator.cc
|
| diff --git a/chrome/browser/extensions/extension_creator.cc b/chrome/browser/extensions/extension_creator.cc
|
| index 7c24389cf944bb60b8a27b1ace8de9f0cbaf5d21..7c06df6a0e44792a72c4c50659d08399f4cc510e 100644
|
| --- a/chrome/browser/extensions/extension_creator.cc
|
| +++ b/chrome/browser/extensions/extension_creator.cc
|
| @@ -84,7 +84,8 @@ bool ExtensionCreator::InitializeInput(
|
| }
|
|
|
| bool ExtensionCreator::ValidateManifest(const FilePath& extension_dir,
|
| - crypto::RSAPrivateKey* key_pair) {
|
| + crypto::RSAPrivateKey* key_pair,
|
| + int run_flags) {
|
| std::vector<uint8> public_key_bytes;
|
| if (!key_pair->ExportPublicKey(&public_key_bytes)) {
|
| error_message_ =
|
| @@ -102,12 +103,17 @@ bool ExtensionCreator::ValidateManifest(const FilePath& extension_dir,
|
|
|
| // Load the extension once. We don't really need it, but this does a lot of
|
| // useful validation of the structure.
|
| + int create_flags =
|
| + Extension::FOLLOW_SYMLINKS_ANYWHERE | Extension::ERROR_ON_PRIVATE_KEY;
|
| + if (run_flags & kRequireModernManifestVersion)
|
| + create_flags |= Extension::REQUIRE_MODERN_MANIFEST_VERSION;
|
| +
|
| scoped_refptr<Extension> extension(
|
| extension_file_util::LoadExtension(
|
| extension_dir,
|
| extension_id,
|
| Extension::INTERNAL,
|
| - Extension::FOLLOW_SYMLINKS_ANYWHERE | Extension::ERROR_ON_PRIVATE_KEY,
|
| + create_flags,
|
| &error_message_));
|
| return !!extension.get();
|
| }
|
| @@ -297,7 +303,9 @@ bool ExtensionCreator::Run(const FilePath& extension_dir,
|
| return false;
|
|
|
| // Perform some extra validation by loading the extension.
|
| - if (!ValidateManifest(extension_dir, key_pair.get()))
|
| + // TODO(aa): Can this go before creating the key pair? This would mean not
|
| + // passing ID into LoadExtension which seems OK.
|
| + if (!ValidateManifest(extension_dir, key_pair.get(), run_flags))
|
| return false;
|
|
|
| ScopedTempDir temp_dir;
|
|
|