[Security] Get UID when load keys

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

[Security] Get UID when load keys

Jump to solution
2,106 Views
Gideon
Contributor III

Dear NXPs:

IC:S32K146

sample:csec_keyconfig_s32k146 in SDK S32DS

Phenomenon:
/* Extracts the UID. */
bool getUID(uint8_t *uid) When I use this function, I step into the inside of the function and when calling
When stat = CSEC_DRV_GetID(challenge, uid, &sreg, mac);, the returned mac values are all 0, but the uid is correct. Since the mac values are all 0, execute the statement stat = CSEC_DRV_VerifyMAC(CSEC_RAM_KEY, verif, 256U, mac , 128U, &verifStatus, 1U);, the verifStatus value is false.
question:
Although the return value of bool getUID(uint8_t *uid) is false, it does not affect subsequent load key processing, but I would like to know why the CSEC_DRV_GetID(challenge, uid, &sreg, mac) interface, mac is all 0?
0 Kudos
Reply
1 Solution
2,085 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi @Gideon 

I guess that this is the problem:

lukaszadrapa_0-1716372932058.png

Regards,

Lukas

View solution in original post

0 Kudos
Reply
1 Reply
2,086 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi @Gideon 

I guess that this is the problem:

lukaszadrapa_0-1716372932058.png

Regards,

Lukas

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-1869479%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%5BSecurity%5D%20Get%20UID%20when%20load%20keys%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1869479%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EDear%20NXPs%3A%3C%2FP%3E%3CP%3EIC%3AS32K146%3C%2FP%3E%3CP%3Esample%3Acsec_keyconfig_s32k146%20in%20SDK%20S32DS%3C%2FP%3E%3CDIV%3E%3CDIV%3E%3CDIV%3E%3CDIV%3E%3CDIV%3E%3CDIV%3EPhenomenon%3A%3CBR%20%2F%3E%2F*%20Extracts%20the%20UID.%20*%2F%3CBR%20%2F%3Ebool%20getUID(uint8_t%20*uid)%20When%20I%20use%20this%20function%2C%20I%20step%20into%20the%20inside%20of%20the%20function%20and%20when%20calling%3CBR%20%2F%3EWhen%20stat%20%3D%20CSEC_DRV_GetID(challenge%2C%20uid%2C%20%26amp%3Bsreg%2C%20mac)%3B%2C%20the%20returned%20mac%20values%20are%20all%200%2C%20but%20the%20uid%20is%20correct.%20Since%20the%20mac%20values%20are%20all%200%2C%20execute%20the%20statement%20stat%20%3D%20CSEC_DRV_VerifyMAC(CSEC_RAM_KEY%2C%20verif%2C%20256U%2C%20mac%20%2C%20128U%2C%20%26amp%3BverifStatus%2C%201U)%3B%2C%20the%20verifStatus%20value%20is%20false.%3CBR%20%2F%3Equestion%3A%3CBR%20%2F%3EAlthough%20the%20return%20value%20of%20bool%20getUID(uint8_t%20*uid)%20is%20false%2C%20it%20does%20not%20affect%20subsequent%20load%20key%20processing%2C%20but%20I%20would%20like%20to%20know%20why%20the%20CSEC_DRV_GetID(challenge%2C%20uid%2C%20%26amp%3Bsreg%2C%20mac)%20interface%2C%20mac%20is%20all%200%3F%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1870608%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20%5BSecurity%5D%20Get%20UID%20when%20load%20keys%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1870608%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F218898%22%20target%3D%22_blank%22%3E%40Gideon%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%20guess%20that%20this%20is%20the%20problem%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22lukaszadrapa_0-1716372932058.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22lukaszadrapa_0-1716372932058.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F280126iD82C2FB5C2CDB150%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22lukaszadrapa_0-1716372932058.png%22%20alt%3D%22lukaszadrapa_0-1716372932058.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3ERegards%2C%3C%2FP%3E%0A%3CP%3ELukas%3C%2FP%3E%3C%2FLINGO-BODY%3E