diff options
author | Devaraj Ranganna <devaraj.ranganna@linaro.org> | 2021-04-15 15:37:32 +0100 |
---|---|---|
committer | David Hu <david.hu@arm.com> | 2021-04-29 16:34:51 +0200 |
commit | 7cbffbe88e0dd0fba6eaf009bc1fded29f67c7ff (patch) | |
tree | 3e20ea829494dfe6319f2001af7c28336c6917c8 | |
parent | 13ff4571b1cbe21ef483f7cc4b7e0281dbbcda05 (diff) | |
download | trusted-firmware-m-7cbffbe88e0dd0fba6eaf009bc1fded29f67c7ff.tar.gz |
Crypto: Modify client view of key attributes
Client view of key attributes struct ensures that implementation details
of key attributes are hidden from the non-secure world.
However, while using Mbed TLS with TF-M backend (for crypto services),
Mbed TLS assumes complete key attributes are returned when queried. But
TF-M only returns client view of key attributes. This causes certain
Mbed TLS check failures especially on the key type.
As a temporary solution, element order of client view of key
attributes struct has been modified to match core key attributes. This
resolves Mbed TLS failures and at the same time still hiding
implementation details from non-secure world.
In addition to adjusting the element order of client view of key
attributes struct, size of `bits` is changed from `size_t` to
`uint16_t`. This is to match the size of `bits` same as that of
`mbed-crypto`.
Signed-off-by: Devaraj Ranganna <devaraj.ranganna@linaro.org>
Change-Id: I6e93f26926a815a7430f1167dc9d8b76c19c7dcf
-rw-r--r-- | interface/include/psa/crypto_client_struct.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/interface/include/psa/crypto_client_struct.h b/interface/include/psa/crypto_client_struct.h index 98f7bfe678..bf95c9821e 100644 --- a/interface/include/psa/crypto_client_struct.h +++ b/interface/include/psa/crypto_client_struct.h @@ -31,12 +31,12 @@ extern "C" { * data structure internally. */ struct psa_client_key_attributes_s { + uint16_t type; + uint16_t bits; uint32_t lifetime; psa_key_id_t id; - uint32_t alg; uint32_t usage; - size_t bits; - uint16_t type; + uint32_t alg; }; #define PSA_CLIENT_KEY_ATTRIBUTES_INIT {0, 0, 0, 0, 0, 0} |