Skip to content

Commit

Permalink
Add explicit integer to enumeration casts to programs/pkey/gen_key.c
Browse files Browse the repository at this point in the history
  • Loading branch information
Hanno Becker committed Nov 5, 2018
1 parent 06f88e9 commit e2dae7e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions programs/pkey/gen_key.c
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,8 @@ int main( int argc, char *argv[] )
mbedtls_printf( "\n . Generating the private key ..." );
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 );
goto exit;
Expand All @@ -344,7 +345,8 @@ int main( int argc, char *argv[] )
#if defined(MBEDTLS_ECP_C)
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 );
if( ret != 0 )
{
Expand Down

0 comments on commit e2dae7e

Please sign in to comment.