From 165719d11fb45e5e8ee11567f17eef9c3e9c4881 Mon Sep 17 00:00:00 2001 From: Netanel Gonen Date: Sun, 24 Feb 2019 11:24:12 +0200 Subject: [PATCH] return the new values for key type & size even if function fails --- .../crypto/COMPONENT_SPE/psa_crypto_partition.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/components/TARGET_PSA/services/crypto/COMPONENT_SPE/psa_crypto_partition.c b/components/TARGET_PSA/services/crypto/COMPONENT_SPE/psa_crypto_partition.c index 8b6dd75b03..3c7a72363d 100644 --- a/components/TARGET_PSA/services/crypto/COMPONENT_SPE/psa_crypto_partition.c +++ b/components/TARGET_PSA/services/crypto/COMPONENT_SPE/psa_crypto_partition.c @@ -1076,13 +1076,11 @@ static void psa_key_management_operation(void) size_t bits; status = psa_get_key_information(psa_key_mng.handle, &type, &bits); - if (status == PSA_SUCCESS) { - if (msg.out_size[0] >= sizeof(psa_key_type_t)) - psa_write(msg.handle, 0, - &type, sizeof(psa_key_type_t)); - if (msg.out_size[1] >= sizeof(size_t)) { - psa_write(msg.handle, 1, &bits, sizeof(size_t)); - } + if (msg.out_size[0] >= sizeof(psa_key_type_t)) + psa_write(msg.handle, 0, + &type, sizeof(psa_key_type_t)); + if (msg.out_size[1] >= sizeof(size_t)) { + psa_write(msg.handle, 1, &bits, sizeof(size_t)); } break;