mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-04-29 16:36:33 +00:00
Rename ecdh_curve_list to curve_list
This commit is contained in:
parent
5de2580563
commit
de05390c85
|
@ -814,9 +814,9 @@
|
||||||
#define POLARSSL_SSL_TRUNCATED_HMAC
|
#define POLARSSL_SSL_TRUNCATED_HMAC
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \def POLARSSL_SSL_SET_ECDH_CURVES
|
* \def POLARSSL_SSL_SET_CURVES
|
||||||
*
|
*
|
||||||
* Enable ssl_set_ecdh_curves().
|
* Enable ssl_set_curves().
|
||||||
*
|
*
|
||||||
* This is disabled by default since it breaks binary compatibility with the
|
* This is disabled by default since it breaks binary compatibility with the
|
||||||
* 1.3.x line. If you choose to enable it, you will need to rebuild your
|
* 1.3.x line. If you choose to enable it, you will need to rebuild your
|
||||||
|
@ -825,9 +825,9 @@
|
||||||
*
|
*
|
||||||
* TODO: actually disable it when done working on this branch ,)
|
* TODO: actually disable it when done working on this branch ,)
|
||||||
*
|
*
|
||||||
* Uncomment to make ssl_set_ecdh_curves() available.
|
* Uncomment to make ssl_set_curves() available.
|
||||||
*/
|
*/
|
||||||
#define POLARSSL_SSL_SET_ECDH_CURVES
|
#define POLARSSL_SSL_SET_CURVES
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \def POLARSSL_THREADING_ALT
|
* \def POLARSSL_THREADING_ALT
|
||||||
|
|
|
@ -728,8 +728,8 @@ struct _ssl_context
|
||||||
int allow_legacy_renegotiation; /*!< allow legacy renegotiation */
|
int allow_legacy_renegotiation; /*!< allow legacy renegotiation */
|
||||||
const int *ciphersuite_list[4]; /*!< allowed ciphersuites / version */
|
const int *ciphersuite_list[4]; /*!< allowed ciphersuites / version */
|
||||||
#if defined(POLARSSL_KEY_EXCHANGE__SOME__ECDHE_ENABLED) && \
|
#if defined(POLARSSL_KEY_EXCHANGE__SOME__ECDHE_ENABLED) && \
|
||||||
defined(POLARSSL_SSL_SET_ECDH_CURVES)
|
defined(POLARSSL_SSL_SET_CURVES)
|
||||||
const ecp_group_id *ecdh_curve_list;/*!< allowed curves for ECDH */
|
const ecp_group_id *curve_list; /*!< allowed curves */
|
||||||
#endif
|
#endif
|
||||||
#if defined(POLARSSL_SSL_TRUNCATED_HMAC)
|
#if defined(POLARSSL_SSL_TRUNCATED_HMAC)
|
||||||
int trunc_hmac; /*!< negotiate truncated hmac? */
|
int trunc_hmac; /*!< negotiate truncated hmac? */
|
||||||
|
@ -1160,7 +1160,7 @@ int ssl_set_dh_param_ctx( ssl_context *ssl, dhm_context *dhm_ctx );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(POLARSSL_KEY_EXCHANGE__SOME__ECDHE_ENABLED) && \
|
#if defined(POLARSSL_KEY_EXCHANGE__SOME__ECDHE_ENABLED) && \
|
||||||
defined(POLARSSL_SSL_SET_ECDH_CURVES)
|
defined(POLARSSL_SSL_SET_CURVES)
|
||||||
/**
|
/**
|
||||||
* \brief Set the allowed ECDH curves.
|
* \brief Set the allowed ECDH curves.
|
||||||
* (Default: all defined curves.)
|
* (Default: all defined curves.)
|
||||||
|
@ -1169,10 +1169,9 @@ int ssl_set_dh_param_ctx( ssl_context *ssl, dhm_context *dhm_ctx );
|
||||||
* handshake curve preference.
|
* handshake curve preference.
|
||||||
*
|
*
|
||||||
* \param ssl SSL context
|
* \param ssl SSL context
|
||||||
* \param ecdh_curve_list Zero terminated list of the allowed ECDH curves
|
* \param curves Zero terminated list of the allowed ECDH curves
|
||||||
*/
|
*/
|
||||||
void ssl_set_ecdh_curves( ssl_context *ssl,
|
void ssl_set_curves( ssl_context *ssl, const ecp_group_id *curves );
|
||||||
const ecp_group_id *ecdh_curve_list );
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(POLARSSL_SSL_SERVER_NAME_INDICATION)
|
#if defined(POLARSSL_SSL_SERVER_NAME_INDICATION)
|
||||||
|
|
|
@ -2106,12 +2106,12 @@ static int ssl_write_server_key_exchange( ssl_context *ssl )
|
||||||
* } ServerECDHParams;
|
* } ServerECDHParams;
|
||||||
*/
|
*/
|
||||||
ecp_group_id grp_id;
|
ecp_group_id grp_id;
|
||||||
#if defined(POLARSSL_SSL_SET_ECDH_CURVES)
|
#if defined(POLARSSL_SSL_SET_CURVES)
|
||||||
unsigned int pref_idx, curv_idx, found;
|
unsigned int pref_idx, curv_idx, found;
|
||||||
|
|
||||||
/* Match our preference list against the agreed curves */
|
/* Match our preference list against the agreed curves */
|
||||||
for( pref_idx = 0, found = 0;
|
for( pref_idx = 0, found = 0;
|
||||||
ssl->ecdh_curve_list[pref_idx] != POLARSSL_ECP_DP_NONE;
|
ssl->curve_list[pref_idx] != POLARSSL_ECP_DP_NONE;
|
||||||
pref_idx++ )
|
pref_idx++ )
|
||||||
{
|
{
|
||||||
/* Look through the agreed curve list */
|
/* Look through the agreed curve list */
|
||||||
|
@ -2120,7 +2120,7 @@ static int ssl_write_server_key_exchange( ssl_context *ssl )
|
||||||
curv_idx++ )
|
curv_idx++ )
|
||||||
{
|
{
|
||||||
if (ssl->handshake->curves[curv_idx]->grp_id ==
|
if (ssl->handshake->curves[curv_idx]->grp_id ==
|
||||||
ssl->ecdh_curve_list[pref_idx] )
|
ssl->curve_list[pref_idx] )
|
||||||
{
|
{
|
||||||
/* We found our most preferred curve */
|
/* We found our most preferred curve */
|
||||||
found = 1;
|
found = 1;
|
||||||
|
@ -2130,18 +2130,18 @@ static int ssl_write_server_key_exchange( ssl_context *ssl )
|
||||||
|
|
||||||
/* Exit the search if we have found our curve */
|
/* Exit the search if we have found our curve */
|
||||||
if( found == 1 )
|
if( found == 1 )
|
||||||
{
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
/* If we haven't found any allowed / preferred curve,
|
/*
|
||||||
* ssl->ecdh_curve_list[pref_idx] will contain POLARSSL_ECP_DP_NONE and
|
* If we haven't found any allowed / preferred curve,
|
||||||
|
* ssl->curve_list[pref_idx] will contain POLARSSL_ECP_DP_NONE and
|
||||||
* ecp_use_known_dp() will fail.
|
* ecp_use_known_dp() will fail.
|
||||||
*/
|
*/
|
||||||
grp_id = ssl->ecdh_curve_list[pref_idx];
|
grp_id = ssl->curve_list[pref_idx];
|
||||||
#else
|
#else
|
||||||
grp_id = ssl->handshake->curves[0]->grp_id;
|
grp_id = ssl->handshake->curves[0]->grp_id;
|
||||||
#endif /* POLARSSL_SSL_SET_ECDH_CURVES */
|
#endif /* POLARSSL_SSL_SET_CURVES */
|
||||||
|
|
||||||
if( ( ret = ecp_use_known_dp( &ssl->handshake->ecdh_ctx.grp,
|
if( ( ret = ecp_use_known_dp( &ssl->handshake->ecdh_ctx.grp,
|
||||||
grp_id ) ) != 0 )
|
grp_id ) ) != 0 )
|
||||||
|
|
|
@ -3335,7 +3335,7 @@ int ssl_init( ssl_context *ssl )
|
||||||
*
|
*
|
||||||
* TODO: Add the Montgomery curves
|
* TODO: Add the Montgomery curves
|
||||||
*/
|
*/
|
||||||
static const ecp_group_id ecdh_default_curve_list[] =
|
static const ecp_group_id default_curve_list[] =
|
||||||
{
|
{
|
||||||
#if defined(POLARSSL_ECP_DP_SECP521R1_ENABLED)
|
#if defined(POLARSSL_ECP_DP_SECP521R1_ENABLED)
|
||||||
POLARSSL_ECP_DP_SECP521R1,
|
POLARSSL_ECP_DP_SECP521R1,
|
||||||
|
@ -3425,8 +3425,8 @@ int ssl_init( ssl_context *ssl )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(POLARSSL_KEY_EXCHANGE__SOME__ECDHE_ENABLED) && \
|
#if defined(POLARSSL_KEY_EXCHANGE__SOME__ECDHE_ENABLED) && \
|
||||||
defined(POLARSSL_SSL_SET_ECDH_CURVES)
|
defined(POLARSSL_SSL_SET_CURVES)
|
||||||
ssl->ecdh_curve_list = ecdh_default_curve_list;
|
ssl->curve_list = default_curve_list;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if( ( ret = ssl_handshake_init( ssl ) ) != 0 )
|
if( ( ret = ssl_handshake_init( ssl ) ) != 0 )
|
||||||
|
@ -4657,12 +4657,12 @@ md_type_t ssl_md_alg_from_hash( unsigned char hash )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(POLARSSL_KEY_EXCHANGE__SOME__ECDHE_ENABLED) && \
|
#if defined(POLARSSL_KEY_EXCHANGE__SOME__ECDHE_ENABLED) && \
|
||||||
defined(POLARSSL_SSL_SET_ECDH_CURVES)
|
defined(POLARSSL_SSL_SET_CURVES)
|
||||||
/*
|
/*
|
||||||
* Set the allowed ECDH curves.
|
* Set the allowed ECDH curves.
|
||||||
*/
|
*/
|
||||||
void ssl_set_ecdh_curves( ssl_context *ssl, const ecp_group_id *ecdh_curve_list )
|
void ssl_set_curves( ssl_context *ssl, const ecp_group_id *curve_list )
|
||||||
{
|
{
|
||||||
ssl->ecdh_curve_list = ecdh_curve_list;
|
ssl->curve_list = curve_list;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue