Attest: Disable the omission of SW components claim
In other than PSA_IOT_1 attestation profile the
SW components claim is mandatory. In the PSA_IOT_1
profile it was allowed to omit this claim (if
platform was not capable to provide this info)
and instead insert an IAT_NO_SW_COMPONENTS claim.
Required by:
https://www.ietf.org/archive/id/draft-tschofenig-rats-psa-token-09.html#name-software-components
Signed-off-by: Tamas Ban <tamas.ban@arm.com>
Change-Id: Idc2bafc3346d952847c24d1cc2fec67deced331c
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 05b9a5e..ffc401d 100644
--- a/test/secure_fw/suites/attestation/attest_token_decode_common.c
+++ b/test/secure_fw/suites/attestation/attest_token_decode_common.c
@@ -372,10 +372,8 @@
QCBOR_TYPE_ARRAY,
&item);
if(return_value != ATTEST_TOKEN_ERR_SUCCESS) {
- if(return_value != ATTEST_TOKEN_ERR_NOT_FOUND) {
- /* Something very wrong. Bail out passing on the return_value */
- goto Done;
- } else {
+#ifdef 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,
IAT_NO_SW_COMPONENTS,
@@ -395,13 +393,15 @@
return_value = ATTEST_TOKEN_ERR_SW_COMPONENTS_MISSING;
}
}
+#endif /* ATTEST_TOKEN_PROFILE_PSA_IOT_1 */
+ goto Done;
} else {
/* The SW components claim exists */
if(item.val.uCount == 0) {
/* Empty SW component not allowed */
return_value = ATTEST_TOKEN_ERR_SW_COMPONENTS_MISSING;
} else {
- /* SUCESSS! Pass on the success return_value */
+ /* SUCCESS! Pass on the success return_value */
/* Note that this assumes the array is definite length */
*num_sw_components = item.val.uCount;
}