From f7ed95349f6a95921a66b2376b08557fcf3425ee Mon Sep 17 00:00:00 2001 From: Mahavir Jain Date: Tue, 26 Oct 2021 12:01:24 +0530 Subject: [PATCH] mbedtls: fix dynamic buffer feature build --- .../port/dynamic/esp_mbedtls_dynamic_impl.c | 20 +++++++------------ tools/ci/check_copyright_ignore.txt | 1 - 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/components/mbedtls/port/dynamic/esp_mbedtls_dynamic_impl.c b/components/mbedtls/port/dynamic/esp_mbedtls_dynamic_impl.c index 373264452b..ecf2dc3f45 100644 --- a/components/mbedtls/port/dynamic/esp_mbedtls_dynamic_impl.c +++ b/components/mbedtls/port/dynamic/esp_mbedtls_dynamic_impl.c @@ -1,16 +1,8 @@ -// 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-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #include #include "esp_mbedtls_dynamic_impl.h" @@ -471,8 +463,10 @@ size_t esp_mbedtls_get_crt_size(mbedtls_x509_crt *cert, size_t *num) #ifdef CONFIG_MBEDTLS_DYNAMIC_FREE_CONFIG_DATA void esp_mbedtls_free_dhm(mbedtls_ssl_context *ssl) { +#ifdef CONFIG_MBEDTLS_DHM_C mbedtls_mpi_free((mbedtls_mpi *)&ssl->conf->dhm_P); mbedtls_mpi_free((mbedtls_mpi *)&ssl->conf->dhm_G); +#endif /* CONFIG_MBEDTLS_DHM_C */ } void esp_mbedtls_free_keycert(mbedtls_ssl_context *ssl) diff --git a/tools/ci/check_copyright_ignore.txt b/tools/ci/check_copyright_ignore.txt index cd75dfc3fb..1b2f5aea03 100644 --- a/tools/ci/check_copyright_ignore.txt +++ b/tools/ci/check_copyright_ignore.txt @@ -1561,7 +1561,6 @@ components/mbedtls/port/aes/esp_aes_common.c components/mbedtls/port/aes/esp_aes_gcm.c components/mbedtls/port/aes/esp_aes_xts.c components/mbedtls/port/crypto_shared_gdma/esp_crypto_shared_gdma.c -components/mbedtls/port/dynamic/esp_mbedtls_dynamic_impl.c components/mbedtls/port/dynamic/esp_mbedtls_dynamic_impl.h components/mbedtls/port/dynamic/esp_ssl_cli.c components/mbedtls/port/dynamic/esp_ssl_srv.c