Merge pull request #142 from ARMmbed/psa-metadata_validation
Algorithm and key type encoding validation
This commit is contained in:
commit
159ebf3b8e
7 changed files with 796 additions and 30 deletions
|
@ -1555,7 +1555,7 @@ static psa_status_t psa_mac_setup( psa_mac_operation_t *operation,
|
|||
#if defined(MBEDTLS_MD_C)
|
||||
if( PSA_ALG_IS_HMAC( alg ) )
|
||||
{
|
||||
psa_algorithm_t hash_alg = PSA_ALG_HMAC_HASH( alg );
|
||||
psa_algorithm_t hash_alg = PSA_ALG_HMAC_GET_HASH( alg );
|
||||
if( hash_alg == 0 )
|
||||
{
|
||||
status = PSA_ERROR_NOT_SUPPORTED;
|
||||
|
@ -3265,7 +3265,7 @@ static psa_status_t psa_generator_hkdf_setup( psa_hkdf_generator_t *hkdf,
|
|||
psa_status_t status;
|
||||
status = psa_hmac_setup_internal( &hkdf->hmac,
|
||||
salt, salt_length,
|
||||
PSA_ALG_HMAC_HASH( hash_alg ) );
|
||||
PSA_ALG_HMAC_GET_HASH( hash_alg ) );
|
||||
if( status != PSA_SUCCESS )
|
||||
return( status );
|
||||
status = psa_hash_update( &hkdf->hmac.hash_ctx,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue