return the new values for key type & size even if function fails

pull/9822/head
Netanel Gonen 2019-02-24 11:24:12 +02:00
parent e03b3b68c1
commit 165719d11f
1 changed files with 5 additions and 7 deletions

View File

@ -1076,14 +1076,12 @@ static void psa_key_management_operation(void)
size_t bits; size_t bits;
status = psa_get_key_information(psa_key_mng.handle, status = psa_get_key_information(psa_key_mng.handle,
&type, &bits); &type, &bits);
if (status == PSA_SUCCESS) {
if (msg.out_size[0] >= sizeof(psa_key_type_t)) if (msg.out_size[0] >= sizeof(psa_key_type_t))
psa_write(msg.handle, 0, psa_write(msg.handle, 0,
&type, sizeof(psa_key_type_t)); &type, sizeof(psa_key_type_t));
if (msg.out_size[1] >= sizeof(size_t)) { if (msg.out_size[1] >= sizeof(size_t)) {
psa_write(msg.handle, 1, &bits, sizeof(size_t)); psa_write(msg.handle, 1, &bits, sizeof(size_t));
} }
}
break; break;
} }