Topics

CONFIG_MBEDTLS_BUILTIN vs CONFIG_MBEDTLS_LIBRARY

Linux Weekend Learning
 

Hi All,

What is the difference between CONFIG_MBEDTLS_BUILTIN vs  CONFIG_MBEDTLS_LIBRARY

When i set  CONFIG_MBEDTLS_LIBRARY it is throwing error:

/home/jamal/zephyrproject/zephyr/subsys/net/lib/sockets/sockets_tls.c:24:10: fatal error: mbedtls/config.h: No such file or directory
 #include "mbedtls/config.h"
          ^~~~~~~~~~~~~~~~~~
compilation terminated.

I want to set MBEDTLS_X509_CRT_PARSE_C, so that my certificate and private keys are parsed by the mbedtls library, can you please provide me steps to achieve this?

Sebastian Boe
 

Hi,

I would recommend opening menuconfig and reading the help text for each option.

________________________________________
From: devel@... <devel@...> on behalf of Linux Weekend Learning via Lists.Zephyrproject.Org <md.jamalmohiuddin=gmail.com@...>
Sent: Monday, March 2, 2020 3:14 PM
To: devel@...
Cc: devel@...
Subject: [Zephyr-devel] CONFIG_MBEDTLS_BUILTIN vs CONFIG_MBEDTLS_LIBRARY

Hi All,

What is the difference between CONFIG_MBEDTLS_BUILTIN vs CONFIG_MBEDTLS_LIBRARY

When i set CONFIG_MBEDTLS_LIBRARY it is throwing error:

/home/jamal/zephyrproject/zephyr/subsys/net/lib/sockets/sockets_tls.c:24:10: fatal error: mbedtls/config.h: No such file or directory
#include "mbedtls/config.h"
^~~~~~~~~~~~~~~~~~
compilation terminated.

I want to set MBEDTLS_X509_CRT_PARSE_C, so that my certificate and private keys are parsed by the mbedtls library, can you please provide me steps to achieve this?

Linux Weekend Learning
 

I added this in my prj.conf file

CONFIG_MBEDTLS_USER_CONFIG_ENABLE=y
CONFIG_MBEDTLS_USER_CONFIG_FILE="user-tls.conf"

user-tls.conf file:

#define MBEDTLS_X509_CRT_PARSE_C

In my code, i added a check to see whether this is enabled or not
#if defined(MBEDTLS_X509_CRT_PARSE_C)
LOG_INF("Enabled");
#endif

This log is not printing, what mistake i am doing. i need to set  MBEDTLS_X509_CRT_PARSE_C for certificate and private key to be accepted by socket_tls.c


On Mon, Mar 2, 2020 at 7:45 PM Bøe, Sebastian <Sebastian.Boe@...> wrote:
Hi,

I would recommend opening menuconfig and reading the help text for each option.

________________________________________
From: devel@... <devel@...> on behalf of Linux Weekend Learning via Lists.Zephyrproject.Org <md.jamalmohiuddin=gmail.com@...>
Sent: Monday, March 2, 2020 3:14 PM
To: devel@...
Cc: devel@...
Subject: [Zephyr-devel] CONFIG_MBEDTLS_BUILTIN vs CONFIG_MBEDTLS_LIBRARY

Hi All,

What is the difference between CONFIG_MBEDTLS_BUILTIN vs  CONFIG_MBEDTLS_LIBRARY

When i set  CONFIG_MBEDTLS_LIBRARY it is throwing error:

/home/jamal/zephyrproject/zephyr/subsys/net/lib/sockets/sockets_tls.c:24:10: fatal error: mbedtls/config.h: No such file or directory
 #include "mbedtls/config.h"
          ^~~~~~~~~~~~~~~~~~
compilation terminated.

I want to set MBEDTLS_X509_CRT_PARSE_C, so that my certificate and private keys are parsed by the mbedtls library, can you please provide me steps to achieve this?

Paul Sokolovsky
 

Hello,

On Mon, 2 Mar 2020 14:15:57 +0000
"Sebastian Boe" <Sebastian.Boe@...> wrote:

Hi,

I would recommend opening menuconfig and reading the help text for
each option.
It's also possible to search/read config option descriptions in Zephyr
docs, just go to https://docs.zephyrproject.org/latest/ , paste an
option name into search field on the left, and voila.

That said, in this case, option descriptions are rather bare and hardly
can be understood without knowing more context (like, being a Zephyr
developer with some experience):
https://docs.zephyrproject.org/latest/reference/kconfig/CONFIG_MBEDTLS_LIBRARY.html

I'd suggest we use questions like this to actually improve config
option descriptions. In that regard, I submitted
https://github.com/zephyrproject-rtos/zephyr/pull/23217


Subject: [Zephyr-devel] CONFIG_MBEDTLS_BUILTIN vs
CONFIG_MBEDTLS_LIBRARY

Hi All,

What is the difference between CONFIG_MBEDTLS_BUILTIN vs
CONFIG_MBEDTLS_LIBRARY

When i set CONFIG_MBEDTLS_LIBRARY it is throwing error:

/home/jamal/zephyrproject/zephyr/subsys/net/lib/sockets/sockets_tls.c:24:10:
fatal error: mbedtls/config.h: No such file or directory #include
"mbedtls/config.h" ^~~~~~~~~~~~~~~~~~
compilation terminated.

I want to set MBEDTLS_X509_CRT_PARSE_C, so that my certificate and
private keys are parsed by the mbedtls library, can you please
provide me steps to achieve this?
--
Best Regards,
Paul

Linaro.org | Open source software for ARM SoCs
Follow Linaro: http://www.facebook.com/pages/Linaro
http://twitter.com/#!/linaroorg - http://www.linaro.org/linaro-blog