Questions about CSEc to set key's boot protected flag

cancel
Showing results for 
Search instead for 
Did you mean: 

Questions about CSEc to set key's boot protected flag

209 Views
wang_q4
Contributor I

Dear all,

I want to load a new key,but i don't kown how to set the boot protected flag?

set 1 or 0 what do sth. mean.

Here is the sample code to load usr key and boot mac key:

/* load CSEC_BOOT_MAC_KEY */
retVal = loadKey(CSEC_BOOT_MAC_KEY, key, 1, 0);

/* load a user key with the boot protected flag set to 1 */
retVal = loadKey(CSEC_KEY_1, test_key, 1, 1);

0 Kudos
1 Reply

192 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

function loadKey has following parameters:

bool loadKey(csec_key_id_t keyId, uint8_t *keyNew, uint8_t counter, bool bootProtection)

There's bool parameter bootProtection, so you can just turn it on or off.

Search for "bootProtection" in file csec_utils.c to see how it is implemented. It follows SHE specification.

Or you can check AN5401 for more details:

lukaszadrapa_0-1625645208136.png

lukaszadrapa_1-1625645255280.png

Regards,

Lukas

 

 

0 Kudos