Skip to content

Commit 3279689

Browse files
authored
Merge pull request #13337 from Patater/fix-tls-tfm
Fix Mbed TLS + TF-M integration issues
2 parents 1bd138b + 61a65c0 commit 3279689

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

features/mbedtls/inc/mbedtls/psa_util.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,8 @@ static inline psa_key_type_t mbedtls_psa_parse_tls_ecc_group(
452452
uint16_t tls_ecc_grp_reg_id, size_t *bits )
453453
{
454454
#if TARGET_TFM
455-
return( (psa_ecc_curve_t) tls_ecc_grp_reg_id );
455+
*bits = PSA_ECC_CURVE_BITS( tls_ecc_grp_reg_id );
456+
return( PSA_KEY_TYPE_ECC_KEY_PAIR( tls_ecc_grp_reg_id ));
456457
#else
457458
const mbedtls_ecp_curve_info *curve_info =
458459
mbedtls_ecp_curve_info_from_tls_id( tls_ecc_grp_reg_id );

features/mbedtls/src/pk.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -620,9 +620,7 @@ int mbedtls_pk_wrap_as_opaque( mbedtls_pk_context *pk,
620620
/* prepare the key attributes */
621621
#if TARGET_TFM
622622
curve_id = mbedtls_ecp_curve_info_from_grp_id( ec->grp.id )->tls_id;
623-
key_type = PSA_KEY_TYPE_ECC_KEY_PAIR(
624-
mbedtls_psa_parse_tls_ecc_group ( curve_id,
625-
&bits ) );
623+
key_type = mbedtls_psa_parse_tls_ecc_group ( curve_id, &bits );
626624
#else
627625
curve_id = mbedtls_ecc_group_to_psa( ec->grp.id, &bits );
628626
key_type = PSA_KEY_TYPE_ECC_KEY_PAIR( curve_id );

0 commit comments

Comments
 (0)