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

Encrypted DFU? #3520

Open
JPHutchins opened this issue Nov 10, 2024 · 4 comments
Open

Encrypted DFU? #3520

JPHutchins opened this issue Nov 10, 2024 · 4 comments
Labels
kind-feature New feature or request

Comments

@JPHutchins
Copy link

I feel like this might be one last thing missing for embassy boot? I'd love to recommend embassy but generally all my projects will want encrypted DFU.

I am a regular MCUBoot user so I can see how it wouldn't be so hard to use MCUBoot to load an embassy app.

I am curious if there is a roadmap for encrypted DFU?

Thanks!
JP

Also - the docs seem to suggest that DFU can be performed from within embassy-boot. In this scenario, a dual slot is not required, which can create a cost savings. Further, mention of the NRF soft device implies that a BLE DFU could be performed from within embassy-boot, something that Nordics own SDK can't do since the switch to Zephyr. Is it possible to have 3 regions: bootloader, soft device, and app (single slot)? And then the bootloader and app share the soft device - the bootloader for app DFU and the app for regular operation. Obviously the soft device would not be upgradable in this scheme. At least not without some magic.

@lulf
Copy link
Member

lulf commented Nov 10, 2024

Embassy boot works by having the application responsible for receiving and writing the DFU data, which in turn means the app is also responsible for encryption/description and verification(the firmware update type supports some signature checks which you can use)

On the bootloader side, it is intended to be as simple as possible, only doing the firmware swap, because it is not self-updatable and should do as little as possible.

It does support bootloading via nrf softdevice mechanism, but as you point out, it cannot update softdevice itself. Since softdevice is anyway phased out, have a look at nrf-sdc and trouble for an alternative that doesnt require softdevice.

That being said, for more advanced use cases, consider embassy boot more like a helper lib to build your custom mechanism rather than a full fledged bootloader like mcuboot.

@lulf
Copy link
Member

lulf commented Nov 10, 2024

That being said, PRs are always welcome. There is however no plans on the roadmap.

@JPHutchins
Copy link
Author

JPHutchins commented Nov 10, 2024

Thanks, I think these are good design choices! And I think it's fine for the majority of cases wherein the secondary is located on the built in flash, which is lockable.

The issue comes where the secondary is located on an external SPI flash. In this arrangement, an attacker can read the chip directly or record the SPI lines during swap. MCUBoot mitigates this by decrypting AND encrypting during swap.

Re: design choices... I have an MCUBoot build on one project that is ~90K - a lot going on there!

OK to move to discussion.

@lulf
Copy link
Member

lulf commented Nov 11, 2024

Thanks, I think these are good design choices! And I think it's fine for the majority of cases wherein the secondary is located on the built in flash, which is lockable.

The issue comes where the secondary is located on an external SPI flash. In this arrangement, an attacker can read the chip directly or record the SPI lines during swap. MCUBoot mitigates this by decrypting AND encrypting during swap.

Ah, that's interesting. Yeah, it's all about design choices, and embassy-boot just haven't had the need to support it. It does sound like a useful feature, contributions are always welcome, it's just not something that's happening until someone has the time.

I think keeping the issue open is fine, will label it accordingly.

@lulf lulf added the kind-feature New feature or request label Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind-feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants