mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #13337 from Patater/fix-tls-tfm
Fix Mbed TLS + TF-M integration issuespull/13314/head
commit
327968957d
|
|
@ -452,7 +452,8 @@ static inline psa_key_type_t mbedtls_psa_parse_tls_ecc_group(
|
||||||
uint16_t tls_ecc_grp_reg_id, size_t *bits )
|
uint16_t tls_ecc_grp_reg_id, size_t *bits )
|
||||||
{
|
{
|
||||||
#if TARGET_TFM
|
#if TARGET_TFM
|
||||||
return( (psa_ecc_curve_t) tls_ecc_grp_reg_id );
|
*bits = PSA_ECC_CURVE_BITS( tls_ecc_grp_reg_id );
|
||||||
|
return( PSA_KEY_TYPE_ECC_KEY_PAIR( tls_ecc_grp_reg_id ));
|
||||||
#else
|
#else
|
||||||
const mbedtls_ecp_curve_info *curve_info =
|
const mbedtls_ecp_curve_info *curve_info =
|
||||||
mbedtls_ecp_curve_info_from_tls_id( tls_ecc_grp_reg_id );
|
mbedtls_ecp_curve_info_from_tls_id( tls_ecc_grp_reg_id );
|
||||||
|
|
|
||||||
|
|
@ -620,9 +620,7 @@ int mbedtls_pk_wrap_as_opaque( mbedtls_pk_context *pk,
|
||||||
/* prepare the key attributes */
|
/* prepare the key attributes */
|
||||||
#if TARGET_TFM
|
#if TARGET_TFM
|
||||||
curve_id = mbedtls_ecp_curve_info_from_grp_id( ec->grp.id )->tls_id;
|
curve_id = mbedtls_ecp_curve_info_from_grp_id( ec->grp.id )->tls_id;
|
||||||
key_type = PSA_KEY_TYPE_ECC_KEY_PAIR(
|
key_type = mbedtls_psa_parse_tls_ecc_group ( curve_id, &bits );
|
||||||
mbedtls_psa_parse_tls_ecc_group ( curve_id,
|
|
||||||
&bits ) );
|
|
||||||
#else
|
#else
|
||||||
curve_id = mbedtls_ecc_group_to_psa( ec->grp.id, &bits );
|
curve_id = mbedtls_ecc_group_to_psa( ec->grp.id, &bits );
|
||||||
key_type = PSA_KEY_TYPE_ECC_KEY_PAIR( curve_id );
|
key_type = PSA_KEY_TYPE_ECC_KEY_PAIR( curve_id );
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue