From d0021b5de77c991a19260ff4325e416f2f5b4e9e Mon Sep 17 00:00:00 2001 From: Oren Cohen Date: Thu, 7 Mar 2019 22:31:42 +0200 Subject: [PATCH] Fix error codes for psa_attestation_inject_key --- .../attestation/COMPONENT_PSA_SRV_IPC/psa_attest_inject_key.c | 4 ---- .../attestation/COMPONENT_SPE/psa_attestation_partition.c | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/components/TARGET_PSA/services/attestation/COMPONENT_PSA_SRV_IPC/psa_attest_inject_key.c b/components/TARGET_PSA/services/attestation/COMPONENT_PSA_SRV_IPC/psa_attest_inject_key.c index 5189ab3be3..0291dc2599 100755 --- a/components/TARGET_PSA/services/attestation/COMPONENT_PSA_SRV_IPC/psa_attest_inject_key.c +++ b/components/TARGET_PSA/services/attestation/COMPONENT_PSA_SRV_IPC/psa_attest_inject_key.c @@ -51,9 +51,5 @@ psa_attestation_inject_key(const uint8_t *key_data, call_error = psa_call(handle, in_vec, 2, out_vec, 2); psa_close(handle); - - if (call_error < 0) { - call_error = PSA_ERROR_COMMUNICATION_FAILURE; - } return call_error; } diff --git a/components/TARGET_PSA/services/attestation/COMPONENT_SPE/psa_attestation_partition.c b/components/TARGET_PSA/services/attestation/COMPONENT_SPE/psa_attestation_partition.c index 65e428271e..66cedca666 100755 --- a/components/TARGET_PSA/services/attestation/COMPONENT_SPE/psa_attestation_partition.c +++ b/components/TARGET_PSA/services/attestation/COMPONENT_SPE/psa_attestation_partition.c @@ -175,7 +175,7 @@ static void psa_attest_inject_key(void) uint32_t bytes_read = 0; if (msg.in_size[0] != sizeof(psa_key_type_t)) { - status = PSA_ERROR_COMMUNICATION_FAILURE; + status = PSA_ERROR_INVALID_ARGUMENT; break; }