mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-29 11:41:15 +03:00
psa: Move psa_key_file_id_t definition to crypto_types.h
`psa_key_file_id_t` was defined in `crypto_platform.h` and not `crypto_types.h` even if it wasn't platform dependent because back when the PSA Crypto Specification was put together `crypto_types.h` was meant to contain only types that were intended to make it to the specification. There is not such constraint anymore thus move the definition of `psa_key_file_id_t` to crypto_types.h. Signed-off-by: Ronald Cron <ronald.cron@arm.com>
This commit is contained in:
@ -74,27 +74,6 @@ typedef uint32_t psa_app_key_id_t;
|
||||
typedef int32_t psa_key_owner_id_t;
|
||||
#endif
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t key_id;
|
||||
psa_key_owner_id_t owner;
|
||||
} psa_key_file_id_t;
|
||||
#define PSA_KEY_FILE_GET_KEY_ID( file_id ) ( ( file_id ).key_id )
|
||||
|
||||
/* Since crypto.h is used as part of the PSA Cryptography API specification,
|
||||
* it must use standard types for things like the argument of psa_open_key().
|
||||
* If it wasn't for that constraint, psa_open_key() would take a
|
||||
* `psa_key_file_id_t` argument. As a workaround, make `psa_key_id_t` an
|
||||
* alias for `psa_key_file_id_t` when building for a multi-client service. */
|
||||
typedef psa_key_file_id_t psa_key_id_t;
|
||||
#define PSA_KEY_ID_INIT {0, 0}
|
||||
|
||||
#else /* !MBEDTLS_PSA_CRYPTO_KEY_FILE_ID_ENCODES_OWNER */
|
||||
|
||||
/* By default, a key file identifier is just the application key identifier. */
|
||||
typedef psa_app_key_id_t psa_key_file_id_t;
|
||||
#define PSA_KEY_FILE_GET_KEY_ID( id ) ( id )
|
||||
|
||||
#endif /* !MBEDTLS_PSA_CRYPTO_KEY_FILE_ID_ENCODES_OWNER */
|
||||
#endif /* MBEDTLS_PSA_CRYPTO_KEY_FILE_ID_ENCODES_OWNER */
|
||||
|
||||
#endif /* PSA_CRYPTO_PLATFORM_H */
|
||||
|
Reference in New Issue
Block a user