Soby Mathew | 388cd8d | 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 | |
| 12 | MBEDTLS_CHECK := $(shell find ${MBEDTLS_DIR}/include -name mbedtls) |
| 13 | |
| 14 | ifneq (${MBEDTLS_CHECK},) |
| 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 |
| 54 | $(info MbedTLS not found, some dependent tests will be skipped or failed.) |
| 55 | endif |