From 5edad7f89f21915895b2aa0bcd6931cd5ec84ac1 Mon Sep 17 00:00:00 2001 From: Thomas Daubney Date: Wed, 5 Jun 2024 10:33:16 +0100 Subject: [PATCH] Remove MBEDTLS_DHM_ALT Signed-off-by: Thomas Daubney --- include/mbedtls/mbedtls_config.h | 1 - library/dhm.c | 3 --- tests/include/alt-dummy/dhm_alt.h | 16 ---------------- tests/scripts/all.sh | 12 ------------ .../drivers/builtin/include/mbedtls/dhm.h | 6 ------ 5 files changed, 38 deletions(-) delete mode 100644 tests/include/alt-dummy/dhm_alt.h diff --git a/include/mbedtls/mbedtls_config.h b/include/mbedtls/mbedtls_config.h index 2d1c9c14e4..25ef0ca4ac 100644 --- a/include/mbedtls/mbedtls_config.h +++ b/include/mbedtls/mbedtls_config.h @@ -383,7 +383,6 @@ //#define MBEDTLS_CHACHAPOLY_ALT //#define MBEDTLS_CMAC_ALT //#define MBEDTLS_DES_ALT -//#define MBEDTLS_DHM_ALT //#define MBEDTLS_ECJPAKE_ALT //#define MBEDTLS_GCM_ALT //#define MBEDTLS_NIST_KW_ALT diff --git a/library/dhm.c b/library/dhm.c index bcc07f5441..75af8b7910 100644 --- a/library/dhm.c +++ b/library/dhm.c @@ -33,8 +33,6 @@ #include "mbedtls/platform.h" -#if !defined(MBEDTLS_DHM_ALT) - /* * helper to validate the mbedtls_mpi size and import it */ @@ -642,7 +640,6 @@ int mbedtls_dhm_parse_dhmfile(mbedtls_dhm_context *dhm, const char *path) } #endif /* MBEDTLS_FS_IO */ #endif /* MBEDTLS_ASN1_PARSE_C */ -#endif /* MBEDTLS_DHM_ALT */ #if defined(MBEDTLS_SELF_TEST) diff --git a/tests/include/alt-dummy/dhm_alt.h b/tests/include/alt-dummy/dhm_alt.h deleted file mode 100644 index 3cb51d2ed4..0000000000 --- a/tests/include/alt-dummy/dhm_alt.h +++ /dev/null @@ -1,16 +0,0 @@ -/* dhm_alt.h with dummy types for MBEDTLS_DHM_ALT */ -/* - * Copyright The Mbed TLS Contributors - * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later - */ - -#ifndef DHM_ALT_H -#define DHM_ALT_H - -typedef struct mbedtls_dhm_context { - int dummy; -} -mbedtls_dhm_context; - - -#endif /* dhm_alt.h */ diff --git a/tests/scripts/all.sh b/tests/scripts/all.sh index de74f97b6b..6b439aa8b8 100755 --- a/tests/scripts/all.sh +++ b/tests/scripts/all.sh @@ -2451,24 +2451,12 @@ component_build_module_alt () { # Enable all MBEDTLS_XXX_ALT for whole modules. Do not enable # MBEDTLS_XXX_YYY_ALT which are for single functions. scripts/config.py set-all 'MBEDTLS_([A-Z0-9]*|NIST_KW)_ALT' - scripts/config.py unset MBEDTLS_DHM_ALT #incompatible with MBEDTLS_DEBUG_C # We can only compile, not link, since we don't have any implementations # suitable for testing with the dummy alt headers. make CFLAGS='-Werror -Wall -Wextra -I../tests/include/alt-dummy' lib } -component_build_dhm_alt () { - msg "build: MBEDTLS_DHM_ALT" # ~30s - scripts/config.py full - scripts/config.py set MBEDTLS_DHM_ALT - # debug.c currently references mbedtls_dhm_context fields directly. - scripts/config.py unset MBEDTLS_DEBUG_C - # We can only compile, not link, since we don't have any implementations - # suitable for testing with the dummy alt headers. - make CFLAGS='-Werror -Wall -Wextra -I../tests/include/alt-dummy' lib -} - component_test_no_psa_crypto_full_cmake_asan() { # full minus MBEDTLS_PSA_CRYPTO_C: run the same set of tests as basic-build-test.sh msg "build: cmake, full config minus PSA crypto, ASan" diff --git a/tf-psa-crypto/drivers/builtin/include/mbedtls/dhm.h b/tf-psa-crypto/drivers/builtin/include/mbedtls/dhm.h index fcba3d2af0..01434052ea 100644 --- a/tf-psa-crypto/drivers/builtin/include/mbedtls/dhm.h +++ b/tf-psa-crypto/drivers/builtin/include/mbedtls/dhm.h @@ -93,8 +93,6 @@ typedef enum { extern "C" { #endif -#if !defined(MBEDTLS_DHM_ALT) - /** * \brief The DHM context structure. */ @@ -112,10 +110,6 @@ typedef struct mbedtls_dhm_context { } mbedtls_dhm_context; -#else /* MBEDTLS_DHM_ALT */ -#include "dhm_alt.h" -#endif /* MBEDTLS_DHM_ALT */ - /** * \brief This function initializes the DHM context. *