diff options
author | Julian Hall <julian.hall@arm.com> | 2021-11-29 15:08:58 +0000 |
---|---|---|
committer | György Szing <gyorgy.szing@arm.com> | 2021-12-02 01:41:03 +0100 |
commit | cefec44aeea170e5605a9fe8386c084ffa5d77e1 (patch) | |
tree | 2f6cdaf93686955b86fe38db94bd78105cb65289 | |
parent | b22916ec01934d7ac4482f9600113c5040e03d1d (diff) | |
download | trusted-services-cefec44aeea170e5605a9fe8386c084ffa5d77e1.tar.gz |
Fix psa_key_handle_t typedef
When using the PSA Crypto API realized by the TS Crypto client,
PSA interface definitions are used from
components/service/crypto/include/psa. The version of crypto_types.h
under this directory was incorrectly defining the psa_key_handle_t
type as a uint16_t. This was leading to attestation service test
failures because the t_cose library casts a key id to a psa_key_handle_t,
resulting in a 32-bit value being truncated. This change fixes the
definition of the psa_key_handle_t type.
Signed-off-by: Julian Hall <julian.hall@arm.com>
Change-Id: Ia9d886b1cee1fa6877cc1f3be77a255b792b40b1
-rw-r--r-- | components/service/crypto/include/psa/crypto_types.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/components/service/crypto/include/psa/crypto_types.h b/components/service/crypto/include/psa/crypto_types.h index ed2091654..06447638c 100644 --- a/components/service/crypto/include/psa/crypto_types.h +++ b/components/service/crypto/include/psa/crypto_types.h @@ -49,10 +49,6 @@ typedef int32_t psa_status_t; * @{ */ -/* Integral type representing a key handle. */ -typedef uint16_t psa_key_handle_t; - - /** \brief Encoding of a key type. */ typedef uint16_t psa_key_type_t; @@ -223,6 +219,15 @@ typedef uint32_t psa_key_location_t; typedef uint32_t psa_key_id_t; #define PSA_KEY_ID_INIT 0 +/** Key handle for open keys + * + * This type is used as a handle returned by psa_open_key which is planned + * to be deprecated. Until it is, psa_key_handle_t must have the same + * number of bits as psa_key_id_t as there are operations where the types + * are used interchangeably + */ +typedef psa_key_id_t psa_key_handle_t; + /**@}*/ /** \defgroup policy Key policies |