1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-30 22:43:08 +03:00

pk_wrap: pass curve size instead of a larger size of the exported key

Whitespace fixes
This commit is contained in:
Andrzej Kurek
2019-01-14 05:14:18 -05:00
parent 93a38a3101
commit 62594a8b12
3 changed files with 21 additions and 2 deletions

View File

@ -577,7 +577,9 @@ static int ecdsa_verify_wrap( void *ctx, mbedtls_md_type_t md_alg,
psa_sig_md = PSA_ALG_ECDSA( psa_md );
psa_type = PSA_KEY_TYPE_ECC_PUBLIC_KEY( curve );
if( ( ret = psa_allocate_key( psa_type, key_len * 8, &key_slot ) ) != PSA_SUCCESS )
if( ( ret = psa_allocate_key( psa_type,
MBEDTLS_PSA_ECC_KEY_BITS_OF_CURVE(curve),
&key_slot ) ) != PSA_SUCCESS )
return( mbedtls_psa_err_translate_pk( ret ) );
psa_key_policy_init( &policy );