blob: 55ecd4ada6f82bb1ad2bb6920943563f493c1f09 [file] [log] [blame]
Julian Halldd296222021-05-27 15:31:32 +01001#-------------------------------------------------------------------------------
2# Copyright (c) 2021, Arm Limited and Contributors. All rights reserved.
3#
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#-------------------------------------------------------------------------------
17set(TS_ARCH_TEST_EXTERNAL_DEFS
18 -DPSA_ALG_MD4=0x02000002
19 CACHE STRING "Arch test external defines")
20
21#-------------------------------------------------------------------------------
22# The arch test build system puts its build output under a test suite specific
23# subdirectory. The subdirectory name is different from the test suite name
24# so an additional define is needed to obtain the built library.
25#-------------------------------------------------------------------------------
26set(TS_ARCH_TEST_BUILD_SUBDIR initial_attestation CACHE STRING "Arch test build subdirectory")
27
28#-------------------------------------------------------------------------------
Julian Halldd296222021-05-27 15:31:32 +010029# Add attestation specific components.
30#
31#-------------------------------------------------------------------------------
32add_components(
Julian Halld4071382021-07-07 16:45:53 +010033 TARGET "psa-api-test"
Julian Halldd296222021-05-27 15:31:32 +010034 BASE_DIR ${TS_ROOT}
35 COMPONENTS
36 "components/service/attestation/include"
Julian Hallb57aa0d2021-07-13 10:34:59 +010037 "components/service/attestation/client/psa"
Julian Hallb7db5802021-07-26 16:20:40 +010038 "components/service/attestation/client/provision"
39)
40
41target_sources(psa-api-test PRIVATE
42 ${TS_ROOT}/deployments/psa-api-test/initial_attestation/iat_locator.c
Julian Halldd296222021-05-27 15:31:32 +010043)
44
Julian Hallb57aa0d2021-07-13 10:34:59 +010045#-------------------------------------------------------------------------------
46# Add external components used specifically for attestation tests
47#
48#-------------------------------------------------------------------------------
49
Julian Halldd296222021-05-27 15:31:32 +010050# Configuration for mbedcrypto
51set(MBEDTLS_USER_CONFIG_FILE
52 "${TS_ROOT}/components/service/crypto/client/cpp/config_mbedtls_user.h"
53 CACHE STRING "Configuration file for mbedcrypto")
54
55# Mbed TLS provides libmbedcrypto
56include(${TS_ROOT}/external/MbedTLS/MbedTLS.cmake)
Julian Halld4071382021-07-07 16:45:53 +010057target_link_libraries(psa-api-test PRIVATE mbedcrypto)
Julian Halldd296222021-05-27 15:31:32 +010058
Julian Hallb57aa0d2021-07-13 10:34:59 +010059#-------------------------------------------------------------------------------
60# Advertise PSA API include paths to PSA Arch tests
61#
62#-------------------------------------------------------------------------------
Julian Halldd296222021-05-27 15:31:32 +010063list(APPEND PSA_ARCH_TESTS_EXTERNAL_INCLUDE_PATHS ${PSA_CRYPTO_API_INCLUDE})
Julian Hallb57aa0d2021-07-13 10:34:59 +010064list(APPEND PSA_ARCH_TESTS_EXTERNAL_INCLUDE_PATHS ${PSA_ATTESTATION_API_INCLUDE})
65list(APPEND PSA_ARCH_TESTS_EXTERNAL_INCLUDE_PATHS ${PSA_COMMON_INCLUDE})
Julian Halldd296222021-05-27 15:31:32 +010066
67#-------------------------------------------------------------------------------
68# Extend with components that are common across all deployments of
Julian Halld4071382021-07-07 16:45:53 +010069# psa-api-test
Julian Halldd296222021-05-27 15:31:32 +010070#-------------------------------------------------------------------------------
Julian Halld4071382021-07-07 16:45:53 +010071include(../../psa-api-test.cmake REQUIRED)