blob: 4d1d2b1a90aaea172b14a5be8cd0d9f2188962e5 [file] [log] [blame]
Julian Halldd296222021-05-27 15:31:32 +01001#-------------------------------------------------------------------------------
Balint Dobszayff8e0cd2022-08-11 15:07:52 +02002# Copyright (c) 2021-2023, Arm Limited and Contributors. All rights reserved.
Julian Halldd296222021-05-27 15:31:32 +01003#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6#-------------------------------------------------------------------------------
7
8#-------------------------------------------------------------------------------
9# Define test suite to build. Used by the psa_arch_tests external component
10# to configure what test suite gets built.
11#-------------------------------------------------------------------------------
12set(TS_ARCH_TEST_SUITE INITIAL_ATTESTATION CACHE STRING "Arch test suite")
13
14#-------------------------------------------------------------------------------
Julian Hallb7db5802021-07-26 16:20:40 +010015# Set additional defines needed for build.
16#-------------------------------------------------------------------------------
Julian Hallc1f8b6e2021-08-06 15:21:21 +010017list(APPEND PSA_ARCH_TEST_EXTERNAL_DEFS
Balint Dobszaye42d0892023-03-31 13:49:38 +020018 -DPSA_ALG_MD4=0x02000002 -DPLATFORM_HAS_ATTEST_PK)
Julian Hallb7db5802021-07-26 16:20:40 +010019
20#-------------------------------------------------------------------------------
21# The arch test build system puts its build output under a test suite specific
22# subdirectory. The subdirectory name is different from the test suite name
23# so an additional define is needed to obtain the built library.
24#-------------------------------------------------------------------------------
25set(TS_ARCH_TEST_BUILD_SUBDIR initial_attestation CACHE STRING "Arch test build subdirectory")
26
27#-------------------------------------------------------------------------------
Gabor Toth6072c302023-04-20 14:38:37 +020028# Attestation specific components.
Julian Halldd296222021-05-27 15:31:32 +010029#
30#-------------------------------------------------------------------------------
31add_components(
Gyorgy Szing49bfd5a2021-11-23 09:39:53 +010032 TARGET "${PROJECT_NAME}"
Julian Halldd296222021-05-27 15:31:32 +010033 BASE_DIR ${TS_ROOT}
34 COMPONENTS
35 "components/service/attestation/include"
Julian Hallb57aa0d2021-07-13 10:34:59 +010036 "components/service/attestation/client/psa"
Julian Hallb7db5802021-07-26 16:20:40 +010037 "components/service/attestation/client/provision"
38)
39
Gyorgy Szing49bfd5a2021-11-23 09:39:53 +010040target_sources(${PROJECT_NAME} PRIVATE
Julian Hallb7db5802021-07-26 16:20:40 +010041 ${TS_ROOT}/deployments/psa-api-test/initial_attestation/iat_locator.c
Julian Halldd296222021-05-27 15:31:32 +010042)
43
Julian Hallb57aa0d2021-07-13 10:34:59 +010044#-------------------------------------------------------------------------------
45# Add external components used specifically for attestation tests
46#
47#-------------------------------------------------------------------------------
48
Julian Halla5443172022-05-30 11:52:11 +010049# MbedTLS used for token verification
50set(MBEDTLS_USER_CONFIG_FILE "${TS_ROOT}/external/MbedTLS/config/crypto_posix.h"
Julian Halldd296222021-05-27 15:31:32 +010051 CACHE STRING "Configuration file for mbedcrypto")
Julian Halldd296222021-05-27 15:31:32 +010052include(${TS_ROOT}/external/MbedTLS/MbedTLS.cmake)
Balint Dobszayff8e0cd2022-08-11 15:07:52 +020053target_link_libraries(${PROJECT_NAME} PRIVATE MbedTLS::mbedcrypto)
Julian Halldd296222021-05-27 15:31:32 +010054
Balint Dobszayabec4642024-01-16 10:51:51 +010055# Use Mbed TLS to provide the psa crypto api interface files
56set(PSA_CRYPTO_API_INCLUDE ${MBEDTLS_PUBLIC_INCLUDE_PATH})
57
Julian Hallb57aa0d2021-07-13 10:34:59 +010058#-------------------------------------------------------------------------------
59# Advertise PSA API include paths to PSA Arch tests
60#
61#-------------------------------------------------------------------------------
Julian Halldd296222021-05-27 15:31:32 +010062list(APPEND PSA_ARCH_TESTS_EXTERNAL_INCLUDE_PATHS ${PSA_CRYPTO_API_INCLUDE})
Julian Hallb57aa0d2021-07-13 10:34:59 +010063list(APPEND PSA_ARCH_TESTS_EXTERNAL_INCLUDE_PATHS ${PSA_ATTESTATION_API_INCLUDE})
64list(APPEND PSA_ARCH_TESTS_EXTERNAL_INCLUDE_PATHS ${PSA_COMMON_INCLUDE})
Julian Halldd296222021-05-27 15:31:32 +010065
66#-------------------------------------------------------------------------------
67# Extend with components that are common across all deployments of
Julian Halld4071382021-07-07 16:45:53 +010068# psa-api-test
Julian Halldd296222021-05-27 15:31:32 +010069#-------------------------------------------------------------------------------
Julian Halld4071382021-07-07 16:45:53 +010070include(../../psa-api-test.cmake REQUIRED)