Skip to content

Commit 9055a7d

Browse files
committed
Merge remote-tracking branch 'upstream-public/pr/2175' into development
2 parents 3c0941e + fe936c3 commit 9055a7d

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

ChangeLog

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ Bugfix
4646
* Fix an unsafe bounds check when restoring an SSL session from a ticket.
4747
This could lead to a buffer overflow, but only in case ticket authentication
4848
was broken. Reported and fix suggested by Guido Vranken in #659.
49+
* Add explicit integer to enumeration type casts to example program
50+
programs/pkey/gen_key which previously led to compilation failure
51+
on some toolchains. Reported by phoenixmcallister. Fixes #2170.
4952

5053
= mbed TLS 2.14.0 branch released 2018-11-19
5154

programs/pkey/gen_key.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,8 @@ int main( int argc, char *argv[] )
322322
mbedtls_printf( "\n . Generating the private key ..." );
323323
fflush( stdout );
324324

325-
if( ( ret = mbedtls_pk_setup( &key, mbedtls_pk_info_from_type( opt.type ) ) ) != 0 )
325+
if( ( ret = mbedtls_pk_setup( &key,
326+
mbedtls_pk_info_from_type( (mbedtls_pk_type_t) opt.type ) ) ) != 0 )
326327
{
327328
mbedtls_printf( " failed\n ! mbedtls_pk_setup returned -0x%04x", -ret );
328329
goto exit;
@@ -344,7 +345,8 @@ int main( int argc, char *argv[] )
344345
#if defined(MBEDTLS_ECP_C)
345346
if( opt.type == MBEDTLS_PK_ECKEY )
346347
{
347-
ret = mbedtls_ecp_gen_key( opt.ec_curve, mbedtls_pk_ec( key ),
348+
ret = mbedtls_ecp_gen_key( (mbedtls_ecp_group_id) opt.ec_curve,
349+
mbedtls_pk_ec( key ),
348350
mbedtls_ctr_drbg_random, &ctr_drbg );
349351
if( ret != 0 )
350352
{

0 commit comments

Comments
 (0)