mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-03-24 22:25:11 +00:00
Actually use the point format selected for ECDH
This commit is contained in:
parent
7b19c16b74
commit
5734b2d358
|
@ -429,9 +429,6 @@ struct _ssl_handshake_params
|
||||||
ecdh_context ecdh_ctx; /*!< ECDH key exchange */
|
ecdh_context ecdh_ctx; /*!< ECDH key exchange */
|
||||||
#endif
|
#endif
|
||||||
int ec_curve; /*!< Selected elliptic curve */
|
int ec_curve; /*!< Selected elliptic curve */
|
||||||
#if defined(POLARSSL_ECP_C)
|
|
||||||
int ec_point_format; /*!< Client supported format */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Checksum contexts
|
* Checksum contexts
|
||||||
|
|
|
@ -155,8 +155,6 @@ int ecdh_read_params( ecdh_context *ctx,
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ecdh_init( ctx );
|
|
||||||
|
|
||||||
if( ( ret = ecp_tls_read_group( &ctx->grp, buf, end - *buf ) ) != 0 )
|
if( ( ret = ecp_tls_read_group( &ctx->grp, buf, end - *buf ) ) != 0 )
|
||||||
return( ret );
|
return( ret );
|
||||||
|
|
||||||
|
|
|
@ -707,7 +707,7 @@ static int ssl_parse_supported_point_formats_ext( ssl_context *ssl,
|
||||||
if( p[0] == POLARSSL_ECP_PF_UNCOMPRESSED ||
|
if( p[0] == POLARSSL_ECP_PF_UNCOMPRESSED ||
|
||||||
p[0] == POLARSSL_ECP_PF_COMPRESSED )
|
p[0] == POLARSSL_ECP_PF_COMPRESSED )
|
||||||
{
|
{
|
||||||
ssl->handshake->ec_point_format = p[0];
|
ssl->handshake->ecdh_ctx.point_format = p[0];
|
||||||
SSL_DEBUG_MSG( 4, ( "point format selected: %d", p[0] ) );
|
SSL_DEBUG_MSG( 4, ( "point format selected: %d", p[0] ) );
|
||||||
return( 0 );
|
return( 0 );
|
||||||
}
|
}
|
||||||
|
|
|
@ -552,7 +552,7 @@ static int ssl_parse_supported_point_formats( ssl_context *ssl,
|
||||||
if( p[0] == POLARSSL_ECP_PF_UNCOMPRESSED ||
|
if( p[0] == POLARSSL_ECP_PF_UNCOMPRESSED ||
|
||||||
p[0] == POLARSSL_ECP_PF_COMPRESSED )
|
p[0] == POLARSSL_ECP_PF_COMPRESSED )
|
||||||
{
|
{
|
||||||
ssl->handshake->ec_point_format = p[0];
|
ssl->handshake->ecdh_ctx.point_format = p[0];
|
||||||
SSL_DEBUG_MSG( 4, ( "point format selected: %d", p[0] ) );
|
SSL_DEBUG_MSG( 4, ( "point format selected: %d", p[0] ) );
|
||||||
return( 0 );
|
return( 0 );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue