mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-14 18:48:13 -07:00
mbedtls: make style
This commit is contained in:
parent
6324e2e746
commit
b1d6eaf2f7
177 changed files with 37224 additions and 41821 deletions
|
@ -51,10 +51,9 @@
|
|||
* \retval 0
|
||||
* The key identifier is not a volatile key identifier.
|
||||
*/
|
||||
static inline int psa_key_id_is_volatile( psa_key_id_t key_id )
|
||||
{
|
||||
return( ( key_id >= PSA_KEY_ID_VOLATILE_MIN ) &&
|
||||
( key_id <= PSA_KEY_ID_VOLATILE_MAX ) );
|
||||
static inline int psa_key_id_is_volatile(psa_key_id_t key_id) {
|
||||
return ((key_id >= PSA_KEY_ID_VOLATILE_MIN) &&
|
||||
(key_id <= PSA_KEY_ID_VOLATILE_MAX));
|
||||
}
|
||||
|
||||
/** Get the description of a key given its identifier and lock it.
|
||||
|
@ -92,20 +91,20 @@ static inline int psa_key_id_is_volatile( psa_key_id_t key_id )
|
|||
* \retval #PSA_ERROR_STORAGE_FAILURE
|
||||
* \retval #PSA_ERROR_DATA_CORRUPT
|
||||
*/
|
||||
psa_status_t psa_get_and_lock_key_slot( mbedtls_svc_key_id_t key,
|
||||
psa_key_slot_t **p_slot );
|
||||
psa_status_t psa_get_and_lock_key_slot(mbedtls_svc_key_id_t key,
|
||||
psa_key_slot_t **p_slot);
|
||||
|
||||
/** Initialize the key slot structures.
|
||||
*
|
||||
* \retval #PSA_SUCCESS
|
||||
* Currently this function always succeeds.
|
||||
*/
|
||||
psa_status_t psa_initialize_key_slots( void );
|
||||
psa_status_t psa_initialize_key_slots(void);
|
||||
|
||||
/** Delete all data from key slots in memory.
|
||||
*
|
||||
* This does not affect persistent storage. */
|
||||
void psa_wipe_all_key_slots( void );
|
||||
void psa_wipe_all_key_slots(void);
|
||||
|
||||
/** Find a free key slot.
|
||||
*
|
||||
|
@ -122,8 +121,8 @@ void psa_wipe_all_key_slots( void );
|
|||
* \retval #PSA_ERROR_INSUFFICIENT_MEMORY
|
||||
* \retval #PSA_ERROR_BAD_STATE
|
||||
*/
|
||||
psa_status_t psa_get_empty_key_slot( psa_key_id_t *volatile_key_id,
|
||||
psa_key_slot_t **p_slot );
|
||||
psa_status_t psa_get_empty_key_slot(psa_key_id_t *volatile_key_id,
|
||||
psa_key_slot_t **p_slot);
|
||||
|
||||
/** Lock a key slot.
|
||||
*
|
||||
|
@ -137,14 +136,13 @@ psa_status_t psa_get_empty_key_slot( psa_key_id_t *volatile_key_id,
|
|||
* The lock counter already reached its maximum value and was not
|
||||
* increased.
|
||||
*/
|
||||
static inline psa_status_t psa_lock_key_slot( psa_key_slot_t *slot )
|
||||
{
|
||||
if( slot->lock_count >= SIZE_MAX )
|
||||
return( PSA_ERROR_CORRUPTION_DETECTED );
|
||||
static inline psa_status_t psa_lock_key_slot(psa_key_slot_t *slot) {
|
||||
if (slot->lock_count >= SIZE_MAX)
|
||||
return (PSA_ERROR_CORRUPTION_DETECTED);
|
||||
|
||||
slot->lock_count++;
|
||||
|
||||
return( PSA_SUCCESS );
|
||||
return (PSA_SUCCESS);
|
||||
}
|
||||
|
||||
/** Unlock a key slot.
|
||||
|
@ -163,7 +161,7 @@ static inline psa_status_t psa_lock_key_slot( psa_key_slot_t *slot )
|
|||
* The lock counter was equal to 0.
|
||||
*
|
||||
*/
|
||||
psa_status_t psa_unlock_key_slot( psa_key_slot_t *slot );
|
||||
psa_status_t psa_unlock_key_slot(psa_key_slot_t *slot);
|
||||
|
||||
/** Test whether a lifetime designates a key in an external cryptoprocessor.
|
||||
*
|
||||
|
@ -177,10 +175,9 @@ psa_status_t psa_unlock_key_slot( psa_key_slot_t *slot );
|
|||
* The lifetime designates a key that is volatile or in internal
|
||||
* storage.
|
||||
*/
|
||||
static inline int psa_key_lifetime_is_external( psa_key_lifetime_t lifetime )
|
||||
{
|
||||
return( PSA_KEY_LIFETIME_GET_LOCATION( lifetime )
|
||||
!= PSA_KEY_LOCATION_LOCAL_STORAGE );
|
||||
static inline int psa_key_lifetime_is_external(psa_key_lifetime_t lifetime) {
|
||||
return (PSA_KEY_LIFETIME_GET_LOCATION(lifetime)
|
||||
!= PSA_KEY_LOCATION_LOCAL_STORAGE);
|
||||
}
|
||||
|
||||
/** Validate a key's location.
|
||||
|
@ -197,8 +194,8 @@ static inline int psa_key_lifetime_is_external( psa_key_lifetime_t lifetime )
|
|||
* \retval #PSA_SUCCESS
|
||||
* \retval #PSA_ERROR_INVALID_ARGUMENT
|
||||
*/
|
||||
psa_status_t psa_validate_key_location( psa_key_lifetime_t lifetime,
|
||||
psa_se_drv_table_entry_t **p_drv );
|
||||
psa_status_t psa_validate_key_location(psa_key_lifetime_t lifetime,
|
||||
psa_se_drv_table_entry_t **p_drv);
|
||||
|
||||
/** Validate the persistence of a key.
|
||||
*
|
||||
|
@ -208,7 +205,7 @@ psa_status_t psa_validate_key_location( psa_key_lifetime_t lifetime,
|
|||
* \retval #PSA_ERROR_INVALID_ARGUMENT The key is persistent but persistent
|
||||
* keys are not supported.
|
||||
*/
|
||||
psa_status_t psa_validate_key_persistence( psa_key_lifetime_t lifetime );
|
||||
psa_status_t psa_validate_key_persistence(psa_key_lifetime_t lifetime);
|
||||
|
||||
/** Validate a key identifier.
|
||||
*
|
||||
|
@ -220,6 +217,6 @@ psa_status_t psa_validate_key_persistence( psa_key_lifetime_t lifetime );
|
|||
* \retval #PSA_SUCCESS The identifier is valid.
|
||||
* \retval #PSA_ERROR_INVALID_ARGUMENT The key identifier is not valid.
|
||||
*/
|
||||
psa_status_t psa_validate_key_id( mbedtls_svc_key_id_t key, int vendor_ok );
|
||||
psa_status_t psa_validate_key_id(mbedtls_svc_key_id_t key, int vendor_ok);
|
||||
|
||||
#endif /* PSA_CRYPTO_SLOT_MANAGEMENT_H */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue