ECDH: Fix Everest x25519 make_public

This commit is contained in:
Christoph M. Wintersteiger 2019-02-15 17:21:04 +00:00 committed by Janos Follath
parent 75fa3c824f
commit 46e76db8a5

View File

@ -1028,16 +1028,9 @@ int main( int argc, char *argv[] )
#if defined(MBEDTLS_ECDH_LEGACY_CONTEXT)
CHECK_AND_CONTINUE( mbedtls_ecp_group_load(&ecdh_srv.grp, curve_info->grp_id));
CHECK_AND_CONTINUE( mbedtls_ecdh_gen_public(&ecdh_srv.grp,
&ecdh_srv.d,
&ecdh_srv.Q, myrand, NULL));
#else
if( ecdh_srv.var == MBEDTLS_ECDH_VARIANT_MBEDTLS_2_0 ) {
if( ecdh_srv.var == MBEDTLS_ECDH_VARIANT_MBEDTLS_2_0 )
CHECK_AND_CONTINUE( mbedtls_ecp_group_load( &ecdh_srv.ctx.mbed_ecdh.grp, curve_info->grp_id ));
CHECK_AND_CONTINUE( mbedtls_ecdh_gen_public( &ecdh_srv.ctx.mbed_ecdh.grp,
&ecdh_srv.ctx.mbed_ecdh.d,
&ecdh_srv.ctx.mbed_ecdh.Q, myrand, NULL ));
}
#endif
mbedtls_snprintf( title, sizeof( title ), "ECDHE-%s", curve_info->name );