diff --git a/chromium_src/components/component_updater/component_updater_service.cc b/chromium_src/components/component_updater/component_updater_service.cc index b535e9f6fda8..b701a36feabd 100644 --- a/chromium_src/components/component_updater/component_updater_service.cc +++ b/chromium_src/components/component_updater/component_updater_service.cc @@ -3,7 +3,25 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * you can obtain one at http://mozilla.org/MPL/2.0/. */ -#include "components/crx_file/crx_verifier.h" -#define CRX3_WITH_PUBLISHER_PROOF CRX3 +#include "base/feature_list.h" +#include "components/update_client/update_client.h" + +namespace { +const base::Feature kEnforceCRX3PublisherProof{ + "EnforceCRX3PublisherProof", base::FEATURE_ENABLED_BY_DEFAULT}; + +crx_file::VerifierFormat GetVerifierFormat() { + if (base::FeatureList::IsEnabled(kEnforceCRX3PublisherProof)) + return crx_file::VerifierFormat::CRX3_WITH_PUBLISHER_PROOF; + + return crx_file::VerifierFormat::CRX3; +} +} // namespace + +#define crx_format_requirement \ + crx_format_requirement = GetVerifierFormat(); \ + crx_file::VerifierFormat _temp_var; \ + ALLOW_UNUSED_LOCAL(_temp_var); \ + _temp_var #include "src/components/component_updater/component_updater_service.cc" -#undef CRX3_WITH_PUBLISHER_PROOF +#undef crx_format_requirement