diff --git a/components/esp-tls/CMakeLists.txt b/components/esp-tls/CMakeLists.txt index 839161e4bf..e4520bd0ff 100644 --- a/components/esp-tls/CMakeLists.txt +++ b/components/esp-tls/CMakeLists.txt @@ -20,11 +20,6 @@ if(CONFIG_ESP_TLS_USING_WOLFSSL) target_link_libraries(${COMPONENT_LIB} PUBLIC ${wolfssl}) endif() -if(CONFIG_ESP_TLS_USE_SE) - idf_component_get_property(cryptoauthlib esp-cryptoauthlib COMPONENT_LIB) - target_link_libraries(${COMPONENT_LIB} PUBLIC ${cryptoauthlib}) -endif() - # Increase link multiplicity to get some lwip symbols correctly resolved by the linker # due to cyclic dependencies present in IDF for lwip/esp_netif/mbedtls idf_component_get_property(lwip lwip COMPONENT_LIB) diff --git a/components/esp-tls/esp_tls.c b/components/esp-tls/esp_tls.c index 29b14f508c..ee57e0c792 100644 --- a/components/esp-tls/esp_tls.c +++ b/components/esp-tls/esp_tls.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2019-2021 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2019-2022 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -92,11 +92,6 @@ static ssize_t tcp_write(esp_tls_t *tls, const char *data, size_t datalen) /** * @brief Close the TLS connection and free any allocated resources. */ -void esp_tls_conn_delete(esp_tls_t *tls) -{ - esp_tls_conn_destroy(tls); -} - int esp_tls_conn_destroy(esp_tls_t *tls) { if (tls != NULL) { @@ -463,14 +458,14 @@ esp_tls_t *esp_tls_conn_new(const char *hostname, int hostlen, int port, const e if (ret == 1) { return tls; } else if (ret == -1) { - esp_tls_conn_delete(tls); + esp_tls_conn_destroy(tls); ESP_LOGE(TAG, "Failed to open new connection"); return NULL; } else if (ret == 0 && cfg->timeout_ms >= 0) { size_t timeout_ticks = pdMS_TO_TICKS(cfg->timeout_ms); uint32_t expired = xTaskGetTickCount() - start; if (expired >= timeout_ticks) { - esp_tls_conn_delete(tls); + esp_tls_conn_destroy(tls); ESP_LOGE(TAG, "Failed to open new connection in specified timeout"); return NULL; } @@ -544,7 +539,7 @@ esp_tls_t *esp_tls_conn_http_new(const char *url, const esp_tls_cfg_t *cfg) get_port(url, &u), cfg, tls) == 1) { return tls; } - esp_tls_conn_delete(tls); + esp_tls_conn_destroy(tls); return NULL; } diff --git a/components/esp-tls/esp_tls.h b/components/esp-tls/esp_tls.h index 588f70d83f..864df2fc4f 100644 --- a/components/esp-tls/esp_tls.h +++ b/components/esp-tls/esp_tls.h @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2017-2021 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2017-2022 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -499,11 +499,9 @@ static inline ssize_t esp_tls_conn_read(esp_tls_t *tls, void *data, size_t data /** * @brief Compatible version of esp_tls_conn_destroy() to close the TLS/SSL connection * - * @note This API will be removed in IDFv5.0 - * * @param[in] tls pointer to esp-tls as esp-tls handle. */ -void esp_tls_conn_delete(esp_tls_t *tls); +void esp_tls_conn_delete(esp_tls_t *tls) __attribute__((deprecated("Please use esp_tls_conn_destroy() instead"))); /** * @brief Close the TLS/SSL connection and free any allocated resources. diff --git a/docs/en/api-reference/protocols/esp_tls.rst b/docs/en/api-reference/protocols/esp_tls.rst index cfd1ba6236..f5a9c3340f 100644 --- a/docs/en/api-reference/protocols/esp_tls.rst +++ b/docs/en/api-reference/protocols/esp_tls.rst @@ -11,7 +11,7 @@ All the configuration can be specified in the ``esp_tls_cfg_t`` data structure. * :cpp:func:`esp_tls_conn_new`: for opening a new TLS connection. * :cpp:func:`esp_tls_conn_read`: for reading from the connection. * :cpp:func:`esp_tls_conn_write`: for writing into the connection. - * :cpp:func:`esp_tls_conn_delete`: for freeing up the connection. + * :cpp:func:`esp_tls_conn_destroy`: for freeing up the connection. Any application layer protocol like HTTP1, HTTP2 etc can be executed on top of this layer. diff --git a/examples/protocols/http2_request/components/sh2lib/sh2lib.c b/examples/protocols/http2_request/components/sh2lib/sh2lib.c index 8f298c4bcc..ee885449ad 100644 --- a/examples/protocols/http2_request/components/sh2lib/sh2lib.c +++ b/examples/protocols/http2_request/components/sh2lib/sh2lib.c @@ -1,16 +1,8 @@ -// Copyright 2017 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: 2017-2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #include #include #include @@ -280,7 +272,7 @@ void sh2lib_free(struct sh2lib_handle *hd) hd->http2_sess = NULL; } if (hd->http2_tls) { - esp_tls_conn_delete(hd->http2_tls); + esp_tls_conn_destroy(hd->http2_tls); hd->http2_tls = NULL; } if (hd->hostname) { diff --git a/examples/protocols/https_request/main/https_request_example_main.c b/examples/protocols/https_request/main/https_request_example_main.c index 7bc4718dd9..09375d9439 100644 --- a/examples/protocols/https_request/main/https_request_example_main.c +++ b/examples/protocols/https_request/main/https_request_example_main.c @@ -159,7 +159,7 @@ static void https_get_request(esp_tls_cfg_t cfg, const char *WEB_SERVER_URL, con } while (1); exit: - esp_tls_conn_delete(tls); + esp_tls_conn_destroy(tls); for (int countdown = 10; countdown >= 0; countdown--) { ESP_LOGI(TAG, "%d...", countdown); vTaskDelay(1000 / portTICK_PERIOD_MS); diff --git a/examples/protocols/https_x509_bundle/main/https_x509_bundle_example_main.c b/examples/protocols/https_x509_bundle/main/https_x509_bundle_example_main.c index 9a294bd624..7521f30638 100644 --- a/examples/protocols/https_x509_bundle/main/https_x509_bundle_example_main.c +++ b/examples/protocols/https_x509_bundle/main/https_x509_bundle_example_main.c @@ -72,7 +72,7 @@ static void https_get_task(void *pvParameters) ESP_LOGE(TAG, "Could not connect to %s", web_urls[i]); } - esp_tls_conn_delete(tls); + esp_tls_conn_destroy(tls); vTaskDelay(1000 / portTICK_PERIOD_MS); } diff --git a/tools/ci/check_copyright_ignore.txt b/tools/ci/check_copyright_ignore.txt index faf492ad99..7c561d7d6d 100644 --- a/tools/ci/check_copyright_ignore.txt +++ b/tools/ci/check_copyright_ignore.txt @@ -2711,7 +2711,6 @@ examples/protocols/esp_local_ctrl/main/app_main.c examples/protocols/esp_local_ctrl/main/esp_local_ctrl_service.c examples/protocols/esp_local_ctrl/scripts/esp_local_ctrl.py examples/protocols/esp_local_ctrl/scripts/proto_lc.py -examples/protocols/http2_request/components/sh2lib/sh2lib.c examples/protocols/http2_request/components/sh2lib/sh2lib.h examples/protocols/http2_request/main/http2_request_example_main.c examples/protocols/http_request/main/http_request_example_main.c