mirror of
https://github.com/ARMmbed/mbedtls.git
synced 2025-05-11 01:11:42 +08:00
Add better name for variable.
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
This commit is contained in:
parent
320d21cecf
commit
26c6741c58
@ -148,7 +148,7 @@ psa_status_t mbedtls_psa_hkdf_extract( psa_algorithm_t alg,
|
|||||||
unsigned char null_salt[PSA_MAC_MAX_SIZE] = { '\0' };
|
unsigned char null_salt[PSA_MAC_MAX_SIZE] = { '\0' };
|
||||||
mbedtls_svc_key_id_t key = MBEDTLS_SVC_KEY_ID_INIT;
|
mbedtls_svc_key_id_t key = MBEDTLS_SVC_KEY_ID_INIT;
|
||||||
psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT;
|
psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT;
|
||||||
psa_status_t ret = PSA_ERROR_CORRUPTION_DETECTED;
|
psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED;
|
||||||
|
|
||||||
if( salt == NULL || salt_len == 0 )
|
if( salt == NULL || salt_len == 0 )
|
||||||
{
|
{
|
||||||
@ -174,18 +174,18 @@ psa_status_t mbedtls_psa_hkdf_extract( psa_algorithm_t alg,
|
|||||||
psa_set_key_algorithm( &attributes, alg );
|
psa_set_key_algorithm( &attributes, alg );
|
||||||
psa_set_key_type( &attributes, PSA_KEY_TYPE_HMAC );
|
psa_set_key_type( &attributes, PSA_KEY_TYPE_HMAC );
|
||||||
|
|
||||||
ret = psa_import_key( &attributes, salt, salt_len, &key );
|
status = psa_import_key( &attributes, salt, salt_len, &key );
|
||||||
if( PSA_SUCCESS != ret )
|
if( status != PSA_SUCCESS )
|
||||||
{
|
{
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = psa_mac_compute( key, alg, ikm, ikm_len, prk, prk_size, prk_len );
|
status = psa_mac_compute( key, alg, ikm, ikm_len, prk, prk_size, prk_len );
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
psa_destroy_key( key );
|
psa_destroy_key( key );
|
||||||
|
|
||||||
return( ret );
|
return( status );
|
||||||
}
|
}
|
||||||
|
|
||||||
MBEDTLS_STATIC_TESTABLE
|
MBEDTLS_STATIC_TESTABLE
|
||||||
|
Loading…
x
Reference in New Issue
Block a user