@@ -833,6 +833,30 @@ typedef psa_status_t (*psa_drv_se_allocate_key_t)(
833
833
const psa_key_attributes_t * attributes ,
834
834
psa_key_slot_number_t * key_slot );
835
835
836
+ /** \brief A function that determines whether a slot number is valid
837
+ * for a key.
838
+ *
839
+ * \param[in,out] drv_context The driver context structure.
840
+ * \param[in] attributes Attributes of the key.
841
+ * \param[in] key_slot Slot where the key is to be stored.
842
+ *
843
+ * \retval #PSA_SUCCESS
844
+ * The given slot number is valid for a key with the given
845
+ * attributes.
846
+ * \retval #PSA_ERROR_INVALID_ARGUMENT
847
+ * The given slot number is not valid for a key with the
848
+ * given attributes. This includes the case where the slot
849
+ * number is not valid at all.
850
+ * \retval #PSA_ERROR_ALREADY_EXISTS
851
+ * There is already a key with the specified slot number.
852
+ * Drivers may choose to return this error from the key
853
+ * creation function instead.
854
+ */
855
+ typedef psa_status_t (* psa_drv_se_validate_slot_number_t )(
856
+ psa_drv_se_context_t * drv_context ,
857
+ const psa_key_attributes_t * attributes ,
858
+ psa_key_slot_number_t key_slot );
859
+
836
860
/** \brief A function that imports a key into a secure element in binary format
837
861
*
838
862
* This function can support any output from psa_export_key(). Refer to the
@@ -993,6 +1017,16 @@ typedef struct {
993
1017
* last call to this function had not taken place.
994
1018
*/
995
1019
psa_drv_se_allocate_key_t p_allocate ;
1020
+ /** Function that checks the validity of a slot for a key.
1021
+ *
1022
+ * The core calls this function instead of
1023
+ * psa_drv_se_key_management_t::p_allocate to create
1024
+ * a key in a specific slot. It then calls the actual creation function
1025
+ * (such as psa_drv_se_key_management_t::p_import or
1026
+ * psa_drv_se_key_management_t::p_generate) or
1027
+ * psa_drv_se_key_management_t::p_destroy.
1028
+ */
1029
+ psa_drv_se_validate_slot_number_t p_validate_slot_number ;
996
1030
/** Function that performs a key import operation */
997
1031
psa_drv_se_import_key_t p_import ;
998
1032
/** Function that performs a generation */
0 commit comments