mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-02-24 04:56:53 +00:00
Update the SE interface to pass a location when registering a driver
Now that lifetimes have structures and secure element drivers handle all the lifetimes with a certain location, update driver registration to take a location as argument rather than a lifetime. This commit updates the PSA specification draft. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
parent
4cfa443d2a
commit
52ac958d6b
|
@ -119,8 +119,10 @@ typedef struct {
|
||||||
* \param[in,out] drv_context The driver context structure.
|
* \param[in,out] drv_context The driver context structure.
|
||||||
* \param[in,out] persistent_data A pointer to the persistent data
|
* \param[in,out] persistent_data A pointer to the persistent data
|
||||||
* that allows writing.
|
* that allows writing.
|
||||||
* \param lifetime The lifetime value for which this driver
|
* \param location The location value for which this driver
|
||||||
* is registered.
|
* is registered. The driver will be invoked
|
||||||
|
* for all keys whose lifetime is in this
|
||||||
|
* location.
|
||||||
*
|
*
|
||||||
* \retval #PSA_SUCCESS
|
* \retval #PSA_SUCCESS
|
||||||
* The driver is operational.
|
* The driver is operational.
|
||||||
|
@ -132,7 +134,7 @@ typedef struct {
|
||||||
*/
|
*/
|
||||||
typedef psa_status_t (*psa_drv_se_init_t)(psa_drv_se_context_t *drv_context,
|
typedef psa_status_t (*psa_drv_se_init_t)(psa_drv_se_context_t *drv_context,
|
||||||
void *persistent_data,
|
void *persistent_data,
|
||||||
psa_key_lifetime_t lifetime);
|
psa_key_location_t location);
|
||||||
|
|
||||||
#if defined(__DOXYGEN_ONLY__) || !defined(MBEDTLS_PSA_CRYPTO_SE_C)
|
#if defined(__DOXYGEN_ONLY__) || !defined(MBEDTLS_PSA_CRYPTO_SE_C)
|
||||||
/* Mbed Crypto with secure element support enabled defines this type in
|
/* Mbed Crypto with secure element support enabled defines this type in
|
||||||
|
@ -1341,17 +1343,19 @@ typedef struct {
|
||||||
* after psa_crypto_init().
|
* after psa_crypto_init().
|
||||||
*
|
*
|
||||||
* \note Implementations store metadata about keys including the lifetime
|
* \note Implementations store metadata about keys including the lifetime
|
||||||
* value. Therefore, from one instantiation of the PSA Cryptography
|
* value, which contains the driver's location indicator. Therefore,
|
||||||
|
* from one instantiation of the PSA Cryptography
|
||||||
* library to the next one, if there is a key in storage with a certain
|
* library to the next one, if there is a key in storage with a certain
|
||||||
* lifetime value, you must always register the same driver (or an
|
* lifetime value, you must always register the same driver (or an
|
||||||
* updated version that communicates with the same secure element)
|
* updated version that communicates with the same secure element)
|
||||||
* with the same lifetime value.
|
* with the same location value.
|
||||||
*
|
*
|
||||||
* \param lifetime The lifetime value through which this driver will
|
* \param location The location value through which this driver will
|
||||||
* be exposed to applications.
|
* be exposed to applications.
|
||||||
* The values #PSA_KEY_LIFETIME_VOLATILE and
|
* This driver will be used for all keys such that
|
||||||
* #PSA_KEY_LIFETIME_PERSISTENT are reserved and
|
* `location == PSA_KEY_LIFETIME_LOCATION( lifetime )`.
|
||||||
* may not be used for drivers. Implementations
|
* The value #PSA_KEY_LOCATION_LOCAL_STORAGE is reserved
|
||||||
|
* and may not be used for drivers. Implementations
|
||||||
* may reserve other values.
|
* may reserve other values.
|
||||||
* \param[in] methods The method table of the driver. This structure must
|
* \param[in] methods The method table of the driver. This structure must
|
||||||
* remain valid for as long as the cryptography
|
* remain valid for as long as the cryptography
|
||||||
|
|
Loading…
Reference in a new issue