Julian Hall | dd29622 | 2021-05-27 15:31:32 +0100 | [diff] [blame] | 1 | #------------------------------------------------------------------------------- |
Balint Dobszay | ff8e0cd | 2022-08-11 15:07:52 +0200 | [diff] [blame^] | 2 | # Copyright (c) 2021-2023, Arm Limited and Contributors. All rights reserved. |
Julian Hall | dd29622 | 2021-05-27 15:31:32 +0100 | [diff] [blame] | 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 | #------------------------------------------------------------------------------- |
| 12 | set(TS_ARCH_TEST_SUITE INITIAL_ATTESTATION CACHE STRING "Arch test suite") |
| 13 | |
| 14 | #------------------------------------------------------------------------------- |
Julian Hall | b7db580 | 2021-07-26 16:20:40 +0100 | [diff] [blame] | 15 | # Set additional defines needed for build. |
| 16 | #------------------------------------------------------------------------------- |
Julian Hall | c1f8b6e | 2021-08-06 15:21:21 +0100 | [diff] [blame] | 17 | list(APPEND PSA_ARCH_TEST_EXTERNAL_DEFS |
| 18 | -DPSA_ALG_MD4=0x02000002) |
Julian Hall | b7db580 | 2021-07-26 16:20:40 +0100 | [diff] [blame] | 19 | |
| 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 | #------------------------------------------------------------------------------- |
| 25 | set(TS_ARCH_TEST_BUILD_SUBDIR initial_attestation CACHE STRING "Arch test build subdirectory") |
| 26 | |
| 27 | #------------------------------------------------------------------------------- |
Julian Hall | dd29622 | 2021-05-27 15:31:32 +0100 | [diff] [blame] | 28 | # Add attestation specific components. |
| 29 | # |
| 30 | #------------------------------------------------------------------------------- |
| 31 | add_components( |
Gyorgy Szing | 49bfd5a | 2021-11-23 09:39:53 +0100 | [diff] [blame] | 32 | TARGET "${PROJECT_NAME}" |
Julian Hall | dd29622 | 2021-05-27 15:31:32 +0100 | [diff] [blame] | 33 | BASE_DIR ${TS_ROOT} |
| 34 | COMPONENTS |
| 35 | "components/service/attestation/include" |
Julian Hall | b57aa0d | 2021-07-13 10:34:59 +0100 | [diff] [blame] | 36 | "components/service/attestation/client/psa" |
Julian Hall | b7db580 | 2021-07-26 16:20:40 +0100 | [diff] [blame] | 37 | "components/service/attestation/client/provision" |
| 38 | ) |
| 39 | |
Gyorgy Szing | 49bfd5a | 2021-11-23 09:39:53 +0100 | [diff] [blame] | 40 | target_sources(${PROJECT_NAME} PRIVATE |
Julian Hall | b7db580 | 2021-07-26 16:20:40 +0100 | [diff] [blame] | 41 | ${TS_ROOT}/deployments/psa-api-test/initial_attestation/iat_locator.c |
Julian Hall | dd29622 | 2021-05-27 15:31:32 +0100 | [diff] [blame] | 42 | ) |
| 43 | |
Julian Hall | b57aa0d | 2021-07-13 10:34:59 +0100 | [diff] [blame] | 44 | #------------------------------------------------------------------------------- |
| 45 | # Add external components used specifically for attestation tests |
| 46 | # |
| 47 | #------------------------------------------------------------------------------- |
| 48 | |
Julian Hall | dd29622 | 2021-05-27 15:31:32 +0100 | [diff] [blame] | 49 | # Configuration for mbedcrypto |
| 50 | set(MBEDTLS_USER_CONFIG_FILE |
| 51 | "${TS_ROOT}/components/service/crypto/client/cpp/config_mbedtls_user.h" |
| 52 | CACHE STRING "Configuration file for mbedcrypto") |
| 53 | |
| 54 | # Mbed TLS provides libmbedcrypto |
| 55 | include(${TS_ROOT}/external/MbedTLS/MbedTLS.cmake) |
Balint Dobszay | ff8e0cd | 2022-08-11 15:07:52 +0200 | [diff] [blame^] | 56 | target_link_libraries(${PROJECT_NAME} PRIVATE MbedTLS::mbedcrypto) |
Julian Hall | dd29622 | 2021-05-27 15:31:32 +0100 | [diff] [blame] | 57 | |
Julian Hall | b57aa0d | 2021-07-13 10:34:59 +0100 | [diff] [blame] | 58 | #------------------------------------------------------------------------------- |
| 59 | # Advertise PSA API include paths to PSA Arch tests |
| 60 | # |
| 61 | #------------------------------------------------------------------------------- |
Julian Hall | dd29622 | 2021-05-27 15:31:32 +0100 | [diff] [blame] | 62 | list(APPEND PSA_ARCH_TESTS_EXTERNAL_INCLUDE_PATHS ${PSA_CRYPTO_API_INCLUDE}) |
Julian Hall | b57aa0d | 2021-07-13 10:34:59 +0100 | [diff] [blame] | 63 | list(APPEND PSA_ARCH_TESTS_EXTERNAL_INCLUDE_PATHS ${PSA_ATTESTATION_API_INCLUDE}) |
| 64 | list(APPEND PSA_ARCH_TESTS_EXTERNAL_INCLUDE_PATHS ${PSA_COMMON_INCLUDE}) |
Julian Hall | dd29622 | 2021-05-27 15:31:32 +0100 | [diff] [blame] | 65 | |
| 66 | #------------------------------------------------------------------------------- |
| 67 | # Extend with components that are common across all deployments of |
Julian Hall | d407138 | 2021-07-07 16:45:53 +0100 | [diff] [blame] | 68 | # psa-api-test |
Julian Hall | dd29622 | 2021-05-27 15:31:32 +0100 | [diff] [blame] | 69 | #------------------------------------------------------------------------------- |
Julian Hall | d407138 | 2021-07-07 16:45:53 +0100 | [diff] [blame] | 70 | include(../../psa-api-test.cmake REQUIRED) |