Skip to content

Commit 83d2939

Browse files
committed
psa: Call init when importing private EC keys
Previously we weren't initializing the freshly allocated ECP keypair when importing private EC keys. This didn't seem to cause problems, at least according to our current test coverage, but it's better to ensure we don't have a partially initialized object by explicitly initializing the keypair.
1 parent d6292ca commit 83d2939

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

library/psa_crypto.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -572,6 +572,7 @@ static psa_status_t psa_import_ec_private_key( psa_ecc_curve_t curve,
572572
ecp = mbedtls_calloc( 1, sizeof( mbedtls_ecp_keypair ) );
573573
if( ecp == NULL )
574574
return( PSA_ERROR_INSUFFICIENT_MEMORY );
575+
mbedtls_ecp_keypair_init( ecp );
575576

576577
/* Load the group. */
577578
status = mbedtls_to_psa_error(

0 commit comments

Comments
 (0)