Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enforce using a publisher proof for CRX3 #12551

Merged
merged 2 commits into from
Mar 16, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,24 @@
* 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 \
atuchin-m marked this conversation as resolved.
Show resolved Hide resolved
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