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.
This commit is contained in:
Jaeden Amero 2019-01-10 20:17:42 +00:00
parent d6292ca57b
commit 83d293951c

View file

@ -572,6 +572,7 @@ static psa_status_t psa_import_ec_private_key( psa_ecc_curve_t curve,
ecp = mbedtls_calloc( 1, sizeof( mbedtls_ecp_keypair ) ); ecp = mbedtls_calloc( 1, sizeof( mbedtls_ecp_keypair ) );
if( ecp == NULL ) if( ecp == NULL )
return( PSA_ERROR_INSUFFICIENT_MEMORY ); return( PSA_ERROR_INSUFFICIENT_MEMORY );
mbedtls_ecp_keypair_init( ecp );
/* Load the group. */ /* Load the group. */
status = mbedtls_to_psa_error( status = mbedtls_to_psa_error(