From fb9ae2faae28b7ab57651261c1ec98f9bf5b87bb Mon Sep 17 00:00:00 2001 From: Moran Peker Date: Sun, 17 Feb 2019 14:28:53 +0200 Subject: [PATCH] Fix incorrect return value in psa_security_lifecycle_state (emul) psa_security_lifecycle_state should return uint32_t of the security lifecycle state. bug: psa_platfrom_lifecycle_get_impl return value is psa_status_t. --- .../platform/COMPONENT_PSA_SRV_EMUL/platform_emul.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/components/TARGET_PSA/services/platform/COMPONENT_PSA_SRV_EMUL/platform_emul.c b/components/TARGET_PSA/services/platform/COMPONENT_PSA_SRV_EMUL/platform_emul.c index 36a66250dd..78c01fda9d 100644 --- a/components/TARGET_PSA/services/platform/COMPONENT_PSA_SRV_EMUL/platform_emul.c +++ b/components/TARGET_PSA/services/platform/COMPONENT_PSA_SRV_EMUL/platform_emul.c @@ -21,7 +21,12 @@ uint32_t psa_security_lifecycle_state(void) { uint32_t lc_state = 0; - return psa_platfrom_lifecycle_get_impl(&lc_state); + psa_status_t status = PSA_LIFECYCLE_SUCCESS; + status = psa_platfrom_lifecycle_get_impl(&lc_state); + if (status != PSA_LIFECYCLE_SUCCESS) { + lc_state = PSA_LIFECYCLE_UNKNOWN; + } + return lc_state; } psa_status_t mbed_psa_reboot_and_request_new_security_state(uint32_t new_state)