From 1520875247a51eeb1ac564dc2c68c0ef1ce4fe36 Mon Sep 17 00:00:00 2001 From: Ronald Cron Date: Tue, 15 Oct 2024 09:52:57 +0200 Subject: [PATCH] config_adjust_test_accelerators.h: Error out if wrong usage Signed-off-by: Ronald Cron --- .../include/mbedtls/config_adjust_test_accelerators.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tf-psa-crypto/drivers/builtin/include/mbedtls/config_adjust_test_accelerators.h b/tf-psa-crypto/drivers/builtin/include/mbedtls/config_adjust_test_accelerators.h index 7b50936dc..5f2587978 100644 --- a/tf-psa-crypto/drivers/builtin/include/mbedtls/config_adjust_test_accelerators.h +++ b/tf-psa-crypto/drivers/builtin/include/mbedtls/config_adjust_test_accelerators.h @@ -38,6 +38,14 @@ #ifndef MBEDTLS_CONFIG_ADJUST_TEST_ACCELERATORS_H #define MBEDTLS_CONFIG_ADJUST_TEST_ACCELERATORS_H +#if !defined(MBEDTLS_CONFIG_FILES_READ) +#error "Do not include mbedtls/config_adjust_*.h manually! This can lead to problems, " \ + "up to and including runtime errors such as buffer overflows. " \ + "If you're trying to fix a complaint from check_config.h, just remove " \ + "it from your configuration file: since Mbed TLS 3.0, it is included " \ + "automatically at the right point." +#endif + #if defined(PSA_CRYPTO_DRIVER_TEST_ALL) /* PSA_CRYPTO_DRIVER_TEST_ALL activates test drivers while keeping the * built-in implementations active. Normally setting MBEDTLS_PSA_ACCEL_xxx