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

src/bundle: remove signature size sanity check #1316

Closed
wants to merge 1 commit into from

Conversation

ejoerns
Copy link
Member

@ejoerns ejoerns commented Jan 9, 2024

Historically, checking that the signature size is smaller than the bundle size was a sensible test.
However, with the added support for encrypted bundles, we may run in cases where the bundle size is actually smaller than the signature size. This happens because the CMS structure holds the individual recipients for encrypted bundles and with having thousands of recipients, the CMS structure size can reach a notable size. If that's combined with a quite small update image, the sanity check can be triggered and prevents from installing such a bundle.

Since this is just a sanity check, since we have other sanity checks and since we intend to support large amounts of encryption recipients, simply remove the sanity check.

Fixes #1308.

Historically, checking that the signature size is smaller than the
bundle size was a sensible test.
However, with the added support for encrypted bundles, we may run in
cases where the bundle size is actually smaller than the signature size.
This happens because the CMS structure holds the individual recipients
for encrypted bundles and with having thousands of recipients, the CMS
structure size can reach a notable size. If that's combined with a quite
small update image, the sanity check can be triggered and prevents from
installing such a bundle.

Since this is just a sanity check, since we have other sanity checks and
since we intend to support large amounts of encryption recipients,
simply remove the sanity check.

Fixes rauc#1308.

Signed-off-by: Enrico Joerns <ejo@pengutronix.de>
@ejoerns ejoerns added the fixed label Jan 9, 2024
Copy link

codecov bot commented Jan 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (cc03d35) 80.21% compared to head (b81595f) 80.23%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1316      +/-   ##
==========================================
+ Coverage   80.21%   80.23%   +0.02%     
==========================================
  Files          67       67              
  Lines       19980    19972       -8     
==========================================
- Hits        16026    16024       -2     
+ Misses       3954     3948       -6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jluebbe jluebbe self-requested a review January 9, 2024 15:18
@ejoerns
Copy link
Member Author

ejoerns commented Jan 9, 2024

The check compares the signature size against the complete bundle size, not only the payload size as I initially thought. And the complete bundle size (which includes the signature) should, of course, always be smaller than just the signature size.

So there is no reason to remove the check.

@ejoerns ejoerns closed this Jan 9, 2024
@ejoerns ejoerns removed the fixed label Jan 9, 2024
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.

Cannot create a large amount of device keys for encrypted bundles
1 participant