aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/suites/attestation/attest_token_test.c12
-rw-r--r--test/suites/attestation/attest_token_test_values.h4
2 files changed, 10 insertions, 6 deletions
diff --git a/test/suites/attestation/attest_token_test.c b/test/suites/attestation/attest_token_test.c
index c6495e05f9..b6736c528b 100644
--- a/test/suites/attestation/attest_token_test.c
+++ b/test/suites/attestation/attest_token_test.c
@@ -271,7 +271,6 @@ static int_fast16_t check_simple_claims(
return_value = 0;
-
/* -- check value of the nonce claim -- */
if(!IS_ITEM_FLAG_SET(NONCE_FLAG, simple_claims->item_flags)) {
/* Claim is not present in token */
@@ -425,9 +424,14 @@ static int_fast16_t check_simple_claims(
/* Don't have to check if its presence is required */
if(TOKEN_TEST_VALUE_CLIENT_ID != INT32_MAX &&
simple_claims->client_id != TOKEN_TEST_VALUE_CLIENT_ID) {
- /* Check of its value was requested and failed */
- return_value = -63;
- goto Done;
+ /* Check the value range */
+ if(((__ARM_FEATURE_CMSE == 3U) &&
+ (simple_claims->client_id < 1)) ||
+ ((__ARM_FEATURE_CMSE != 3U) &&
+ (simple_claims->client_id > -1))) {
+ return_value = -63;
+ goto Done;
+ }
}
}
diff --git a/test/suites/attestation/attest_token_test_values.h b/test/suites/attestation/attest_token_test_values.h
index 122855a72f..b3ad0d9b15 100644
--- a/test/suites/attestation/attest_token_test_values.h
+++ b/test/suites/attestation/attest_token_test_values.h
@@ -2,7 +2,7 @@
* attest_token_test_values.h
*
* Copyright (c) 2019, Laurence Lundblade.
- * Copyright (c) 2019, Arm Limited.
+ * Copyright (c) 2019-2020, Arm Limited.
*
* SPDX-License-Identifier: BSD-3-Clause
*
@@ -150,7 +150,7 @@
#define TOKEN_TEST_REQUIRE_SECURITY_LIFECYCLE true /* Mandatory claim */
/* An integer (can be positive or negative */
-#define TOKEN_TEST_VALUE_CLIENT_ID INT32_MAX /* Value not checked */
+#define TOKEN_TEST_VALUE_CLIENT_ID 0 /* invalid value to trigger check */
#define TOKEN_TEST_REQUIRE_CLIENT_ID true /* Mandatory claim */
/* Text string naming the profile definition: