SST: Fix return value for tfm_sst_remove
This patch updates tfm_sst_remove to return
TFM_SST_ERR_OPERATION_FAILED instead of
TFM_SST_ERR_AUTH_FAILED as PSA_PS_ERROR_AUTH_FAILED is not
an error type in psa_ps_remove specification.
Change-Id: I53e4f648f99560beef4811ba4c914477d9ffbf63
Signed-off-by: Marc Moreno <marc.morenoberengue@arm.com>
diff --git a/secure_fw/services/secure_storage/tfm_protected_storage.c b/secure_fw/services/secure_storage/tfm_protected_storage.c
index c0abdfe..8da2314 100644
--- a/secure_fw/services/secure_storage/tfm_protected_storage.c
+++ b/secure_fw/services/secure_storage/tfm_protected_storage.c
@@ -177,6 +177,7 @@
enum tfm_sst_err_t tfm_sst_remove(const psa_ps_uid_t *uid)
{
enum tfm_status_e status;
+ enum tfm_sst_err_t err;
int32_t client_id;
status = tfm_core_memory_permission_check((psa_ps_uid_t *)uid,
@@ -198,7 +199,17 @@
}
/* Delete the object from the object system */
- return sst_object_delete(*uid, client_id);
+ err = sst_object_delete(*uid, client_id);
+
+ /* PSA_PS_ERROR_AUTH_FAILED is not supported by psa_ps_remove
+ * specification. So, this function returns TFM_SST_ERR_OPERATION_FAILED
+ * instead.
+ */
+ if (err == TFM_SST_ERR_AUTH_FAILED) {
+ return TFM_SST_ERR_OPERATION_FAILED;
+ }
+
+ return err;
}
enum tfm_sst_err_t tfm_sst_get_support(uint32_t *support_flags)