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

Unified Diff: chrome/browser/extensions/extension_service.cc

Issue 829583002: Validate hash_sha256 checksum on .crx update. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add histogram description. Created 6 years 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
Index: chrome/browser/extensions/extension_service.cc
diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc
index a93594708fc816d00a30ee1df19b28ffd2125a3f..7dd90cf51edddde92c288a2236843e24a7fcc64a 100644
--- a/chrome/browser/extensions/extension_service.cc
+++ b/chrome/browser/extensions/extension_service.cc
@@ -476,6 +476,17 @@ bool ExtensionService::UpdateExtension(const std::string& id,
const base::FilePath& extension_path,
bool file_ownership_passed,
CrxInstaller** out_crx_installer) {
+ return ExtensionService::CheckAndUpdateExtension(
+ id, extension_path, std::string(), file_ownership_passed,
+ out_crx_installer);
+}
+
+bool ExtensionService::CheckAndUpdateExtension(
+ const std::string& id,
+ const base::FilePath& extension_path,
+ const std::string& package_hash,
+ bool file_ownership_passed,
+ CrxInstaller** out_crx_installer) {
CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
if (browser_terminating_) {
LOG(WARNING) << "Skipping UpdateExtension due to browser shutdown";
@@ -555,7 +566,7 @@ bool ExtensionService::UpdateExtension(const std::string& id,
installer->set_delete_source(file_ownership_passed);
installer->set_install_cause(extension_misc::INSTALL_CAUSE_UPDATE);
- installer->InstallCrx(extension_path);
+ installer->CheckAndInstallCrx(extension_path, package_hash);
if (out_crx_installer)
*out_crx_installer = installer.get();

Powered by Google App Engine
This is Rietveld 408576698