Hello,
I want to extend the at_client sample with vanilla Mbed TLS (delivered with the SDK) supporting TLS. Later on, I want to be able to modify the Mbed TLS vanilla implementation. I already asked a similar question but it looks like I better start again.
As approach I modified prj.conf to add vanilla Mbed TLS and networking:
CONFIG_ASSERT=y
CONFIG_NORDIC_SECURITY_BACKEND=y
CONFIG_MBEDTLS_VANILLA_BACKEND=y
CONFIG_MBEDTLS=y
CONFIG_MBEDTLS_LIBRARY=y
CONFIG_MBEDTLS_BUILTIN=n
CONFIG_APP_LINK_WITH_MBEDTLS=y
CONFIG_MBEDTLS_INSTALL_PATH="DUMMY"
CONFIG_MBEDTLS_ENTROPY_ENABLED=y
CONFIG_MBEDTLS_X509_LIBRARY=y
CONFIG_MBEDTLS_TLS_LIBRARY=y
CONFIG_NRF_SECURITY_ADVANCED=yCONFIG_NET_IPV4=y
CONFIG_NET_IPV6=y
CONFIG_NET_TCP=y# Network
CONFIG_NETWORKING=y
CONFIG_NET_NATIVE=y
CONFIG_NET_SOCKETS=y
CONFIG_NET_SOCKETS_OFFLOAD=y
CONFIG_NET_SOCKETS_POSIX_NAMES=y# Modem library
CONFIG_NRF_MODEM_LIB=y# AT host library
CONFIG_AT_HOST_LIBRARY=y
CONFIG_UART_INTERRUPT_DRIVEN=y# Stacks and heaps
CONFIG_MAIN_STACK_SIZE=3072
CONFIG_HEAP_MEM_POOL_SIZE=16384
Then I added some includes and code to main.c (according to ssl_client1.c from Mbed TLS)
#include "mbedtls/net.h"
#include "mbedtls/ssl.h"
#include "mbedtls/entropy.h"
#include "mbedtls/ctr_drbg.h"
#include "mbedtls/debug.h"
void do_mbedtls_stuff(void){
mbedtls_net_context server_fd;
mbedtls_entropy_context entropy;
mbedtls_ctr_drbg_context ctr_drbg;
mbedtls_ssl_context ssl;
mbedtls_ssl_config conf;
mbedtls_x509_crt cacert;
const char *pers = "ssl_client1";
server_fd.fd = -1; //mbedtls_net_init( &server_fd ); <- due to mbedtls_net_init not found
mbedtls_ssl_init( &ssl );
mbedtls_ssl_config_init( &conf );
mbedtls_x509_crt_init( &cacert );
mbedtls_ctr_drbg_init( &ctr_drbg );
mbedtls_entropy_init( &entropy ); // <- current compile error
return;
}
and I get the following compile error:
modules/nrfxlib/nrf_security/src/mbedtls/libmbedtls_base_vanilla.a(entropy.c.obj): in function `mbedtls_entropy_init':
undefined reference to `mbedtls_hardware_poll'
This looks to me like I might be on the wrong track regarding the integration?
Or do I have to integratie networking/entropy/timing manually?