diff --git a/components/esp-tls/CMakeLists.txt b/components/esp-tls/CMakeLists.txt index 1cdd1e5b69..561144e70e 100644 --- a/components/esp-tls/CMakeLists.txt +++ b/components/esp-tls/CMakeLists.txt @@ -12,10 +12,10 @@ endif() idf_component_register(SRCS "${srcs}" INCLUDE_DIRS . esp-tls-crypto PRIV_INCLUDE_DIRS "private_include" - # lwip and mbedtls are public requirements becasue esp_tls.h - # includes sys/socket.h and mbedtls header files. - REQUIRES mbedtls lwip - PRIV_REQUIRES http_parser) + # mbedtls is public requirements becasue esp_tls.h + # includes mbedtls header files. + REQUIRES mbedtls + PRIV_REQUIRES lwip http_parser) if(CONFIG_ESP_TLS_USING_WOLFSSL) idf_component_get_property(wolfssl esp-wolfssl COMPONENT_LIB) diff --git a/components/esp-tls/esp_tls.h b/components/esp-tls/esp_tls.h index f00490090b..d46e733782 100644 --- a/components/esp-tls/esp_tls.h +++ b/components/esp-tls/esp_tls.h @@ -7,19 +7,11 @@ #define _ESP_TLS_H_ #include -#include -#include #include "esp_err.h" #include "esp_tls_errors.h" #include "sdkconfig.h" #ifdef CONFIG_ESP_TLS_USING_MBEDTLS -#include "mbedtls/platform.h" -#include "mbedtls/net_sockets.h" -#include "mbedtls/esp_debug.h" #include "mbedtls/ssl.h" -#include "mbedtls/entropy.h" -#include "mbedtls/ctr_drbg.h" -#include "mbedtls/error.h" #ifdef CONFIG_ESP_TLS_SERVER_SESSION_TICKETS #include "mbedtls/ssl_ticket.h" #endif diff --git a/components/esp-tls/esp_tls_errors.h b/components/esp-tls/esp_tls_errors.h index ad104895aa..d87adeb43b 100644 --- a/components/esp-tls/esp_tls_errors.h +++ b/components/esp-tls/esp_tls_errors.h @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2021-22 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -8,6 +8,10 @@ #define _ESP_TLS_ERRORS_H_ #include "esp_err.h" +#ifdef CONFIG_ESP_TLS_USING_MBEDTLS +#include "mbedtls/error.h" +#endif +/* For wolfSSL, errors are included through ssl.h which is included by default by esp_tls.h */ #ifdef __cplusplus extern "C" { diff --git a/components/esp-tls/test/test_esp_tls.c b/components/esp-tls/test/test_esp_tls.c index e40cd8f14e..f6a0b7aaab 100644 --- a/components/esp-tls/test/test_esp_tls.c +++ b/components/esp-tls/test/test_esp_tls.c @@ -10,6 +10,7 @@ #include "esp_err.h" #include "esp_log.h" #include "esp_mac.h" +#include "sys/socket.h" #if SOC_SHA_SUPPORT_PARALLEL_ENG #include "sha/sha_parallel_engine.h" #elif SOC_SHA_SUPPORT_DMA diff --git a/components/tcp_transport/private_include/esp_transport_internal.h b/components/tcp_transport/private_include/esp_transport_internal.h index 05e08b0283..616086e76d 100644 --- a/components/tcp_transport/private_include/esp_transport_internal.h +++ b/components/tcp_transport/private_include/esp_transport_internal.h @@ -1,23 +1,20 @@ -// Copyright 2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef _ESP_TRANSPORT_INTERNAL_H_ #define _ESP_TRANSPORT_INTERNAL_H_ #include "esp_transport.h" +#include "sys/socket.h" #include "sys/queue.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef int (*get_socket_func)(esp_transport_handle_t t); typedef struct esp_foundation_transport { @@ -116,4 +113,8 @@ void esp_transport_esp_tls_destroy(struct transport_esp_tls* transport_esp_tls); */ void esp_transport_set_errors(esp_transport_handle_t t, const esp_tls_error_handle_t error_handle); +#ifdef __cplusplus +} +#endif + #endif //_ESP_TRANSPORT_INTERNAL_H_ diff --git a/tools/ci/check_copyright_ignore.txt b/tools/ci/check_copyright_ignore.txt index 54bb0222ff..1cf55783bf 100644 --- a/tools/ci/check_copyright_ignore.txt +++ b/tools/ci/check_copyright_ignore.txt @@ -1606,7 +1606,6 @@ components/spi_flash/test/test_spi_flash.c components/tcp_transport/include/esp_transport_ssl.h components/tcp_transport/include/esp_transport_tcp.h components/tcp_transport/include/esp_transport_ws.h -components/tcp_transport/private_include/esp_transport_internal.h components/tcp_transport/private_include/esp_transport_utils.h components/tcp_transport/test/tcp_transport_fixtures.h components/tcp_transport/test/test_transport_basic.c