mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-01-27 06:35:22 +00:00
Use different variables for buffer size and data length
Signed-off-by: Steven Cooreman <steven.cooreman@silabs.com>
This commit is contained in:
parent
203bcbbc47
commit
85d554a99b
@ -299,20 +299,21 @@ static psa_status_t psa_load_builtin_key_into_slot( psa_key_slot_t *slot )
|
|||||||
/* If the key should exist according to the platform, load it through the
|
/* If the key should exist according to the platform, load it through the
|
||||||
* driver interface. */
|
* driver interface. */
|
||||||
uint8_t *key_buffer = NULL;
|
uint8_t *key_buffer = NULL;
|
||||||
|
size_t key_buffer_size = 0;
|
||||||
size_t key_buffer_length = 0;
|
size_t key_buffer_length = 0;
|
||||||
|
|
||||||
status = psa_driver_wrapper_get_key_buffer_size( &attributes,
|
status = psa_driver_wrapper_get_key_buffer_size( &attributes,
|
||||||
&key_buffer_length );
|
&key_buffer_size );
|
||||||
if( status != PSA_SUCCESS )
|
if( status != PSA_SUCCESS )
|
||||||
return( status );
|
return( status );
|
||||||
|
|
||||||
key_buffer = mbedtls_calloc( 1, key_buffer_length );
|
key_buffer = mbedtls_calloc( 1, key_buffer_size );
|
||||||
if( key_buffer == NULL )
|
if( key_buffer == NULL )
|
||||||
return( PSA_ERROR_INSUFFICIENT_MEMORY );
|
return( PSA_ERROR_INSUFFICIENT_MEMORY );
|
||||||
|
|
||||||
status = psa_driver_wrapper_get_builtin_key(
|
status = psa_driver_wrapper_get_builtin_key(
|
||||||
slot_number, &attributes,
|
slot_number, &attributes,
|
||||||
key_buffer, key_buffer_length, &key_buffer_length );
|
key_buffer, key_buffer_size, &key_buffer_length );
|
||||||
if( status != PSA_SUCCESS )
|
if( status != PSA_SUCCESS )
|
||||||
goto exit;
|
goto exit;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user