aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Hall <julian.hall@arm.com>2021-08-12 15:56:07 +0100
committerGyorgy Szing <Gyorgy.Szing@arm.com>2021-10-06 00:49:12 +0200
commit3b2fc5c70606b144b4362c5c4fab1e7e0c4efb6c (patch)
treea78381652466407e4f5137f64b320255c1627e7c
parentb2954bca46785a40acfe4a56160f7b3b2d0d5863 (diff)
downloadtrusted-services-3b2fc5c70606b144b4362c5c4fab1e7e0c4efb6c.tar.gz
Align attestation API test behaviour between deployments
Adds a missing claim source so that the set of claims is aligned between the attestation/opteesp deployment and the PC standalone service. Also adds a missing psa crypto initalisation to the psa-api-test/initial_attestation deployment. Test behaviour is now aligned when psa api tests are run in the different environments. Signed-off-by: Julian Hall <julian.hall@arm.com> Change-Id: I3529b0f5a7c9ecd2a62c32221db019f8423bd60c
-rw-r--r--deployments/attestation/opteesp/attestation_sp.c7
-rw-r--r--deployments/psa-api-test/initial_attestation/iat_locator.c6
2 files changed, 12 insertions, 1 deletions
diff --git a/deployments/attestation/opteesp/attestation_sp.c b/deployments/attestation/opteesp/attestation_sp.c
index 555ce61..7fc4040 100644
--- a/deployments/attestation/opteesp/attestation_sp.c
+++ b/deployments/attestation/opteesp/attestation_sp.c
@@ -16,6 +16,7 @@
#include <service/attestation/claims/sources/boot_seed_generator/boot_seed_generator.h>
#include <service/attestation/claims/sources/null_lifecycle/null_lifecycle_claim_source.h>
#include <service/attestation/claims/sources/instance_id/instance_id_claim_source.h>
+#include <service/attestation/claims/sources/implementation_id/implementation_id_claim_source.h>
#include <service/attestation/key_mngr/local/local_attest_key_mngr.h>
#include <service/crypto/backend/mbedcrypto/mbedcrypto_backend.h>
#include <service/secure_storage/backend/mock_store/mock_store.h>
@@ -48,6 +49,7 @@ void __noreturn sp_main(struct ffa_init_info *init_info)
struct boot_seed_generator boot_seed_claim_source;
struct null_lifecycle_claim_source lifecycle_claim_source;
struct instance_id_claim_source instance_id_claim_source;
+ struct implementation_id_claim_source implementation_id_claim_source;
/*********************************************************
* Boot phase
@@ -84,6 +86,11 @@ void __noreturn sp_main(struct ffa_init_info *init_info)
claim_source = instance_id_claim_source_init(&instance_id_claim_source);
claims_register_add_claim_source(CLAIM_CATEGORY_DEVICE, claim_source);
+ /* Implementation ID claim source */
+ claim_source = implementation_id_claim_source_init(&implementation_id_claim_source,
+ "trustedfirmware.org.ts.attestation_sp");
+ claims_register_add_claim_source(CLAIM_CATEGORY_DEVICE, claim_source);
+
/**
* Initialize the service provider
*/
diff --git a/deployments/psa-api-test/initial_attestation/iat_locator.c b/deployments/psa-api-test/initial_attestation/iat_locator.c
index 3865cd7..8859497 100644
--- a/deployments/psa-api-test/initial_attestation/iat_locator.c
+++ b/deployments/psa-api-test/initial_attestation/iat_locator.c
@@ -5,6 +5,7 @@
*/
#include <stddef.h>
+#include <psa/crypto.h>
#include <service_locator.h>
#include <service/attestation/client/psa/iat_client.h>
#include <service/attestation/client/provision/attest_provision_client.h>
@@ -19,7 +20,10 @@ int locate_service_under_test(struct logging_caller *call_logger)
{
int status = -1;
- if (!session_handle && !crypto_service_context) {
+ /* Attestation tests depend on PSA crypto so ensure library is initialised */
+ psa_status_t psa_status = psa_crypto_init();
+
+ if ((psa_status == PSA_SUCCESS) && !session_handle && !crypto_service_context) {
struct rpc_caller *caller;