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.
Solved! Go to Solution.
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
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.
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