Allow insecure updates for Kiosk apps
Insecure in that sence that they are useing CRX2 archive format. This
format is deprecating now (in favor of CRX3), and will be fully removed
(according to the plan) in M77. Until then it should be possible to use
old archive format for policy-based extensions (it makes sence only for
third-party-hosted ones, as Chrome Web Store already serves only CRX3).
For user sessions there is a policy “ExtensionAllowInsecureUpdates”
controlling if CRX2 is allowed (default to false from M75), but there is
no such one for Kiosk. This commit allows CRX2 for Kiosk apps.
Bug: 960428
Change-Id: I3f0599e209fee234cb216c11eeca79b170149e9b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1602727
Reviewed-by: Joshua Pawlicki <[email protected]>
Reviewed-by: Sergey Poromov <[email protected]>
Reviewed-by: Devlin <[email protected]>
Reviewed-by: Xiyuan Xia <[email protected]>
Commit-Queue: Oleg Davydov <[email protected]>
Cr-Commit-Position: refs/heads/master@{#658615}
diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc
index e2add3f..c061c6f7 100644
--- a/chrome/browser/extensions/extension_service.cc
+++ b/chrome/browser/extensions/extension_service.cc
@@ -1746,10 +1746,17 @@
installer->set_install_cause(extension_misc::INSTALL_CAUSE_EXTERNAL_FILE);
installer->set_install_immediately(info.install_immediately);
installer->set_creation_flags(info.creation_flags);
+
+ CRXFileInfo file_info(
+ info.path,
+ info.crx_location == Manifest::EXTERNAL_POLICY
+ ? GetPolicyVerifierFormat(ExtensionPrefs::Get(profile_)
+ ->InsecureExtensionUpdatesEnabled())
+ : GetExternalVerifierFormat());
#if defined(OS_CHROMEOS)
- InstallLimiter::Get(profile_)->Add(installer, info.path);
+ InstallLimiter::Get(profile_)->Add(installer, file_info);
#else
- installer->InstallCrx(info.path);
+ installer->InstallCrxFile(file_info);
#endif
// Depending on the source, a new external extension might not need a user