Skip to content

Commit dc85bc5

Browse files
Change auxiliary functions for TLS to the new PSA EC curve encoding
This is a change to an internal API that is exposed only for the sake of Mbed TLS.
1 parent b1824e7 commit dc85bc5

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

include/mbedtls/psa_util.h

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -366,16 +366,15 @@ static inline int mbedtls_psa_err_translate_pk( psa_status_t status )
366366
* https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#tls-parameters-8
367367
* into a PSA ECC group identifier. */
368368
#if defined(MBEDTLS_ECP_C)
369-
static inline psa_ecc_curve_t mbedtls_psa_parse_tls_ecc_group(
370-
uint16_t tls_ecc_grp_reg_id )
369+
static inline psa_key_type_t mbedtls_psa_parse_tls_ecc_group(
370+
uint16_t tls_ecc_grp_reg_id, size_t *bits )
371371
{
372-
size_t bits;
373372
const mbedtls_ecp_curve_info *curve_info =
374373
mbedtls_ecp_curve_info_from_tls_id( tls_ecc_grp_reg_id );
375374
if( curve_info == NULL )
376375
return( 0 );
377-
else
378-
return( mbedtls_ecc_group_to_psa( curve_info->grp_id, &bits ) );
376+
return( PSA_KEY_TYPE_ECC_KEY_PAIR(
377+
mbedtls_ecc_group_to_psa( curve_info->grp_id, bits ) ) );
379378
}
380379
#endif /* MBEDTLS_ECP_C */
381380

@@ -404,15 +403,12 @@ static inline int mbedtls_psa_tls_psa_ec_to_ecpoint( unsigned char *src,
404403
* exchanges) and converts it into a format that the PSA key
405404
* agreement API understands.
406405
*/
407-
static inline int mbedtls_psa_tls_ecpoint_to_psa_ec( psa_ecc_curve_t curve,
408-
unsigned char const *src,
406+
static inline int mbedtls_psa_tls_ecpoint_to_psa_ec( unsigned char const *src,
409407
size_t srclen,
410408
unsigned char *dst,
411409
size_t dstlen,
412410
size_t *olen )
413411
{
414-
((void) curve);
415-
416412
if( srclen > dstlen )
417413
return( MBEDTLS_ERR_ECP_BUFFER_TOO_SMALL );
418414

0 commit comments

Comments
 (0)