sockets: tls: Enable access to mbedtls private fields

Several fields of structures in mbedTLS 3.0 are now private. To access
them directly is necessary to define MBEDTLS_ALLOW_PRIVATE_ACCESS.

That is a temporary fix, the proper solution is not access directly
but using proper API.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This commit is contained in:
Flavio Ceolin 2021-08-17 14:49:19 -07:00 committed by Kumar Gala
parent 2bc9059bd2
commit 4edcf48e05

View File

@ -18,6 +18,20 @@ LOG_MODULE_REGISTER(net_sock_tls, CONFIG_NET_SOCKETS_LOG_LEVEL);
#include <syscall_handler.h>
#include <sys/fdtable.h>
/* TODO: Remove all direct access to private fields.
* According with Mbed TLS migration guide:
*
* Direct access to fields of structures
* (`struct` types) declared in public headers is no longer
* supported. In Mbed TLS 3, the layout of structures is not
* considered part of the stable API, and minor versions (3.1, 3.2,
* etc.) may add, remove, rename, reorder or change the type of
* structure fields.
*/
#if !defined(MBEDTLS_ALLOW_PRIVATE_ACCESS)
#define MBEDTLS_ALLOW_PRIVATE_ACCESS
#endif
#if defined(CONFIG_MBEDTLS)
#if !defined(CONFIG_MBEDTLS_CFG_FILE)
#include "mbedtls/config.h"