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

Remote settings: add signature verification support #6534

Merged

Conversation

leplatrem
Copy link
Contributor

@leplatrem leplatrem commented Dec 19, 2024

  • Basic signature verification feature
  • Investigate why hard-coded root hash is necessary with rc_crypto https://bugzilla.mozilla.org/show_bug.cgi?id=1940903
  • Investigate whether x5u certificates are cached
  • Test plan for project features combinations testing (eg. jexl alone, signature alone, both together) --> both together
  • Add a command to the remote settings example that will verify collection signatures
  • Create follow-up issue to add a method .verify_and_get() which will verify signature before returning cache content --> https://bugzilla.mozilla.org/show_bug.cgi?id=1940908

Pull Request checklist

  • Breaking changes: This PR follows our breaking change policy
    • This PR follows the breaking change policy:
      • This PR has no breaking API changes, or
      • There are corresponding PRs for our consumer applications that resolve the breaking changes and have been approved
  • Quality: This PR builds and tests run cleanly
    • Note:
      • For changes that need extra cross-platform testing, consider adding [ci full] to the PR title.
      • If this pull request includes a breaking change, consider cutting a new release after merging.
  • Tests: This PR includes thorough tests or an explanation of why it does not
  • Changelog: This PR includes a changelog entry in CHANGELOG.md or an explanation of why it does not need one
    • Any breaking changes to Swift or Kotlin binding APIs are noted explicitly
  • Dependencies: This PR follows our dependency management guidelines
    • Any new dependencies are accompanied by a summary of the due diligence applied in selecting them.

Branch builds: add [firefox-android: branch-name] to the PR title.

@leplatrem leplatrem force-pushed the remote-settings-signature-verification branch 4 times, most recently from a46bce7 to 20d1058 Compare December 20, 2024 11:26
@leplatrem leplatrem force-pushed the remote-settings-signature-verification branch 2 times, most recently from ab04265 to c25a036 Compare January 7, 2025 14:39
@leplatrem leplatrem marked this pull request as ready for review January 7, 2025 15:18
@leplatrem leplatrem requested review from bendk and gruberb January 7, 2025 15:18
Copy link
Member

@gruberb gruberb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! A few cleanup comments.

I tried to spot if we can have a Signature struct, and impl the functions inside signatures.rs, but maybe that's not needed? I would then maybe change the module/file name to signature_utils.rs. But just a suggestion.

components/remote_settings/src/client.rs Outdated Show resolved Hide resolved
components/remote_settings/src/client.rs Show resolved Hide resolved
Copy link
Contributor

@bendk bendk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. I don't understand all the signature stuff, but I like how it's organized.

I left some suggestions that you can take or leave. My only real concern is with the mock_instant dependency. If that's helping a lot in the tests, let's keep it, but if not I'd rather remove it and not have to go through the auditing process.

components/remote_settings/Cargo.toml Outdated Show resolved Hide resolved
"{0}: apply {1} change(s) locally.",
self.collection_name,
changeset.changes.len()
);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW, there's also error_reporting::breadcrumb! which will log, but also set a breadcrumb on any sentry errors. I don't know if this would be useful there, but I just wanted to point it out.

components/remote_settings/src/signatures.rs Outdated Show resolved Hide resolved
components/remote_settings/src/signatures.rs Outdated Show resolved Hide resolved
components/remote_settings/Cargo.toml Outdated Show resolved Hide resolved
components/remote_settings/src/signatures.rs Outdated Show resolved Hide resolved
@leplatrem leplatrem force-pushed the remote-settings-signature-verification branch from f4c6c9a to 837f4d1 Compare January 10, 2025 10:01
@leplatrem leplatrem force-pushed the remote-settings-signature-verification branch from 837f4d1 to d713cbc Compare January 10, 2025 17:15
@leplatrem leplatrem added this pull request to the merge queue Jan 10, 2025
Merged via the queue into mozilla:main with commit af9c317 Jan 10, 2025
16 checks passed
@leplatrem leplatrem deleted the remote-settings-signature-verification branch January 10, 2025 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants