S32K116 csecCMD_GET_STATUS

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

S32K116 csecCMD_GET_STATUS

Jump to solution
1,140 Views
xiaoweix
Contributor III

CSEc有什么硬件标志可以读到这个密钥槽已经加载过密钥了?现在想通过读一个硬件标志来判断已经加载过授权key或者key8了,就不在加载了, CMD_GET_STATUS这个命令可以实现吗?

0 Kudos
Reply
1 Solution
1,110 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi @xiaoweix 

It’s up to user to track the keys. There’s no flag which would inform you if a key is loaded or not. And because Memory Update Protocol must be followed to import or update a key, it not possible to “load a key again”. There’s a counter for each key which must be incremented if you want to update a key.

If you try to load the same key again (I mean with the same counter, so M1-M3 values are the same) then the key update won’t be successful and you will get error ERC_KEY_UPDATE_ERROR.

There’s one workaround to check if a key slot is still empty or if it is already loaded. You can try to perform some operation (like encryption, decryption, CMAC generation…). If a key slot is empty, you will get ERC_KEY_EMPTY error.

Regards,

Lukas

View solution in original post

0 Kudos
Reply
2 Replies
1,111 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi @xiaoweix 

It’s up to user to track the keys. There’s no flag which would inform you if a key is loaded or not. And because Memory Update Protocol must be followed to import or update a key, it not possible to “load a key again”. There’s a counter for each key which must be incremented if you want to update a key.

If you try to load the same key again (I mean with the same counter, so M1-M3 values are the same) then the key update won’t be successful and you will get error ERC_KEY_UPDATE_ERROR.

There’s one workaround to check if a key slot is still empty or if it is already loaded. You can try to perform some operation (like encryption, decryption, CMAC generation…). If a key slot is empty, you will get ERC_KEY_EMPTY error.

Regards,

Lukas

0 Kudos
Reply
1,100 Views
xiaoweix
Contributor III
好的,谢谢啦
0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2257804%22%20slang%3D%22zh-CN%22%20mode%3D%22CREATE%22%3ES32K116%20csecCMD_GET_STATUS%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2257804%22%20slang%3D%22zh-CN%22%20mode%3D%22CREATE%22%3E%3CP%3EWhat%20hardware%20flag%20does%20CSEc%20have%20to%20read%20that%20this%20key%20slot%20has%20been%20loaded%20with%20a%20key%3F%20Now%20I%20want%20to%20read%20a%20hardware%20flag%20to%20determine%20that%20the%20authorized%20key%20or%20key8%20has%20been%20loaded%20and%20is%20not%20loaded%20anymore%2C%20can%20the%20command%20CMD_GET_STATUS%20achieve%20this%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2258495%22%20slang%3D%22zh-CN%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32K116%20csecCMD_GET_STATUS%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2258495%22%20slang%3D%22zh-CN%22%20mode%3D%22CREATE%22%3EOkay%2C%20thanks.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2258212%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32K116%20csecCMD_GET_STATUS%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2258212%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%3CSPAN%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F257004%22%20target%3D%22_blank%22%3E%40xiaoweix%3C%2FA%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EIt%E2%80%99s%20up%20to%20user%20to%20track%20the%20keys.%20There%E2%80%99s%20no%20flag%20which%20would%20inform%20you%20if%20a%20key%20is%20loaded%20or%20not.%20And%20because%20Memory%20Update%20Protocol%20must%20be%20followed%20to%20import%20or%20update%20a%20key%2C%20it%20not%20possible%20to%20%E2%80%9Cload%20a%20key%20again%E2%80%9D.%20There%E2%80%99s%20a%20counter%20for%20each%20key%20which%20must%20be%20incremented%20if%20you%20want%20to%20update%20a%20key.%20%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EIf%20you%20try%20to%20load%20the%20same%20key%20again%20(I%20mean%20with%20the%20same%20counter%2C%20so%20M1-M3%20values%20are%20the%20same)%20then%20the%20key%20update%20won%E2%80%99t%20be%20successful%20and%20you%20will%20get%20error%20ERC_KEY_UPDATE_ERROR.%20%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EThere%E2%80%99s%20one%20workaround%20to%20check%20if%20a%20key%20slot%20is%20still%20empty%20or%20if%20it%20is%20already%20loaded.%20You%20can%20try%20to%20perform%20some%20operation%20(like%20encryption%2C%20decryption%2C%20CMAC%20generation%E2%80%A6).%20If%20a%20key%20slot%20is%20empty%2C%20you%20will%20get%20ERC_KEY_EMPTY%20error.%20%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3ERegards%2C%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3ELukas%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E