X-CUBE-SBSFU with third-party firmware
Hi all--
I am working on a project using the STM32WB55. I would like to distribute an "official" firmware, but also allow third-party firmware to be installed. The intent is that the official firmware will be open source, so users can make changes to the official firmware and upload their own firmware to the device.
The catch is that the official firmware will include private keys (not part of the open source distribution, obviously) used for signing its output, so that users can verify that the output was produced by the official firmware, as opposed to a third-party firmware. This means:
- The official firmware should be encrypted, and X-CUBE-SBSFU will need to have the ability to decrypt that firmware.
- Users should not have access (either through JTAG or through third-party firmware) to the keys required to decrypt the official firmware, or to the decrypted official firmware itself.
I think X-CUBE-SBSFU will allow me to do this with a little modification, but I wanted to get a second opinion in case there are security issues I'm overlooking.
The main question, in my mind, is whether X-CUBE-SBSFU security relies on only "official" user applications being installed. As near as I can tell, this is not the case, since several protections are in place by the time the user application is executed:
- RDP and IWDG prevent external attacks. I am planning to use RDP level 2, as recommended, so that JTAG will not have access to RAM and Flash, and option bytes cannot be changed.
- AES keys are stored in the M0 secure memory area, and are not accessible from the user application.
- WRP prevents the user application from modifying the Secure Engine and SBSFU.
- MPU is configured to prevent the user application from executing any code outside its own memory.
In addition, the single-slot implementation of X-CUBE-SBSFU doesn't allow partial firmware updates, so the "official" firmware should be completely erased before a third-party firmware is installed.
Can you think of anything I'm overlooking here?
Michael
