Eliminate MbedTLS from env-test

env-test depends on MbedTLS, but only a single header file is used
from the library and only for trng_adapter tests. Eliminate this
dependency by adding a dummy header with a macro for this test
to simplify this deployment and eliminate an unnecessary MbedTLS
user configuration file.

Signed-off-by: Gabor Toth <gabor.toth2@arm.com>
Change-Id: Ia2048576a31066881103c5b64e039816135b3415
diff --git a/components/service/crypto/backend/mbedcrypto/trng_adapter/test/component.cmake b/components/service/crypto/backend/mbedcrypto/trng_adapter/test/component.cmake
index 4aa4321..67a2ee8 100644
--- a/components/service/crypto/backend/mbedcrypto/trng_adapter/test/component.cmake
+++ b/components/service/crypto/backend/mbedcrypto/trng_adapter/test/component.cmake
@@ -12,3 +12,6 @@
 	"${CMAKE_CURRENT_LIST_DIR}/trng_env_tests.c"
 	)
 
+target_include_directories(${TGT} PRIVATE
+	"${CMAKE_CURRENT_LIST_DIR}"
+	)
diff --git a/components/service/crypto/backend/mbedcrypto/trng_adapter/test/mbedtls/entropy.h b/components/service/crypto/backend/mbedcrypto/trng_adapter/test/mbedtls/entropy.h
new file mode 100644
index 0000000..4f115a6
--- /dev/null
+++ b/components/service/crypto/backend/mbedcrypto/trng_adapter/test/mbedtls/entropy.h
@@ -0,0 +1,16 @@
+/*
+ * Copyright (c) 2024, Arm Limited and Contributors. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#ifndef ENTROPY_H
+#define ENTROPY_H
+
+/*
+ * This macro is only used for baremetal testing. It is set to a random value,
+ * which is unrelated to mbedtls to avoid the need of keeping it syncronized.
+ */
+#define MBEDTLS_ERR_ENTROPY_SOURCE_FAILED (0xFFFF)
+
+#endif /* ENTROPY_H */
diff --git a/deployments/env-test/suites/baremetal-tests.cmake b/deployments/env-test/suites/baremetal-tests.cmake
index c4cf92a..23b6029 100644
--- a/deployments/env-test/suites/baremetal-tests.cmake
+++ b/deployments/env-test/suites/baremetal-tests.cmake
@@ -15,7 +15,6 @@
 	BASE_DIR ${TS_ROOT}
 	COMPONENTS
 		"components/common/uuid"
-		"components/service/crypto/backend/mbedcrypto"
 		"components/service/crypto/backend/mbedcrypto/trng_adapter/platform"
 		"components/service/crypto/backend/mbedcrypto/trng_adapter/test"
 		"components/service/secure_storage/include"
@@ -37,23 +36,6 @@
 )
 
 #-------------------------------------------------------------------------------
-#  Components used from external projects
-#
-#-------------------------------------------------------------------------------
-
-# Mbed TLS provides libmbedcrypto
-set(MBEDTLS_USER_CONFIG_FILE "${TS_ROOT}/external/MbedTLS/config/libmbed_only.h"
-	CACHE STRING "Configuration file for Mbed TLS" FORCE)
-include(${TS_ROOT}/external/MbedTLS/MbedTLS.cmake)
-target_link_libraries(env-test PRIVATE MbedTLS::mbedcrypto)
-
-# Provide the config path to mbedtls
-target_compile_definitions(env-test
-	PRIVATE
-		MBEDTLS_USER_CONFIG_FILE="${MBEDTLS_USER_CONFIG_FILE}"
-)
-
-#-------------------------------------------------------------------------------
 #  This test suite depends on platform specific drivers
 #
 #-------------------------------------------------------------------------------
diff --git a/external/MbedTLS/config/libmbed_only.h b/external/MbedTLS/config/libmbed_only.h
deleted file mode 100644
index 830f2fa..0000000
--- a/external/MbedTLS/config/libmbed_only.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright (c) 2024, Arm Limited and Contributors. All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-#ifndef CONFIG_LIBMBED_ONLY_H
-#define CONFIG_LIBMBED_ONLY_H
-
-#define MBEDTLS_PSA_CRYPTO_CONFIG
-#define MBEDTLS_NO_UDBL_DIVISION
-#undef MBEDTLS_HAVE_TIME
-#undef MBEDTLS_HAVE_TIME_DATE
-#undef MBEDTLS_FS_IO
-#define MBEDTLS_ENTROPY_HARDWARE_ALT
-#define MBEDTLS_NO_PLATFORM_ENTROPY
-#undef MBEDTLS_SELF_TEST
-#undef MBEDTLS_PLATFORM_C
-#undef MBEDTLS_PSA_ITS_FILE_C
-#undef MBEDTLS_TIMING_C
-#undef MBEDTLS_AESNI_C
-#undef MBEDTLS_AESCE_C
-#undef MBEDTLS_PADLOCK_C
-
-#define MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER
-#define BACKEND_CRYPTO_API_ADD_PREFIX(f) __mbedtls_backend_##f
-#include "../../../components/service/crypto/backend/prefixed_crypto_api.h"
-
-#endif /* CONFIG_LIBMBED_ONLY_H */