mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Merge branch 'feature/mbedtls-3.2.1_v5.0' into 'release/v5.0'
mbedtls: Update to v3.2.1 (v5.0) See merge request espressif/esp-idf!19797
This commit is contained in:
commit
acbf7af80a
@ -113,11 +113,8 @@ esp_err_t esp_create_mbedtls_handle(const char *hostname, size_t hostlen, const
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_MBEDTLS_SSL_PROTO_TLS1_3
|
||||
// NOTE: Mbed TLS currently supports only client-side config with TLS 1.3
|
||||
if (tls->role != ESP_TLS_SERVER) {
|
||||
mbedtls_ssl_conf_min_version(&tls->conf, MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_4);
|
||||
mbedtls_ssl_conf_max_version(&tls->conf, MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_4);
|
||||
}
|
||||
mbedtls_ssl_conf_min_tls_version(&tls->conf, MBEDTLS_SSL_VERSION_TLS1_3);
|
||||
mbedtls_ssl_conf_max_tls_version(&tls->conf, MBEDTLS_SSL_VERSION_TLS1_3);
|
||||
#endif
|
||||
|
||||
if ((ret = mbedtls_ssl_setup(&tls->ssl, &tls->conf)) != 0) {
|
||||
|
@ -8,7 +8,7 @@ if(NOT BOOTLOADER_BUILD)
|
||||
endif()
|
||||
|
||||
set(mbedtls_srcs "")
|
||||
set(mbedtls_include_dirs "port/include" "mbedtls/include" "./mbedtls/library")
|
||||
set(mbedtls_include_dirs "port/include" "mbedtls/include" "mbedtls/library")
|
||||
|
||||
if(CONFIG_MBEDTLS_CERTIFICATE_BUNDLE)
|
||||
list(APPEND mbedtls_srcs "esp_crt_bundle/esp_crt_bundle.c")
|
||||
@ -238,6 +238,7 @@ endforeach()
|
||||
|
||||
if(CONFIG_MBEDTLS_DYNAMIC_BUFFER)
|
||||
set(WRAP_FUNCTIONS
|
||||
mbedtls_ssl_write_client_hello
|
||||
mbedtls_ssl_handshake_client_step
|
||||
mbedtls_ssl_handshake_server_step
|
||||
mbedtls_ssl_read
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 9bb5effc3298265f829878825d9bd38478e67514
|
||||
Subproject commit 7b428b1bf260ce1fec4e3ffb6494070d439a3a67
|
@ -8,8 +8,10 @@
|
||||
#include "esp_mbedtls_dynamic_impl.h"
|
||||
|
||||
int __real_mbedtls_ssl_handshake_client_step(mbedtls_ssl_context *ssl);
|
||||
int __real_mbedtls_ssl_write_client_hello(mbedtls_ssl_context *ssl);
|
||||
|
||||
int __wrap_mbedtls_ssl_handshake_client_step(mbedtls_ssl_context *ssl);
|
||||
int __wrap_mbedtls_ssl_write_client_hello(mbedtls_ssl_context *ssl);
|
||||
|
||||
static const char *TAG = "SSL client";
|
||||
|
||||
@ -27,6 +29,16 @@ static int manage_resource(mbedtls_ssl_context *ssl, bool add)
|
||||
}
|
||||
}
|
||||
|
||||
/* Change state now, so that it is right in mbedtls_ssl_read_record(), used
|
||||
* by DTLS for dropping out-of-sequence ChangeCipherSpec records */
|
||||
#if defined(MBEDTLS_SSL_SESSION_TICKETS)
|
||||
if( ssl->state == MBEDTLS_SSL_SERVER_CHANGE_CIPHER_SPEC &&
|
||||
ssl->handshake->new_session_ticket != 0 )
|
||||
{
|
||||
ssl->state = MBEDTLS_SSL_SERVER_NEW_SESSION_TICKET;
|
||||
}
|
||||
#endif
|
||||
|
||||
switch (state) {
|
||||
case MBEDTLS_SSL_HELLO_REQUEST:
|
||||
break;
|
||||
@ -189,3 +201,14 @@ int __wrap_mbedtls_ssl_handshake_client_step(mbedtls_ssl_context *ssl)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int __wrap_mbedtls_ssl_write_client_hello(mbedtls_ssl_context *ssl)
|
||||
{
|
||||
CHECK_OK(manage_resource(ssl, true));
|
||||
|
||||
CHECK_OK(__real_mbedtls_ssl_write_client_hello(ssl));
|
||||
|
||||
CHECK_OK(manage_resource(ssl, false));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -46,7 +46,6 @@ static int manage_resource(mbedtls_ssl_context *ssl, bool add)
|
||||
|
||||
switch (state) {
|
||||
case MBEDTLS_SSL_HELLO_REQUEST:
|
||||
ssl->MBEDTLS_PRIVATE(major_ver) = MBEDTLS_SSL_MAJOR_VERSION_3;
|
||||
break;
|
||||
case MBEDTLS_SSL_CLIENT_HELLO:
|
||||
if (add) {
|
||||
|
@ -45,33 +45,18 @@ static int rx_done(mbedtls_ssl_context *ssl)
|
||||
static void ssl_update_checksum_start( mbedtls_ssl_context *ssl,
|
||||
const unsigned char *buf, size_t len )
|
||||
{
|
||||
#if defined(MBEDTLS_SSL_PROTO_SSL3) || defined(MBEDTLS_SSL_PROTO_TLS1) || \
|
||||
defined(MBEDTLS_SSL_PROTO_TLS1_1)
|
||||
mbedtls_md5_update( &ssl->handshake->fin_md5 , buf, len );
|
||||
mbedtls_sha1_update( &ssl->handshake->fin_sha1, buf, len );
|
||||
#endif
|
||||
#if defined(MBEDTLS_SSL_PROTO_TLS1_2)
|
||||
#if defined(MBEDTLS_SHA256_C)
|
||||
mbedtls_sha256_update( &ssl->handshake->fin_sha256, buf, len );
|
||||
#endif
|
||||
#if defined(MBEDTLS_SHA512_C)
|
||||
mbedtls_sha512_update( &ssl->handshake->fin_sha512, buf, len );
|
||||
#endif
|
||||
#endif /* MBEDTLS_SSL_PROTO_TLS1_2 */
|
||||
}
|
||||
|
||||
static void ssl_handshake_params_init( mbedtls_ssl_handshake_params *handshake )
|
||||
{
|
||||
memset( handshake, 0, sizeof( mbedtls_ssl_handshake_params ) );
|
||||
|
||||
#if defined(MBEDTLS_SSL_PROTO_SSL3) || defined(MBEDTLS_SSL_PROTO_TLS1) || \
|
||||
defined(MBEDTLS_SSL_PROTO_TLS1_1)
|
||||
mbedtls_md5_init( &handshake->fin_md5 );
|
||||
mbedtls_sha1_init( &handshake->fin_sha1 );
|
||||
mbedtls_md5_starts( &handshake->fin_md5 );
|
||||
mbedtls_sha1_starts( &handshake->fin_sha1 );
|
||||
#endif
|
||||
#if defined(MBEDTLS_SSL_PROTO_TLS1_2)
|
||||
#if defined(MBEDTLS_SHA256_C)
|
||||
mbedtls_sha256_init( &handshake->fin_sha256 );
|
||||
mbedtls_sha256_starts( &handshake->fin_sha256, 0 );
|
||||
@ -80,15 +65,9 @@ static void ssl_handshake_params_init( mbedtls_ssl_handshake_params *handshake )
|
||||
mbedtls_sha512_init( &handshake->fin_sha512 );
|
||||
mbedtls_sha512_starts( &handshake->fin_sha512, 1 );
|
||||
#endif
|
||||
#endif /* MBEDTLS_SSL_PROTO_TLS1_2 */
|
||||
|
||||
handshake->update_checksum = ssl_update_checksum_start;
|
||||
|
||||
#if defined(MBEDTLS_SSL_PROTO_TLS1_2) && \
|
||||
defined(MBEDTLS_KEY_EXCHANGE_WITH_CERT_ENABLED)
|
||||
mbedtls_ssl_sig_hash_set_init( &handshake->hash_algs );
|
||||
#endif
|
||||
|
||||
#if defined(MBEDTLS_DHM_C)
|
||||
mbedtls_dhm_init( &handshake->dhm_ctx );
|
||||
#endif
|
||||
@ -145,6 +124,12 @@ static int ssl_handshake_init( mbedtls_ssl_context *ssl )
|
||||
{
|
||||
ssl->handshake = mbedtls_calloc( 1, sizeof(mbedtls_ssl_handshake_params) );
|
||||
}
|
||||
#if defined(MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH)
|
||||
/* If the buffers are too small - reallocate */
|
||||
|
||||
handle_buffer_resizing( ssl, 0, MBEDTLS_SSL_IN_BUFFER_LEN,
|
||||
MBEDTLS_SSL_OUT_BUFFER_LEN );
|
||||
#endif
|
||||
|
||||
/* All pointers should exist and can be directly freed without issue */
|
||||
if( ssl->handshake == NULL ||
|
||||
@ -169,6 +154,120 @@ static int ssl_handshake_init( mbedtls_ssl_context *ssl )
|
||||
mbedtls_ssl_transform_init( ssl->transform_negotiate );
|
||||
ssl_handshake_params_init( ssl->handshake );
|
||||
|
||||
/*
|
||||
* curve_list is translated to IANA TLS group identifiers here because
|
||||
* mbedtls_ssl_conf_curves returns void and so can't return
|
||||
* any error codes.
|
||||
*/
|
||||
#if defined(MBEDTLS_ECP_C)
|
||||
#if !defined(MBEDTLS_DEPRECATED_REMOVED)
|
||||
/* Heap allocate and translate curve_list from internal to IANA group ids */
|
||||
if ( ssl->conf->curve_list != NULL )
|
||||
{
|
||||
size_t length;
|
||||
const mbedtls_ecp_group_id *curve_list = ssl->conf->curve_list;
|
||||
|
||||
for( length = 0; ( curve_list[length] != MBEDTLS_ECP_DP_NONE ) &&
|
||||
( length < MBEDTLS_ECP_DP_MAX ); length++ ) {}
|
||||
|
||||
/* Leave room for zero termination */
|
||||
uint16_t *group_list = mbedtls_calloc( length + 1, sizeof(uint16_t) );
|
||||
if ( group_list == NULL )
|
||||
return( MBEDTLS_ERR_SSL_ALLOC_FAILED );
|
||||
|
||||
for( size_t i = 0; i < length; i++ )
|
||||
{
|
||||
const mbedtls_ecp_curve_info *info =
|
||||
mbedtls_ecp_curve_info_from_grp_id( curve_list[i] );
|
||||
if ( info == NULL )
|
||||
{
|
||||
mbedtls_free( group_list );
|
||||
return( MBEDTLS_ERR_SSL_BAD_CONFIG );
|
||||
}
|
||||
group_list[i] = info->tls_id;
|
||||
}
|
||||
|
||||
group_list[length] = 0;
|
||||
|
||||
ssl->handshake->group_list = group_list;
|
||||
ssl->handshake->group_list_heap_allocated = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
ssl->handshake->group_list = ssl->conf->group_list;
|
||||
ssl->handshake->group_list_heap_allocated = 0;
|
||||
}
|
||||
#endif /* MBEDTLS_DEPRECATED_REMOVED */
|
||||
#endif /* MBEDTLS_ECP_C */
|
||||
|
||||
#if defined(MBEDTLS_KEY_EXCHANGE_WITH_CERT_ENABLED)
|
||||
#if !defined(MBEDTLS_DEPRECATED_REMOVED)
|
||||
#if defined(MBEDTLS_SSL_PROTO_TLS1_2)
|
||||
/* Heap allocate and translate sig_hashes from internal hash identifiers to
|
||||
signature algorithms IANA identifiers. */
|
||||
if ( mbedtls_ssl_conf_is_tls12_only( ssl->conf ) &&
|
||||
ssl->conf->sig_hashes != NULL )
|
||||
{
|
||||
const int *md;
|
||||
const int *sig_hashes = ssl->conf->sig_hashes;
|
||||
size_t sig_algs_len = 0;
|
||||
uint16_t *p;
|
||||
|
||||
#if defined(static_assert)
|
||||
static_assert( MBEDTLS_SSL_MAX_SIG_ALG_LIST_LEN
|
||||
<= ( SIZE_MAX - ( 2 * sizeof(uint16_t) ) ),
|
||||
"MBEDTLS_SSL_MAX_SIG_ALG_LIST_LEN too big" );
|
||||
#endif
|
||||
|
||||
for( md = sig_hashes; *md != MBEDTLS_MD_NONE; md++ )
|
||||
{
|
||||
if( mbedtls_ssl_hash_from_md_alg( *md ) == MBEDTLS_SSL_HASH_NONE )
|
||||
continue;
|
||||
#if defined(MBEDTLS_ECDSA_C)
|
||||
sig_algs_len += sizeof( uint16_t );
|
||||
#endif
|
||||
|
||||
#if defined(MBEDTLS_RSA_C)
|
||||
sig_algs_len += sizeof( uint16_t );
|
||||
#endif
|
||||
if( sig_algs_len > MBEDTLS_SSL_MAX_SIG_ALG_LIST_LEN )
|
||||
return( MBEDTLS_ERR_SSL_BAD_CONFIG );
|
||||
}
|
||||
|
||||
if( sig_algs_len < MBEDTLS_SSL_MIN_SIG_ALG_LIST_LEN )
|
||||
return( MBEDTLS_ERR_SSL_BAD_CONFIG );
|
||||
|
||||
ssl->handshake->sig_algs = mbedtls_calloc( 1, sig_algs_len +
|
||||
sizeof( uint16_t ));
|
||||
if( ssl->handshake->sig_algs == NULL )
|
||||
return( MBEDTLS_ERR_SSL_ALLOC_FAILED );
|
||||
|
||||
p = (uint16_t *)ssl->handshake->sig_algs;
|
||||
for( md = sig_hashes; *md != MBEDTLS_MD_NONE; md++ )
|
||||
{
|
||||
unsigned char hash = mbedtls_ssl_hash_from_md_alg( *md );
|
||||
if( hash == MBEDTLS_SSL_HASH_NONE )
|
||||
continue;
|
||||
#if defined(MBEDTLS_ECDSA_C)
|
||||
*p = (( hash << 8 ) | MBEDTLS_SSL_SIG_ECDSA);
|
||||
p++;
|
||||
#endif
|
||||
#if defined(MBEDTLS_RSA_C)
|
||||
*p = (( hash << 8 ) | MBEDTLS_SSL_SIG_RSA);
|
||||
p++;
|
||||
#endif
|
||||
}
|
||||
*p = MBEDTLS_TLS_SIG_NONE;
|
||||
ssl->handshake->sig_algs_heap_allocated = 1;
|
||||
}
|
||||
else
|
||||
#endif /* MBEDTLS_SSL_PROTO_TLS1_2 */
|
||||
{
|
||||
ssl->handshake->sig_algs_heap_allocated = 0;
|
||||
}
|
||||
#endif /* !MBEDTLS_DEPRECATED_REMOVED */
|
||||
#endif /* MBEDTLS_KEY_EXCHANGE_WITH_CERT_ENABLED */
|
||||
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
|
@ -53,40 +53,25 @@ static int esp_mbedtls_ecp_point_multiply(const mbedtls_ecp_group *grp, mbedtls_
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* Restartable multiplication R = m * P
|
||||
*/
|
||||
int mbedtls_ecp_mul_restartable( mbedtls_ecp_group *grp, mbedtls_ecp_point *R,
|
||||
int ecp_mul_restartable_internal( mbedtls_ecp_group *grp, mbedtls_ecp_point *R,
|
||||
const mbedtls_mpi *m, const mbedtls_ecp_point *P,
|
||||
int (*f_rng)(void *, unsigned char *, size_t), void *p_rng,
|
||||
mbedtls_ecp_restart_ctx *rs_ctx )
|
||||
{
|
||||
int ret = MBEDTLS_ERR_ECP_BAD_INPUT_DATA;
|
||||
|
||||
if (grp->id != MBEDTLS_ECP_DP_SECP192R1 && grp->id != MBEDTLS_ECP_DP_SECP256R1) {
|
||||
#if defined(MBEDTLS_ECP_MUL_ALT_SOFT_FALLBACK)
|
||||
return mbedtls_ecp_mul_restartable_soft(grp, R, m, P, f_rng, p_rng, rs_ctx);
|
||||
return ecp_mul_restartable_internal_soft(grp, R, m, P, f_rng, p_rng, rs_ctx);
|
||||
#else
|
||||
return ret;
|
||||
#endif
|
||||
}
|
||||
ECP_VALIDATE_RET( grp != NULL );
|
||||
ECP_VALIDATE_RET( R != NULL );
|
||||
ECP_VALIDATE_RET( m != NULL );
|
||||
ECP_VALIDATE_RET( P != NULL );
|
||||
|
||||
/* Common sanity checks */
|
||||
MBEDTLS_MPI_CHK( mbedtls_ecp_check_privkey( grp, m ) );
|
||||
MBEDTLS_MPI_CHK( mbedtls_ecp_check_pubkey( grp, P ) );
|
||||
|
||||
ret = MBEDTLS_ERR_ECP_BAD_INPUT_DATA;
|
||||
/* MBEDTLS_MPI_CHK macro assigns the return value of the function to
|
||||
* `ret` variable
|
||||
*/
|
||||
MBEDTLS_MPI_CHK( esp_mbedtls_ecp_point_multiply(grp, R, m, P) );
|
||||
cleanup:
|
||||
return( ret );
|
||||
}
|
||||
|
||||
#endif /* defined(MBEDTLS_ECP_MUL_ALT) || defined(MBEDTLS_ECP_MUL_ALT_SOFT_FALLBACK) */
|
||||
|
||||
#if defined(MBEDTLS_ECP_VERIFY_ALT) || defined(MBEDTLS_ECP_VERIFY_ALT_SOFT_FALLBACK)
|
||||
|
@ -12,13 +12,18 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if defined(MBEDTLS_ECP_MUL_ALT_SOFT_FALLBACK)
|
||||
|
||||
int mbedtls_ecp_mul_restartable_soft(mbedtls_ecp_group *grp, mbedtls_ecp_point *R,
|
||||
#if defined(MBEDTLS_ECP_MUL_ALT) || defined(MBEDTLS_ECP_MUL_ALT_SOFT_FALLBACK)
|
||||
int ecp_mul_restartable_internal( mbedtls_ecp_group *grp, mbedtls_ecp_point *R,
|
||||
const mbedtls_mpi *m, const mbedtls_ecp_point *P,
|
||||
int (*f_rng)(void *, unsigned char *, size_t), void *p_rng,
|
||||
mbedtls_ecp_restart_ctx *rs_ctx );
|
||||
#endif
|
||||
|
||||
#if defined(MBEDTLS_ECP_MUL_ALT_SOFT_FALLBACK)
|
||||
int ecp_mul_restartable_internal_soft( mbedtls_ecp_group *grp, mbedtls_ecp_point *R,
|
||||
const mbedtls_mpi *m, const mbedtls_ecp_point *P,
|
||||
int (*f_rng)(void *, unsigned char *, size_t), void *p_rng,
|
||||
mbedtls_ecp_restart_ctx *rs_ctx );
|
||||
#endif
|
||||
|
||||
#if defined(MBEDTLS_ECP_VERIFY_ALT_SOFT_FALLBACK)
|
||||
|
@ -196,12 +196,18 @@ static int set_ca_cert(tls_context_t *tls, const unsigned char *cacert, size_t c
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SUITEB192
|
||||
static int tls_sig_hashes_for_suiteb[] = {
|
||||
static uint16_t tls_sig_algs_for_suiteb[] = {
|
||||
#if defined(MBEDTLS_SHA512_C)
|
||||
MBEDTLS_MD_SHA512,
|
||||
MBEDTLS_MD_SHA384,
|
||||
#if defined(MBEDTLS_ECDSA_C)
|
||||
MBEDTLS_SSL_TLS12_SIG_AND_HASH_ALG( MBEDTLS_SSL_SIG_ECDSA, MBEDTLS_SSL_HASH_SHA512 ),
|
||||
MBEDTLS_SSL_TLS12_SIG_AND_HASH_ALG( MBEDTLS_SSL_SIG_ECDSA, MBEDTLS_SSL_HASH_SHA384 ),
|
||||
#endif
|
||||
MBEDTLS_MD_NONE
|
||||
#if defined(MBEDTLS_RSA_C)
|
||||
MBEDTLS_SSL_TLS12_SIG_AND_HASH_ALG( MBEDTLS_SSL_SIG_RSA, MBEDTLS_SSL_HASH_SHA512 ),
|
||||
MBEDTLS_SSL_TLS12_SIG_AND_HASH_ALG( MBEDTLS_SSL_SIG_RSA, MBEDTLS_SSL_HASH_SHA384 ),
|
||||
#endif
|
||||
#endif /* MBEDTLS_SHA512_C */
|
||||
MBEDTLS_TLS_SIG_NONE
|
||||
};
|
||||
|
||||
const mbedtls_x509_crt_profile suiteb_mbedtls_x509_crt_profile =
|
||||
@ -220,23 +226,40 @@ static void tls_set_suiteb_config(tls_context_t *tls)
|
||||
{
|
||||
const mbedtls_x509_crt_profile *crt_profile = &suiteb_mbedtls_x509_crt_profile;
|
||||
mbedtls_ssl_conf_cert_profile(&tls->conf, crt_profile);
|
||||
mbedtls_ssl_conf_sig_hashes(&tls->conf, tls_sig_hashes_for_suiteb);
|
||||
mbedtls_ssl_conf_sig_algs(&tls->conf, tls_sig_algs_for_suiteb);
|
||||
}
|
||||
#endif
|
||||
|
||||
static int tls_sig_hashes_for_eap[] = {
|
||||
static uint16_t tls_sig_algs_for_eap[] = {
|
||||
#if defined(MBEDTLS_SHA512_C)
|
||||
MBEDTLS_MD_SHA512,
|
||||
MBEDTLS_MD_SHA384,
|
||||
#if defined(MBEDTLS_ECDSA_C)
|
||||
MBEDTLS_SSL_TLS12_SIG_AND_HASH_ALG( MBEDTLS_SSL_SIG_ECDSA, MBEDTLS_SSL_HASH_SHA512 ),
|
||||
MBEDTLS_SSL_TLS12_SIG_AND_HASH_ALG( MBEDTLS_SSL_SIG_ECDSA, MBEDTLS_SSL_HASH_SHA384 ),
|
||||
#endif
|
||||
#if defined(MBEDTLS_RSA_C)
|
||||
MBEDTLS_SSL_TLS12_SIG_AND_HASH_ALG( MBEDTLS_SSL_SIG_RSA, MBEDTLS_SSL_HASH_SHA512 ),
|
||||
MBEDTLS_SSL_TLS12_SIG_AND_HASH_ALG( MBEDTLS_SSL_SIG_RSA, MBEDTLS_SSL_HASH_SHA384 ),
|
||||
#endif
|
||||
#endif /* MBEDTLS_SHA512_C */
|
||||
#if defined(MBEDTLS_SHA256_C)
|
||||
MBEDTLS_MD_SHA256,
|
||||
MBEDTLS_MD_SHA224,
|
||||
#if defined(MBEDTLS_ECDSA_C)
|
||||
MBEDTLS_SSL_TLS12_SIG_AND_HASH_ALG( MBEDTLS_SSL_SIG_ECDSA, MBEDTLS_SSL_HASH_SHA256 ),
|
||||
MBEDTLS_SSL_TLS12_SIG_AND_HASH_ALG( MBEDTLS_SSL_SIG_ECDSA, MBEDTLS_SSL_HASH_SHA224 ),
|
||||
#endif
|
||||
#if defined(MBEDTLS_RSA_C)
|
||||
MBEDTLS_SSL_TLS12_SIG_AND_HASH_ALG( MBEDTLS_SSL_SIG_RSA, MBEDTLS_SSL_HASH_SHA256 ),
|
||||
MBEDTLS_SSL_TLS12_SIG_AND_HASH_ALG( MBEDTLS_SSL_SIG_RSA, MBEDTLS_SSL_HASH_SHA224 ),
|
||||
#endif
|
||||
#endif /* MBEDTLS_SHA256_C */
|
||||
#if defined(MBEDTLS_SHA1_C)
|
||||
MBEDTLS_MD_SHA1,
|
||||
#if defined(MBEDTLS_ECDSA_C)
|
||||
MBEDTLS_SSL_TLS12_SIG_AND_HASH_ALG( MBEDTLS_SSL_SIG_ECDSA, MBEDTLS_SSL_HASH_SHA1 ),
|
||||
#endif
|
||||
MBEDTLS_MD_NONE
|
||||
#if defined(MBEDTLS_RSA_C)
|
||||
MBEDTLS_SSL_TLS12_SIG_AND_HASH_ALG( MBEDTLS_SSL_SIG_RSA, MBEDTLS_SSL_HASH_SHA1 ),
|
||||
#endif
|
||||
#endif /* MBEDTLS_SHA1_C */
|
||||
MBEDTLS_TLS_SIG_NONE
|
||||
};
|
||||
|
||||
const mbedtls_x509_crt_profile eap_mbedtls_x509_crt_profile =
|
||||
@ -262,7 +285,7 @@ static void tls_enable_sha1_config(tls_context_t *tls)
|
||||
{
|
||||
const mbedtls_x509_crt_profile *crt_profile = &eap_mbedtls_x509_crt_profile;
|
||||
mbedtls_ssl_conf_cert_profile(&tls->conf, crt_profile);
|
||||
mbedtls_ssl_conf_sig_hashes(&tls->conf, tls_sig_hashes_for_eap);
|
||||
mbedtls_ssl_conf_sig_algs(&tls->conf, tls_sig_algs_for_eap);
|
||||
}
|
||||
|
||||
static const int eap_ciphersuite_preference[] =
|
||||
|
Loading…
x
Reference in New Issue
Block a user