mbedtls crash on rt685 (using function mbedtls_pk_parse_public_key)

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

mbedtls crash on rt685 (using function mbedtls_pk_parse_public_key)

811 Views
Henry2
Contributor II

recently, i doing verify on rt685 using mbedtls library, but when i  use mbedtls_pk_parse_public_key function. it just crash when i turn on the power and got it into hard fault.

i have no idea, what it happen, and hard to debug, thanks.

Tags (2)
0 Kudos
3 Replies

799 Views
jeremyzhou
NXP Employee
NXP Employee

Hi,
Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.
Before answering your question, I was wondering if you can introduce the testing environment, for instance, board, code, IDE, etc.
Have a great day,
TIC

-------------------------------------------------------------------------------
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.
-------------------------------------------------------------------------------

0 Kudos

788 Views
Henry2
Contributor II

i am using nxp rt685, with bare metal c, the code just look like

mbedtls_pk_init(&pk);
int ret = mbedtls_pk_parse_public_key(&pk, pub_key, strlen(pub_key)+1);
 
the config of mbedtls is like
 
#define MBEDTLS_HAVE_ASM
#define MBEDTLS_HAVE_TIME
#define MBEDTLS_NO_PLATFORM_ENTROPY
#define MBEDTLS_ENTROPY_HARDWARE_ALT

#define MBEDTLS_AES_C
#define MBEDTLS_BIGNUM_C
#define MBEDTLS_CIPHER_C
#define MBEDTLS_CIPHER_MODE_CTR
#define MBEDTLS_CTR_DRBG_C
#define MBEDTLS_ENTROPY_C
#define MBEDTLS_MD_C
#define MBEDTLS_CMAC_C
#define MBEDTLS_GCM_C
#define MBEDTLS_CCM_C
#define MBEDTLS_SHA256_C
#define MBEDTLS_SHA512_C
#define MBEDTLS_ECP_C
#define MBEDTLS_ECP_DP_SECP256R1_ENABLED
#define MBEDTLS_ECP_DP_CURVE25519_ENABLED
#define MBEDTLS_ECDSA_C
#define MBEDTLS_ASN1_PARSE_C
#define MBEDTLS_ASN1_WRITE_C
#define MBEDTLS_ECDH_C
// for rsassa-pss-2048 encryption
#define MBEDTLS_PK_PARSE_C
#define MBEDTLS_ASN1_PARSE_C
#define MBEDTLS_PK_C
#define MBEDTLS_OID_C
#define MBEDTLS_BIGNUM_C
#define MBEDTLS_PKCS1_V21
#define MBEDTLS_PEM_PARSE_C
#define MBEDTLS_BASE64_C
#define MBEDTLS_RSA_C
0 Kudos

780 Views
jeremyzhou
NXP Employee
NXP Employee

Hi,
Thanks for your reply.
To provide the fastest possible support, I'd highly recommend you to refer to the post to find out the root cause of triggering the Hardfault.
Have a great day,
TIC

-------------------------------------------------------------------------------
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.
-------------------------------------------------------------------------------

0 Kudos