Merge remote-tracking branch 'upstream-public/pr/2175' into development

This commit is contained in:
Jaeden Amero 2018-12-06 16:09:58 +00:00
commit 9055a7d855
2 changed files with 7 additions and 2 deletions

View File

@ -46,6 +46,9 @@ Bugfix
* Fix an unsafe bounds check when restoring an SSL session from a ticket. * Fix an unsafe bounds check when restoring an SSL session from a ticket.
This could lead to a buffer overflow, but only in case ticket authentication This could lead to a buffer overflow, but only in case ticket authentication
was broken. Reported and fix suggested by Guido Vranken in #659. was broken. Reported and fix suggested by Guido Vranken in #659.
* Add explicit integer to enumeration type casts to example program
programs/pkey/gen_key which previously led to compilation failure
on some toolchains. Reported by phoenixmcallister. Fixes #2170.
= mbed TLS 2.14.0 branch released 2018-11-19 = mbed TLS 2.14.0 branch released 2018-11-19

View File

@ -322,7 +322,8 @@ int main( int argc, char *argv[] )
mbedtls_printf( "\n . Generating the private key ..." ); mbedtls_printf( "\n . Generating the private key ..." );
fflush( stdout ); fflush( stdout );
if( ( ret = mbedtls_pk_setup( &key, mbedtls_pk_info_from_type( opt.type ) ) ) != 0 ) if( ( ret = mbedtls_pk_setup( &key,
mbedtls_pk_info_from_type( (mbedtls_pk_type_t) opt.type ) ) ) != 0 )
{ {
mbedtls_printf( " failed\n ! mbedtls_pk_setup returned -0x%04x", -ret ); mbedtls_printf( " failed\n ! mbedtls_pk_setup returned -0x%04x", -ret );
goto exit; goto exit;
@ -344,7 +345,8 @@ int main( int argc, char *argv[] )
#if defined(MBEDTLS_ECP_C) #if defined(MBEDTLS_ECP_C)
if( opt.type == MBEDTLS_PK_ECKEY ) if( opt.type == MBEDTLS_PK_ECKEY )
{ {
ret = mbedtls_ecp_gen_key( opt.ec_curve, mbedtls_pk_ec( key ), ret = mbedtls_ecp_gen_key( (mbedtls_ecp_group_id) opt.ec_curve,
mbedtls_pk_ec( key ),
mbedtls_ctr_drbg_random, &ctr_drbg ); mbedtls_ctr_drbg_random, &ctr_drbg );
if( ret != 0 ) if( ret != 0 )
{ {