1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-29 11:41:15 +03:00

pk: wrap curve_id before passing it to PSA

Add a helper function in PSA utils
This commit is contained in:
Andrzej Kurek
2019-01-14 05:09:46 -05:00
parent a62a58ece5
commit 93a38a3101
2 changed files with 15 additions and 1 deletions

View File

@ -572,7 +572,8 @@ int mbedtls_pk_wrap_as_opaque( mbedtls_pk_context *pk,
return( ret );
curve_id = mbedtls_ecp_curve_info_from_grp_id( ec->grp.id )->tls_id;
key_type = PSA_KEY_TYPE_ECC_KEYPAIR(curve_id);
key_type = PSA_KEY_TYPE_ECC_KEYPAIR(
mbedtls_psa_parse_tls_ecc_group ( curve_id ) );
/* allocate a key slot */
if( PSA_SUCCESS != psa_allocate_key( key_type, d_len * 8, &key ) )