Attest: Set features with config header file
Signed-off-by: Xinyu Zhang <xinyu.zhang@arm.com>
Change-Id: Ieedc890472ac072705d820d4f1a4188f5aa9821f
diff --git a/test/secure_fw/suites/attestation/attest_token_decode_common.c b/test/secure_fw/suites/attestation/attest_token_decode_common.c
index b7a1b03..93f46c3 100644
--- a/test/secure_fw/suites/attestation/attest_token_decode_common.c
+++ b/test/secure_fw/suites/attestation/attest_token_decode_common.c
@@ -13,6 +13,7 @@
#include "attest.h"
#include "q_useful_buf.h"
#include "qcbor_util.h"
+#include "config_attest.h"
/**
* \file attest_token_decode_common.c
@@ -270,7 +271,7 @@
list[SECURITY_LIFECYCLE_FLAG].label = IAT_SECURITY_LIFECYCLE;
list[PROFILE_DEFINITION_FLAG].label = IAT_PROFILE_DEFINITION;
list[VERIFICATION_SERVICE_FLAG].label = IAT_VERIFICATION_SERVICE;
-#ifdef ATTEST_TOKEN_PROFILE_ARM_CCA
+#if ATTEST_TOKEN_PROFILE_ARM_CCA
list[PLAT_HASH_ALGO_ID].label = IAT_PLATFORM_HASH_ALGO_ID;
list[PLAT_CONFIG].label = IAT_PLATFORM_CONFIG;
#endif
@@ -376,7 +377,7 @@
QCBOR_TYPE_ARRAY,
&item);
if(return_value != ATTEST_TOKEN_ERR_SUCCESS) {
-#ifdef ATTEST_TOKEN_PROFILE_PSA_IOT_1 /* Other profiles mandates the SW comp*/
+#if ATTEST_TOKEN_PROFILE_PSA_IOT_1 /* Other profiles mandates the SW comp*/
if(return_value == ATTEST_TOKEN_ERR_NOT_FOUND) {
/* Now decide if it was intentionally left out. */
return_value = qcbor_util_get_top_level_item_in_map(me->payload,
diff --git a/test/secure_fw/suites/attestation/attest_token_test_values.h b/test/secure_fw/suites/attestation/attest_token_test_values.h
index 9c30176..ae3c543 100644
--- a/test/secure_fw/suites/attestation/attest_token_test_values.h
+++ b/test/secure_fw/suites/attestation/attest_token_test_values.h
@@ -12,6 +12,8 @@
#ifndef __ATTEST_TOKEN_TEST_VALUES_H__
#define __ATTEST_TOKEN_TEST_VALUES_H__
+#include "config_attest.h"
+
/**
* \file attest_token_test_values.h
*
@@ -247,14 +249,14 @@
/* The expected tokens in the minimal */
#ifdef SYMMETRIC_INITIAL_ATTESTATION
- #ifdef ATTEST_TOKEN_PROFILE_PSA_IOT_1
+ #if ATTEST_TOKEN_PROFILE_PSA_IOT_1
#define MINIMAL_TOKEN SYM_KEY_SIGNED_MINIMAL_TOKEN_PSA_IOT_1
#else
/* PSA_2_0_0 */
#define MINIMAL_TOKEN SYM_KEY_SIGNED_MINIMAL_TOKEN_PSA_2_0_0_0
#endif
#else
- #ifdef ATTEST_TOKEN_PROFILE_PSA_IOT_1
+ #if ATTEST_TOKEN_PROFILE_PSA_IOT_1
#define MINIMAL_TOKEN ASYM_KEY_SIGNED_MINIMAL_TOKEN_PSA_IOT_1
#else
/* PSA_2_0_0 or ARM_CCA profiles */
@@ -311,15 +313,14 @@
* - Claim is optional
* - Claim is not required at all
*/
-#if defined(ATTEST_TOKEN_PROFILE_PSA_IOT_1) || \
- defined(ATTEST_TOKEN_PROFILE_PSA_2_0_0)
+#if ATTEST_TOKEN_PROFILE_PSA_IOT_1 || ATTEST_TOKEN_PROFILE_PSA_2_0_0
#define TOKEN_TEST_REQUIRE_BOOT_SEED true /* Mandatory claim */
#define TOKEN_TEST_REQUIRE_CLIENT_ID true /* Mandatory claim */
#define TOKEN_TEST_REQUIRE_CERT_REF false /* Optional claim */
#define TOKEN_TEST_REQUIRE_PROFILE_DEFINITION false /* Optional claim */
#define TOKEN_TEST_REQUIRE_PLAT_HASH_ALGO_ID false /* Not required */
#define TOKEN_TEST_REQUIRE_PLAT_CONFIG false /* Not required */
-#elif defined(ATTEST_TOKEN_PROFILE_ARM_CCA)
+#elif ATTEST_TOKEN_PROFILE_ARM_CCA
#define TOKEN_TEST_REQUIRE_BOOT_SEED false /* Not required */
#define TOKEN_TEST_REQUIRE_CLIENT_ID false /* Not required */
#define TOKEN_TEST_REQUIRE_CERT_REF false /* Not required */
@@ -375,11 +376,11 @@
/* Text string naming the profile definition:
* platform/ext/common/template/attest_hal.c
*/
-#if defined(ATTEST_TOKEN_PROFILE_PSA_IOT_1)
+#if ATTEST_TOKEN_PROFILE_PSA_IOT_1
#define TOKEN_TEST_VALUE_PROFILE_DEFINITION "PSA_IOT_PROFILE_1"
-#elif defined(ATTEST_TOKEN_PROFILE_PSA_2_0_0)
+#elif ATTEST_TOKEN_PROFILE_PSA_2_0_0
#define TOKEN_TEST_VALUE_PROFILE_DEFINITION "http://arm.com/psa/2.0.0"
-#elif defined(ATTEST_TOKEN_PROFILE_ARM_CCA)
+#elif ATTEST_TOKEN_PROFILE_ARM_CCA
#define TOKEN_TEST_VALUE_PROFILE_DEFINITION "http://arm.com/CCA-SSD/1.0.0"
#else
#error "Attestation token profile is incorrect"