Crypto_43_HSE question about loading of SHE keys

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Crypto_43_HSE question about loading of SHE keys

Jump to solution
131 Views
strofald
Contributor III

Hello,

I am in the process of loading a MASTER_ECU_KEY in the HSE NVM (for the first time) by using the Crypto_43_HSE RTD v5.0.0.

I saw that the process is successful: the HSE responds with an OK message, and the values of M4 and M5 match with the ones I expect. I am also able to set the key to valid.

To do that, I build a M1M2M3 with the following attributes:
new key:    0102030405060708090a0b0c0d0e0f
auth_key:  00000000000000000000000000000

counter: 1

However, the following happens: if I issue a Reset after loading the mentioned master key, and then I start the FW again, I am able to repeat the MASTER ECU KEY loading with the same M1M2M3 that I used in the first place (see above) and it completes successful.
This means that I am re-using the same counter value (1) to load the master key, also using new key and auth key values that do not match with what should have been saved in NvM (I expect the master key now to be 0102030405060708090a0b0c0d0e0f).
Also, in my understanding, once the Master ECU Key has been loaded with a counter value, I should not be able to use that old counter value but I need to increase it each time, right? 

It seems like the key is not persisted to NvM after reset or something like that, so that when I go out of reset is like the master key has never been loaded.

Do you have any clue on why this happens? Thanks.

Tags (3)
0 Kudos
Reply
1 Solution
95 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi @strofald 

Don't you run Crypto_43_HSE_Exts_FormatKeyCatalogs() again after reset? This will erase all the keys. You should call this function only first time or when you want to erase everything to start over.

Regards,

Lukas

View solution in original post

0 Kudos
Reply
3 Replies
125 Views
strofald
Contributor III

Just wanted to add that starting from reset, when I perform the Master ECU Key Element Set successfully for the first time and then I try to do it again without a reset in-between, an error is correctly thrown from the key element set. The unexpected behavior is only observable when I try to perform the loading with a reset in-between.

0 Kudos
Reply
96 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi @strofald 

Don't you run Crypto_43_HSE_Exts_FormatKeyCatalogs() again after reset? This will erase all the keys. You should call this function only first time or when you want to erase everything to start over.

Regards,

Lukas

0 Kudos
Reply
82 Views
strofald
Contributor III
Yes, that was the real issue. Thanks for pointing it out.
Kind regards
0 Kudos
Reply