From 83d293951c6e76850d5272664f3a260d9e28a351 Mon Sep 17 00:00:00 2001 From: Jaeden Amero Date: Thu, 10 Jan 2019 20:17:42 +0000 Subject: [PATCH] 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. --- library/psa_crypto.c | 1 + 1 file changed, 1 insertion(+) diff --git a/library/psa_crypto.c b/library/psa_crypto.c index fd76b27b4..0a039710a 100644 --- a/library/psa_crypto.c +++ b/library/psa_crypto.c @@ -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 ) ); if( ecp == NULL ) return( PSA_ERROR_INSUFFICIENT_MEMORY ); + mbedtls_ecp_keypair_init( ecp ); /* Load the group. */ status = mbedtls_to_psa_error(