2022-06-06 11:59 PM
As per current SBSFU Key storage mechanism, we can store One Key per each SLOT wise, as we are going to use single slot, we can configure one Key in SBSFU.
Also, if you want to store more keys, we can use other slot keys as well like ECC_KEY2 and ECC_KEY3. Need some customization at SBSFU to utilise these for SLOT 1 firmware purpose. is my understanding correct ??
Then i have some following questions on KEY Revoke mechanism
We are thinking of solution in case of one KEY1 compromised, and we want to switch to alternate KEY2 for further verification of Firmware. So please suggest better solution to this ??
2022-06-22 07:17 AM
Again, this is not trivial.
My main point is really to insist on the complexity that a secure key revocation management might bring.
2022-06-23 01:33 AM
understood the importance of Key Revoke management @Fred . Thank you very much for your unconditional support. Thank You Very Much.
Will try this and come back to you if more queries :smiling_face_with_smiling_eyes:
2022-06-28 02:30 AM
@Fred We are thinking of some solution on Key Revoke mechanism as mentioned below.
X-CUBE-SBSFU has capability to store up to 3 Keys (Slot1,Slot2 and Slot3 Key).
So here is the check we want to perform in SBSFU itself.
Happy Path
KEY 1 Compromise Case
So, as per the above, we can keep Revoked Key information in ACT SLOT Header or some other location where we can mark that as WRP protected on FLASH.
For you, is this solution looks feasible enough?? or do you see any challenges in doing this at SBSFU level??
From my point of view, as we restricting logic to SBSFU itself, i felt is is better option.
2022-06-28 03:09 AM
The problem I see with this strategy is "what if" :)
So, I think that relying on an update to revoke a key might be too weak ?
This being said, if the REVOKE command is blocked too then it is the same result.
It is just that the REVOKE command may be less easily identified as it can be sent on the "standard channel" instead of the update channel maybe ?
2022-06-28 04:52 AM
@Fred what is the object you are referring ??
Also, how can we block connections to update server, as SBSFU Key only compromised, not Secure Communication Key. Still Secure Communication is in place.
To place forge firmware, it has to break Secure Communication as well.
Then, if in case of another solution where Application can initiate Revoke mechanism, still i see same weakness, in case of Forge firmware installed.
2022-06-28 05:14 AM
I am referring to the IoT device.
If your connected object is communicating over WiFi, probably via a gateway, an attacker might identify your exchanges with the update server (knowing it by the IP @ for instance) and block them with a radio jammer or by controlling the gateway.
I guess it is not trivial but hackers are very imaginative.
Such attacks can be made without breaking your device or the secure communications.
But, you may decide that such attacks are out of scope for your use-case.
Up to you do determine what you need.
2022-06-29 02:28 AM
@Fred Thanks for reply.
Anyway our device is not communicating with Gateway. It is local device, and it is communicating on UART with some other device over wired, which has connection to gateway over wired network.
Then, i believe it is not easy to break this.
So, do you see any other weakness, for the solution i proposed above ?? is it feasible enough ??
2022-06-30 02:17 AM
@Fred Can you look at above proposal and share your view ??
It's look like, too much complexity coming with enabling secure engine in application.
So, we go by above proposal, where SBSFU it self, can verify the firmware with signatures and detect which one is Valid Key or not.
But only concern here is, where we need to store this information ?? not in SBSFU as immutable.
(OR)
Separate Flash location, with what kind of protection ??
Also, i have one more query on storage of IMAGE_STATE_HANDLING in RAM. AFter status updated by application and go for RESET to execute SBSFU, this RAM area is going to disappear right ?? then how it si possible to read the status ??
2022-07-01 03:35 AM
@Fred Can you please try to answer below ??
2022-07-01 02:40 PM
Hi,
there is a noinit RAM exchange area:
/* Exported types ------------------------------------------------------------*/
#if defined(ENABLE_IMAGE_STATE_HANDLING)
#if defined(SFU_MPU_PROTECT_ENABLE) || defined(SFU_SECURE_USER_PROTECT_ENABLE)
/**
* Firmware Image State definitions : information saved in non-initialized RAM shared memory
* ==> SB_FWIMG_STATE_REGION_RAM_START
*/
#define FWIMG_STATE_TAG_INVALID 0x0035049fU /* image is not valid (typically selftest has failed) and should not boot */
#define FWIMG_STATE_TAG_VALID 0x003574e4U /* image is valid (selftest passed), image OK to boot if signature checks pass */
#define FWIMG_STATE_TAG_VALID_ALL 0x003654aaU /* master image is valid (selftest passed), all other images are automatically validated */
#define FWIMG_STATE_TAG_SELFTEST 0x0036c702U /* self tests to be executed. Image OK to boot one time if signature checks pass */
#define FWIMG_STATE_TAG_NEW 0x00375ff5U /* new image, has never run on the device */
#define FWIMG_STATE ((uint32_t *)SB_FWIMG_STATE_REGION_RAM_START)
#endif /* SFU_***_PROTECT_ENABLE */
#endif /* ENABLE_IMAGE_STATE_HANDLING */
So the principle is to define a RAM region that you do not initialize at startup.
Hence, as long as there is no power down, the data stored in RAM is available for SBSFU after a reset triggered by the application.
Of course this is only RAM and the content is lost if there is an electrical power down.