diff options
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/extensions/extension_creator.cc | 6 | ||||
-rw-r--r-- | chrome/browser/extensions/extension_service_unittest.cc | 8 | ||||
-rw-r--r-- | chrome/browser/extensions/pack_extension_unittest.cc | 2 |
3 files changed, 14 insertions, 2 deletions
diff --git a/chrome/browser/extensions/extension_creator.cc b/chrome/browser/extensions/extension_creator.cc index e344338..285aa5c 100644 --- a/chrome/browser/extensions/extension_creator.cc +++ b/chrome/browser/extensions/extension_creator.cc @@ -228,7 +228,11 @@ bool ExtensionCreator::SignZip(const base::FilePath& zip_path, } zip_handle.Close(); - signature_creator->Final(signature); + if (!signature_creator->Final(signature)) { + error_message_ = + l10n_util::GetStringUTF8(IDS_EXTENSION_ERROR_WHILE_SIGNING); + return false; + } return true; } diff --git a/chrome/browser/extensions/extension_service_unittest.cc b/chrome/browser/extensions/extension_service_unittest.cc index e8f452b..86dd4f1 100644 --- a/chrome/browser/extensions/extension_service_unittest.cc +++ b/chrome/browser/extensions/extension_service_unittest.cc @@ -2202,6 +2202,14 @@ TEST_F(ExtensionServiceTest, PackExtension) { creator.reset(new ExtensionCreator()); ASSERT_FALSE(creator->Run(temp_dir2.path(), crx_path, privkey_path, base::FilePath(), ExtensionCreator::kOverwriteCRX)); + + // Try packing with a private key that is a valid key, but invalid for the + // extension. + base::FilePath bad_private_key_dir = data_dir_.AppendASCII("bad_private_key"); + crx_path = output_directory.AppendASCII("bad_private_key.crx"); + privkey_path = data_dir_.AppendASCII("bad_private_key.pem"); + ASSERT_FALSE(creator->Run(bad_private_key_dir, crx_path, base::FilePath(), + privkey_path, ExtensionCreator::kOverwriteCRX)); } // Test Packaging and installing an extension whose name contains punctuation. diff --git a/chrome/browser/extensions/pack_extension_unittest.cc b/chrome/browser/extensions/pack_extension_unittest.cc index dac4608..78bcad3 100644 --- a/chrome/browser/extensions/pack_extension_unittest.cc +++ b/chrome/browser/extensions/pack_extension_unittest.cc @@ -17,7 +17,7 @@ namespace extensions { // Tests the environment for packing extensions from the command line -// via the --pack-extension switch. +// when using the --pack-extension switch. class PackExtensionTest : public testing::Test { public: PackExtensionTest() |