-
Notifications
You must be signed in to change notification settings - Fork 190
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
Cannot create a large amount of device keys for encrypted bundles #1308
Comments
Hm, this looks like you run into a sanity check that existed before we introduced 'crypt' bundles. When the signature (i.e. all your encryption keys together + the CMS structure) is larger than the payload (i.e. the squashfs), you would actually run into this. What kind of payload do you have? Is it an actual image? However, I would see this as a bug in RAUC since it prevents using a large number of recipients together with small payloads, which is not intentional. |
The payload is a root file system and Linux Kernel - the total size of the bundle is about ~200 MB. I do agree that this probably belongs under the RAUC repository. |
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 <[email protected]>
Re-checking this again I have to admit that my initial assumption about the sanity check was wrong. The sanity check is fine as it is. Thus I have no clue why you see
in that case. I have re-tested encrypting and calling On the other hand, when using notably more keys, I can reproduce running into another sanity check:
This should be addressed but is not an explanation for the @phishstang65 Could you provide an output log from the corresponding |
@phishstang65 Have you been able to get more information about the problem or any logs that we could have a look at? |
@phishstang65 Do you have more information? Otherwise, we'll have to close this issue. |
I am using Yocto ( Kirkstone ) to create an image for an embeded Linux device with Linux Kernel version 5.15.
I have implemented encrypted bundles with rauc using this guide:
https://www.pengutronix.de/en/blog/2022-03-31-tutorial-rauc-bundle-encryption-using-meta-rauc.html
Everything works great with the resulting bundle and on the end device, unless I try to create a number of device keys greater than 256.
I use this bit of code to create the device keys:
I then do a Yocto build, and encrypt the resulting *.raucb bundle with commands like this on the build machine:
If I generate only 256 keys initially, this whole process works and the encrypted bundle can be used for updates. If I generate more than 256 keys, I get the following error - both on the build machine during the 'rauc info' stage, and also on the device if I try to update with the bundle.
Signature size [..] exceeds bundle size
I've seen this issue which references the same error - however the file md5sums match what I expect and without changing anything else, if I create less keys, then it works:
rauc/meta-rauc#235
I would greatly appreciate any help in resolving this - thanks.
The text was updated successfully, but these errors were encountered: