mirror of
https://git.suyu.dev/suyu/mbedtls.git
synced 2025-12-24 00:06:32 +01:00
Merge remote-tracking branch 'upstream-restricted/pr/410' into development-restricted
- Resolve ChangeLog conflicts - Update Doxygen warning block in dhm.h to render correctly - Prefix the exported identifier deprecated_constant_t with mbedtls_
This commit is contained in:
commit
784de59ccd
10 changed files with 942 additions and 134 deletions
|
|
@ -6161,6 +6161,8 @@ void mbedtls_ssl_conf_psk_cb( mbedtls_ssl_config *conf,
|
|||
#endif /* MBEDTLS_KEY_EXCHANGE__SOME__PSK_ENABLED */
|
||||
|
||||
#if defined(MBEDTLS_DHM_C) && defined(MBEDTLS_SSL_SRV_C)
|
||||
|
||||
#if !defined(MBEDTLS_DEPRECATED_REMOVED)
|
||||
int mbedtls_ssl_conf_dh_param( mbedtls_ssl_config *conf, const char *dhm_P, const char *dhm_G )
|
||||
{
|
||||
int ret;
|
||||
|
|
@ -6175,6 +6177,24 @@ int mbedtls_ssl_conf_dh_param( mbedtls_ssl_config *conf, const char *dhm_P, cons
|
|||
|
||||
return( 0 );
|
||||
}
|
||||
#endif /* MBEDTLS_DEPRECATED_REMOVED */
|
||||
|
||||
int mbedtls_ssl_conf_dh_param_bin( mbedtls_ssl_config *conf,
|
||||
const unsigned char *dhm_P, size_t P_len,
|
||||
const unsigned char *dhm_G, size_t G_len )
|
||||
{
|
||||
int ret;
|
||||
|
||||
if( ( ret = mbedtls_mpi_read_binary( &conf->dhm_P, dhm_P, P_len ) ) != 0 ||
|
||||
( ret = mbedtls_mpi_read_binary( &conf->dhm_G, dhm_G, G_len ) ) != 0 )
|
||||
{
|
||||
mbedtls_mpi_free( &conf->dhm_P );
|
||||
mbedtls_mpi_free( &conf->dhm_G );
|
||||
return( ret );
|
||||
}
|
||||
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
int mbedtls_ssl_conf_dh_param_ctx( mbedtls_ssl_config *conf, mbedtls_dhm_context *dhm_ctx )
|
||||
{
|
||||
|
|
@ -7602,9 +7622,14 @@ int mbedtls_ssl_config_defaults( mbedtls_ssl_config *conf,
|
|||
#if defined(MBEDTLS_DHM_C) && defined(MBEDTLS_SSL_SRV_C)
|
||||
if( endpoint == MBEDTLS_SSL_IS_SERVER )
|
||||
{
|
||||
if( ( ret = mbedtls_ssl_conf_dh_param( conf,
|
||||
MBEDTLS_DHM_RFC5114_MODP_2048_P,
|
||||
MBEDTLS_DHM_RFC5114_MODP_2048_G ) ) != 0 )
|
||||
const unsigned char dhm_p[] =
|
||||
MBEDTLS_DHM_RFC3526_MODP_2048_P_BIN;
|
||||
const unsigned char dhm_g[] =
|
||||
MBEDTLS_DHM_RFC3526_MODP_2048_G_BIN;
|
||||
|
||||
if ( ( ret = mbedtls_ssl_conf_dh_param_bin( conf,
|
||||
dhm_p, sizeof( dhm_p ),
|
||||
dhm_g, sizeof( dhm_g ) ) ) != 0 )
|
||||
{
|
||||
return( ret );
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue