mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-02-26 03:40:26 +00:00
Correct some comments
This commit is contained in:
parent
8908c5e81c
commit
1b9505c451
@ -746,10 +746,11 @@ psa_status_t psa_import_key_into_slot( psa_key_slot_t *slot,
|
|||||||
if( key_type_is_raw_bytes( slot->attr.type ) )
|
if( key_type_is_raw_bytes( slot->attr.type ) )
|
||||||
{
|
{
|
||||||
size_t bit_size = PSA_BYTES_TO_BITS( data_length );
|
size_t bit_size = PSA_BYTES_TO_BITS( data_length );
|
||||||
/* Ensure that the bytes-to-bit conversion doesn't overflow. */
|
/* Ensure that the bytes-to-bit conversion didn't overflow. */
|
||||||
if( data_length > SIZE_MAX / 8 )
|
if( data_length > SIZE_MAX / 8 )
|
||||||
return( PSA_ERROR_NOT_SUPPORTED );
|
return( PSA_ERROR_NOT_SUPPORTED );
|
||||||
/* Ensure that the bit size fits in its representation type. */
|
/* Enforce a size limit, and in particular ensure that the bit
|
||||||
|
* size fits in its representation type. */
|
||||||
if( bit_size > PSA_MAX_KEY_BITS )
|
if( bit_size > PSA_MAX_KEY_BITS )
|
||||||
return( PSA_ERROR_NOT_SUPPORTED );
|
return( PSA_ERROR_NOT_SUPPORTED );
|
||||||
status = prepare_raw_data_slot( slot->attr.type, bit_size,
|
status = prepare_raw_data_slot( slot->attr.type, bit_size,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user