mbedTLS on STM32F103RE with W5500 TCP/IP chip

14 Jun 2016

Hi everyone, I am a new developer of mbedTLS. I have been working on implementation mbedTLS for TLS client on stm32103RE. After porting mbedTLS on STM32F103RE. I have a problem with entropy and CA function

mbedtls_entropy_init( &entropy ); if( ( ret = mbedtls_ctr_drbg_seed( &ctr_drbg, mbedtls_entropy_func, &entropy, (const unsigned char *) pers, strlen( pers ) ) ) != 0 ) { sprintf((char*)xstr_buf,"failed\n ! mbedtls_ctr_drbg_seed returned %d\n", ret ); Xputc(); goto exit; }

/*

  • 0. Load certificates
  • / sprintf((char*)&xstr_buf," . Loading the CA root certificate ..." ); fflush( stdout ); Xputc();

ret = mbedtls_x509_crt_parse( &cacert, (const unsigned char *) mbedtls_test_cas_pem, mbedtls_test_cas_pem_len ); if( ret < 0 ) { sprintf((char*)&xstr_buf," failed\n ! mbedtls_x509_crt_parse returned -0x%x\n\n", -ret ); goto exit; }

After mbedtls_ctr_drbf_seed execution, the ret value is not equal to 0. I don't understand what do mbedtls_ctr_drbg_seed and mbedtls_x509_crt_parse do exactly. Could you please give me a guidance or guide line how to configure for a small embedded system such STM32F microcontroller.

Regards,