From b938b0bb03ef5c87339cc57eab5bce8be1999157 Mon Sep 17 00:00:00 2001 From: Steven Cooreman Date: Tue, 6 Apr 2021 13:08:42 +0200 Subject: [PATCH] Documentation clarification after review Signed-off-by: Steven Cooreman --- include/psa/crypto_extra.h | 4 ++-- library/psa_crypto_driver_wrappers.c | 4 ++-- library/psa_crypto_slot_management.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/psa/crypto_extra.h b/include/psa/crypto_extra.h index 38d6c2029..2c0e33ba7 100644 --- a/include/psa/crypto_extra.h +++ b/include/psa/crypto_extra.h @@ -759,7 +759,7 @@ static inline int psa_key_id_is_builtin( psa_key_id_t key_id ) ( key_id <= MBEDTLS_PSA_KEY_ID_BUILTIN_MAX ) ); } -/** Platform function to obtain the location and slot of a built-in key. +/** Platform function to obtain the location and slot number of a built-in key. * * An application-specific implementation of this function must be provided if * #MBEDTLS_PSA_CRYPTO_BUILTIN_KEYS is enabled. This would typically be provided @@ -781,7 +781,7 @@ static inline int psa_key_id_is_builtin( psa_key_id_t key_id ) * and with what lifecycle the key can be used. * \param[out] slot_number On success, the slot number known to the driver * registered at the lifetime location reported - * through \p location which corresponds to the + * through \p lifetime which corresponds to the * requested built-in key. * * \retval #PSA_SUCCESS diff --git a/library/psa_crypto_driver_wrappers.c b/library/psa_crypto_driver_wrappers.c index 2a3075b95..11160d82d 100644 --- a/library/psa_crypto_driver_wrappers.c +++ b/library/psa_crypto_driver_wrappers.c @@ -229,8 +229,8 @@ psa_status_t psa_driver_wrapper_verify_hash( } } -/** Get the key buffer size for the key material of a generated key in the - * case of an opaque driver without storage. +/** Get the key buffer size required to store the key material of a key + * associated with an opaque driver without storage. * * \param[in] attributes The key attributes. * \param[out] key_buffer_size Minimum buffer size to contain the key material diff --git a/library/psa_crypto_slot_management.c b/library/psa_crypto_slot_management.c index 232e54401..336bc3716 100644 --- a/library/psa_crypto_slot_management.c +++ b/library/psa_crypto_slot_management.c @@ -287,7 +287,6 @@ static psa_status_t psa_load_builtin_key_into_slot( psa_key_slot_t *slot ) size_t key_buffer_size = 0; size_t key_buffer_length = 0; - /* Load keys in the 'builtin' range through their own interface */ if( ! psa_key_id_is_builtin( MBEDTLS_SVC_KEY_ID_GET_KEY_ID( slot->attr.id ) ) ) { @@ -363,6 +362,7 @@ psa_status_t psa_get_and_lock_key_slot( mbedtls_svc_key_id_t key, status = PSA_ERROR_DOES_NOT_EXIST; #if defined(MBEDTLS_PSA_CRYPTO_BUILTIN_KEYS) + /* Load keys in the 'builtin' range through their own interface */ status = psa_load_builtin_key_into_slot( *p_slot ); #endif /* MBEDTLS_PSA_CRYPTO_BUILTIN_KEYS */