From 8111286668622edfb3c51c6a63e5d18ddca2232d Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Mon, 21 Feb 2022 03:01:48 +0530 Subject: [PATCH] Add entropy_poll.h in port directory --- components/mbedtls/CMakeLists.txt | 2 +- .../mbedtls/port/include/entropy_poll.h | 28 +++++++++++++++++++ components/mbedtls/test/test_esp_crt_bundle.c | 2 +- components/mbedtls/test/test_rsa.c | 2 +- components/protocomm/src/security/security1.c | 2 +- 5 files changed, 32 insertions(+), 4 deletions(-) create mode 100644 components/mbedtls/port/include/entropy_poll.h diff --git a/components/mbedtls/CMakeLists.txt b/components/mbedtls/CMakeLists.txt index a1dac74a03..88314bb0c3 100644 --- a/components/mbedtls/CMakeLists.txt +++ b/components/mbedtls/CMakeLists.txt @@ -8,7 +8,7 @@ if(NOT BOOTLOADER_BUILD) endif() idf_component_register(SRCS "esp_crt_bundle/esp_crt_bundle.c" - INCLUDE_DIRS "port/include" "mbedtls/include" "esp_crt_bundle/include" "." + INCLUDE_DIRS "port/include" "mbedtls/include" "esp_crt_bundle/include" "./mbedtls/library" REQUIRES lwip PRIV_REQUIRES "${priv_requires}" ) diff --git a/components/mbedtls/port/include/entropy_poll.h b/components/mbedtls/port/include/entropy_poll.h new file mode 100644 index 0000000000..4bae4d1db3 --- /dev/null +++ b/components/mbedtls/port/include/entropy_poll.h @@ -0,0 +1,28 @@ +/** + * Mbedtls entropy_poll.h file + * SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ +#ifndef MBEDTLS_ENTROPY_POLL_H +#define MBEDTLS_ENTROPY_POLL_H +#include "mbedtls/build_info.h" +#include +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief Entropy poll callback for a hardware source + * + * + * \note This must accept NULL as its first argument. + */ +int mbedtls_hardware_poll( void *data, + unsigned char *output, size_t len, size_t *olen ); + +#ifdef __cplusplus +} +#endif + +#endif /* entropy_poll.h */ diff --git a/components/mbedtls/test/test_esp_crt_bundle.c b/components/mbedtls/test/test_esp_crt_bundle.c index d0ce2b7514..7e2024506f 100644 --- a/components/mbedtls/test/test_esp_crt_bundle.c +++ b/components/mbedtls/test/test_esp_crt_bundle.c @@ -19,7 +19,7 @@ #include "mbedtls/ctr_drbg.h" #include "mbedtls/x509.h" #include "mbedtls/ssl.h" -#include "mbedtls/library/entropy_poll.h" +#include "entropy_poll.h" #include "mbedtls/net_sockets.h" #include "mbedtls/error.h" #include "mbedtls/debug.h" diff --git a/components/mbedtls/test/test_rsa.c b/components/mbedtls/test/test_rsa.c index 2d4df5d00b..96d2ab8b57 100644 --- a/components/mbedtls/test/test_rsa.c +++ b/components/mbedtls/test/test_rsa.c @@ -16,7 +16,7 @@ #include "mbedtls/x509_crt.h" #include #include -#include "mbedtls/library/entropy_poll.h" +#include "entropy_poll.h" #include "freertos/FreeRTOS.h" #include "unity.h" #include "test_utils.h" diff --git a/components/protocomm/src/security/security1.c b/components/protocomm/src/security/security1.c index 2a5bc0d51c..716f4fa0a1 100644 --- a/components/protocomm/src/security/security1.c +++ b/components/protocomm/src/security/security1.c @@ -36,7 +36,7 @@ which are undefined if the following flag is not defined */ #include #include #include -#include +#include #include #include