Hi
I am using the OM‑SE050ARD‑E development board and https://github.com/NXPPlugNTrust/nano-package.
Se05x_API_GetFreeMemoryfrom SE-PLUG-TRUST-MW_04.07.00
1. I called Se05x_API_GetFreeMemory() and obtained the following memory data.
kSE05x_MemoryType_PERSISTENT get 616
kSE05x_MemoryType_TRANSIENT_RESET 796
kSE05x_MemoryType_TRANSIENT_DESELECT 784
Is this normal? The free memory seems rather low—could you please let me know approximately how much memory the SE050E provides by default?
2. Since I’ve forgotten which keys I previously set, I tried to use ex_se05x_ReadIDList() to read the list of key IDs, but it always fails with error codes 69 85.
a. SCP03 is enabled, and I have updated the ENC and MAC keys according to AN12436.
b. ex_se05x_GetInfo() runs successfully, so the SCP03 setup should be correct.
Thanks
ex_se05x_ReadIDList
I: Plug and Trust nano package - version: 1.5.4
I: Establish Secure Channel to SE05x !
I: Created scp03 Session
E: Error in Se05x_API_ReadIDList
ex_se05x_GetInfo()
I: Plug and Trust nano package - version: 1.5.4
I: Establish Secure Channel to SE05x !
I: Created scp03 Session
W: No SemsLite Applet Available.
I: Plug and Trust nano package - version: 1.5.4
I: Establish Secure Channel to SE05x !
I: Created scp03 Session
W: #####################################################
W: #####################################################
I: Applet Major = 7
I: Applet Minor = 2
I: Applet patch = 0
I: AppletConfig = 3F9F
I: With ECDSA_ECDH_ECDHE
I:
I: With EDDSA
I:
I: With DH_MONT
I:
I: With HMAC
I:
I: WithOut RSA_PLAIN
I:
I: WithOut RSA_CRT
I:
I: With AES
I:
I: With DES
I:
I: With PBKDF
I:
I: With TLS
I:
I: With MIFARE
I:
I: With I2CM
I:
W: #####################################################
I: Tag value - proprietary data 0xFE = 0xFE
I: Length of following data 0x45 = 0x45
I: Length of card identification data = 0x42
I: Tag configuration ID (Must be 0x01) = 0x01
I: OEF ID = 0xA9 0x21
I: Tag patch ID (Must be 0x02) = 0x02
I: Tag platform build ID1 (Must be 0x03) = 0x03
I: JCOP Platform ID = J3R351029B411100
I: Tag FIPS mode (Must be 0x05) = 0x05
I: FIPS mode var = 0x00
I: Tag pre-perso state (Must be 0x07) = 0x07
I: Bit mask of pre-perso state var = 0x00
I: Tag ROM ID (Must be 0x08) = 0x08
I: se05x_GetInfoPlainApplet Example Success !!!...
W: #####################################################
Hi @kennychiu ,
So you are using the nano package but copy the Se05x_API_GetFreeMemory() from the full version of MW : SE-PLUG-TRUST-MW_04.07.00, right? Please kindly clarify.
Have a great day,
Kan
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------
Hi Kan,
Yes, I use nanopackage and copy the Se05x_API_GetFreeMemory() from the full version of MW : SE-PLUG-TRUST-MW_04.07.00
Thanks
Kenny
uint32_t freemem;
Se05x_API_GetFreeMemory(&se05x_session, 0x1, &freemem);
printf("%d", freemem); //500
Se05x_API_GetFreeMemory(&se05x_session, 0x2, &freemem);
printf("%d", freemem); //764
Se05x_API_GetFreeMemory(&se05x_session, 0x3 &freemem);
printf("%d", freemem); //752
0x01f4 => 500
0x02fc => 764
0x02f0 => 752
Hi @kennychiu ,
I think the SE on your hands might be provisioned with some secure objects already, which consumed the memory inside, so please try to run the se05x_Delete_and_test_provision demo out of the full version of MW , or using the ssscli tool to reset the SE to a known state with the following command:
BTW, ssscli tool also supports readidlist, if you enabled PlatformSCP already, you have to specify the keys in a text file for authentication before connection. Please kindly refer to the following for more details.
Hope that helps,
Have a great day,
Kan
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------
Hi Kan,
I have enabled SCP03 and execute Se05x_API_DeleteAll_Iterative()
but I get error 6985 on Se05x_API_ReadIDList()
Could you help me resolve this issue?
Thanks
E: # se05x_Delete_and_test_provision !!! Only for testing. NOT FOR PRODUCTION USE!!!!
E: Failed Se05x_API_DeleteAll
Hi @kennychiu ,
Looks like you integrated se05x_Delete_and_test_provision from the full version MW into nano package, but have you also tried it with the full version MW? Was the result the same? This may help us to locate where the problem comes from. BTW, have you also tried the readidlist demo (https://github.com/NXPPlugNTrust/nano-package/tree/master/examples/se05x_ReadIDList )out of the nano package? Did it work as expected on your platform? Please kindly clarify .
Have a great day,
Kan
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------
Hi Kan,
>but have you also tried it with the full version MW?
Due to some build issues, I used the nano package to verify the SE050.
>have you also tried the readidlist demo (https://github.com/NXPPlugNTrust/nano-package/tree/master/examples/se05x_ReadIDList )out of the nano package?
Yes,
SCP03 is enabled, and I have updated the ENC and MAC keys according to AN12436.
ex_se05x_GetInfo() runs successfully, so the SCP03 setup should be correct.
>Did it work as expected on your platform?
No, I get error code 6985
ex_se05x_ReadIDList
I: Plug and Trust nano package - version: 1.5.4
I: Establish Secure Channel to SE05x !
I: Created scp03 Session
E: Error in Se05x_API_ReadIDList
Thanks
Hi @kennychiu ,
I would also suggested you switch back to plain communication to check if the demo still fails, as far as I know, the case when the SCP authentication succeed but command fails is most likely due to a wrong SCP03 encryption key . SCP Authentication only needs MAC key so the GetInfo demo works well as expected.
Have a great day,
Kan
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------
Hi @kennychiu ,
Thanks for the clarification! Would you please specify how you enabled the SCP03? Did you just run the example of se05x_rotate_scp03_keys to update the SCP keys? Have you tested with other examples like se05x_sign ?
Have a great day,
Kan
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------
Hi Kan,
> Did you just run the example of se05x_rotate_scp03_keys to update the SCP keys?
No, I don't use se05x_rotate_scp03_keys.
I use ex_se05x_ReadIDList.c and refer AN12436.pdf Table 5. SE050E
Development Board to update scp03_enc_key and scp03_mac_key
> Have you tested with other examples like se05x_sign ?
success, refer attached file: ex_se05x_sign_scp03_ok.txt
> I would also suggested you switch back to plain communication to check if the demo still fails
still fail and get 6985
E: Error in Se05x_API_ReadIDList
Thanks
Hi @kennychiu ,
This could be due to there are lots of secure objects you created in the SE , so that the response to ReadIDList command can not be held within one standard APDU frame, it needs the extended APDU format which is not supported by this command in the nano package due to buffer limitation, you may try with the full version of MW instead as a quick solution. Alternatively you may update the source code to support extended length for ReadIDList command. Please kindly refer to the following for details.
Hope that helps,
Have a great day,
Kan
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------
Hi Kan,
>Alternatively you may update the source code to support extended length for ReadIDList command.
Se05x_API_ReadIDList() DoAPDUTxRx(session_ctx, &hdr, &session_ctx->apdu_buffer[0], cmdbufLen, pRspbuf, &rspbufLen, 1); //set length_extended to 1
Se05x_API_ReadIDList still get error.
I enabled #define ENABLE_T1oI2C_LOGS 1.
When I called Se05x_API_ReadIDList(), I saw some key IDs.
//This is only an example, since I’ve already deleted most of the data.
....
I deleted them in a loop using Se05x_API_DeleteSecureObject(), and eventually ex_se05x_ReadIDList ran successfully.
May I ask if the following FLASH and RAM usage are within NXP’s expected range?
Se05x_API_GetFreeMemory(&se05x_session, 0x1, &freemem);
printf("%d", freemem); //32767
Se05x_API_GetFreeMemory(&se05x_session, 0x2, &freemem);
printf("%d", freemem); //796
Se05x_API_GetFreeMemory(&se05x_session, 0x3 &freemem);
printf("%d", freemem); //784
Thanks!
Hi @kennychiu ,
Yes, 32767, 796 and 784 are the expected results.
Have a great day,
Kan
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------
Hi Kan,
Thank you very much for your support !
Hi @kennychiu ,
You are welcome!
Have a great day,
Kan
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------