Soby Mathew | 23788fa | 2024-11-26 12:19:32 +0000 | [diff] [blame] | 1 | # |
| 2 | # Copyright (c) 2024, Arm Limited. All rights reserved. |
| 3 | # |
| 4 | # SPDX-License-Identifier: BSD-3-Clause |
| 5 | # |
| 6 | |
| 7 | MBEDTLS_DIR ?= ext/mbedtls |
| 8 | ifeq (${MBEDTLS_DIR},) |
| 9 | $(error Error: MBEDTLS_DIR not set) |
| 10 | endif |
| 11 | |
Olivier Deprez | 97dd9c3 | 2024-12-18 10:53:25 +0100 | [diff] [blame] | 12 | MBEDTLS_PRESENT := $(wildcard ${MBEDTLS_DIR}/include/mbedtls) |
Soby Mathew | 23788fa | 2024-11-26 12:19:32 +0000 | [diff] [blame] | 13 | |
Olivier Deprez | 97dd9c3 | 2024-12-18 10:53:25 +0100 | [diff] [blame] | 14 | ifneq (${MBEDTLS_PRESENT},) |
Soby Mathew | 23788fa | 2024-11-26 12:19:32 +0000 | [diff] [blame] | 15 | $(info Found mbedTLS at ${MBEDTLS_DIR}) |
| 16 | |
| 17 | TFTF_INCLUDES += -I${MBEDTLS_DIR}/include |
| 18 | MBEDTLS_CONFIG_FILE ?= "<configs/tftf_mbedtls_config.h>" |
| 19 | $(eval $(call add_define,TFTF_DEFINES,MBEDTLS_CONFIG_FILE)) |
| 20 | |
| 21 | # |
| 22 | # Include mbedtls source required to parse x509 certificate and its helper |
| 23 | # routines. This can be later extended to include other crypto/PSA crypto |
| 24 | # library sources. |
| 25 | # |
| 26 | TESTS_SOURCES += \ |
| 27 | $(addprefix ${MBEDTLS_DIR}/library/, \ |
| 28 | asn1parse.c \ |
| 29 | asn1write.c \ |
| 30 | constant_time.c \ |
| 31 | bignum.c \ |
| 32 | oid.c \ |
| 33 | hmac_drbg.c \ |
| 34 | memory_buffer_alloc.c \ |
| 35 | platform.c \ |
| 36 | platform_util.c \ |
| 37 | bignum_core.c \ |
| 38 | md.c \ |
| 39 | pk.c \ |
| 40 | pk_ecc.c \ |
| 41 | pk_wrap.c \ |
| 42 | pkparse.c \ |
| 43 | sha256.c \ |
| 44 | sha512.c \ |
| 45 | ecdsa.c \ |
| 46 | ecp_curves.c \ |
| 47 | ecp.c \ |
| 48 | rsa.c \ |
| 49 | rsa_alt_helpers.c \ |
| 50 | x509.c \ |
| 51 | x509_crt.c \ |
| 52 | ) |
| 53 | else |
Olivier Deprez | 97dd9c3 | 2024-12-18 10:53:25 +0100 | [diff] [blame] | 54 | $(info MbedTLS not found, some dependent tests will be skipped or fail.) |
| 55 | endif |