Infineon / amazon-freertos

IoT operating system for microcontrollers. https://aws.amazon.com/freertos/
MIT License
10 stars 10 forks source link

Optiga trustM pkcs11 test case fail in aws_test #15

Open Darsh-Dev opened 3 years ago

Darsh-Dev commented 3 years ago

Hi,

I am porting the optiga TrustM and AWS FreeRTOS in stm32wb55. I also port the pkcs11 for optiga trusm. When I run the aws_test code with testrunnerFULL_PKCS11_ENABLED config set to 1, it fails below 3 test cases out of 15 test cases.

-----------------------
15 Tests 3 Failures 0 Ignored
FAIL
-------ALL TESTS FINISHED-------
TEST(Full_PKCS11_NoObject, AFQP_GenerateRandomMultiThread)
TEST(Full_PKCS11_EC, AFQP_GetAttributeValueMultiThread)
TEST(Full_PKCS11_EC, AFQP_SignVerifyMultiThread)

Can you please help me to figure out, what is the reason, it fails the multithread test cases?

Please find the attached detail log. fullpkcs11_log.zip

Regards, Arjun

ayushev commented 3 years ago

Hi @Darsh-Dev

please check whether your PAL is multitask-safe. Here as some hints to check the right places:

https://github.com/Infineon/amazon-freertos/blob/feature/infineon/vendors/infineon/secure_elements/optiga_trust_m/pal/xmc4800_freertos/pal_os_lock.c

https://github.com/Infineon/amazon-freertos/blob/feature/infineon/vendors/infineon/secure_elements/optiga_trust_m/pal/xmc4800_freertos/pal_i2c.c#L78

and

https://github.com/Infineon/amazon-freertos/blob/feature/infineon/vendors/infineon/secure_elements/optiga_trust_m/pal/xmc4800_freertos/pal_i2c.c#L90

ayushev commented 3 years ago

Hi @Darsh-Dev

sorry for a delay, I missed somehow this issue. Can you please update me wheter this is still relevant? Trust M and Trust X both are quialified and all test cases were passing (PKCS11 as well). Can you please provide more details what exactly happens when the cases failes (some extra log would be helpful).