Skip to content

Commit

Permalink
Enforce using a publisher proof for CRX3 (#12551)
Browse files Browse the repository at this point in the history
* Enforce using a publisher proof for CRX3
* add a new line
  • Loading branch information
atuchin-m authored Mar 16, 2022
1 parent c0d4713 commit 101d282
Showing 1 changed file with 21 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 101d282

Please sign in to comment.