mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-12-23 16:15:34 +00:00
Merge pull request #686 from ARMmbed/merge-2.22.0-release-to-development
Merge 2.22.0 release to development
This commit is contained in:
commit
a18c4f35c9
16
ChangeLog
16
ChangeLog
|
@ -1,6 +1,6 @@
|
||||||
mbed TLS ChangeLog (Sorted per branch, date)
|
mbed TLS ChangeLog (Sorted per branch, date)
|
||||||
|
|
||||||
= mbed TLS x.x.x branch released xxxx-xx-xx
|
= mbed TLS 2.22.0 branch released 2020-04-14
|
||||||
|
|
||||||
New deprecations
|
New deprecations
|
||||||
* Deprecate MBEDTLS_SSL_HW_RECORD_ACCEL that enables function hooks in the
|
* Deprecate MBEDTLS_SSL_HW_RECORD_ACCEL that enables function hooks in the
|
||||||
|
@ -17,12 +17,26 @@ Security
|
||||||
legitimate clients, resulting in a Denial of Service. This could only
|
legitimate clients, resulting in a Denial of Service. This could only
|
||||||
happen when MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE was enabled in config.h
|
happen when MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE was enabled in config.h
|
||||||
(which it is by default).
|
(which it is by default).
|
||||||
|
* Fix side channel in ECC code that allowed an adversary with access to
|
||||||
|
precise enough timing and memory access information (typically an
|
||||||
|
untrusted operating system attacking a secure enclave) to fully recover
|
||||||
|
an ECDSA private key. Found and reported by Alejandro Cabrera Aldaya,
|
||||||
|
Billy Brumley and Cesar Pereida Garcia. CVE-2020-10932
|
||||||
|
* Fix a potentially remotely exploitable buffer overread in a
|
||||||
|
DTLS client when parsing the Hello Verify Request message.
|
||||||
|
|
||||||
|
Features
|
||||||
|
* The new build option MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH automatically
|
||||||
|
resizes the I/O buffers before and after handshakes, reducing the memory
|
||||||
|
consumption during application data transfer.
|
||||||
|
|
||||||
Bugfix
|
Bugfix
|
||||||
* Fix compilation failure when both MBEDTLS_SSL_PROTO_DTLS and
|
* Fix compilation failure when both MBEDTLS_SSL_PROTO_DTLS and
|
||||||
MBEDTLS_SSL_HW_RECORD_ACCEL are enabled.
|
MBEDTLS_SSL_HW_RECORD_ACCEL are enabled.
|
||||||
* Remove a spurious check in ssl_parse_client_psk_identity that triggered
|
* Remove a spurious check in ssl_parse_client_psk_identity that triggered
|
||||||
a warning with some compilers. Fix contributed by irwir in #2856.
|
a warning with some compilers. Fix contributed by irwir in #2856.
|
||||||
|
* Fix a function name in a debug message. Contributed by Ercan Ozturk in
|
||||||
|
#3013.
|
||||||
|
|
||||||
Changes
|
Changes
|
||||||
* Mbed Crypto is no longer a Git submodule. The crypto part of the library
|
* Mbed Crypto is no longer a Git submodule. The crypto part of the library
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @mainpage mbed TLS v2.21.0 source code documentation
|
* @mainpage mbed TLS v2.22.0 source code documentation
|
||||||
*
|
*
|
||||||
* This documentation describes the internal structure of mbed TLS. It was
|
* This documentation describes the internal structure of mbed TLS. It was
|
||||||
* automatically generated from specially formatted comment blocks in
|
* automatically generated from specially formatted comment blocks in
|
||||||
|
|
|
@ -28,7 +28,7 @@ DOXYFILE_ENCODING = UTF-8
|
||||||
# identify the project. Note that if you do not use Doxywizard you need
|
# identify the project. Note that if you do not use Doxywizard you need
|
||||||
# to put quotes around the project name if it contains spaces.
|
# to put quotes around the project name if it contains spaces.
|
||||||
|
|
||||||
PROJECT_NAME = "mbed TLS v2.21.0"
|
PROJECT_NAME = "mbed TLS v2.22.0"
|
||||||
|
|
||||||
# The PROJECT_NUMBER tag can be used to enter a project or revision number.
|
# The PROJECT_NUMBER tag can be used to enter a project or revision number.
|
||||||
# This could be handy for archiving the generated documentation or
|
# This could be handy for archiving the generated documentation or
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
* Major, Minor, Patchlevel
|
* Major, Minor, Patchlevel
|
||||||
*/
|
*/
|
||||||
#define MBEDTLS_VERSION_MAJOR 2
|
#define MBEDTLS_VERSION_MAJOR 2
|
||||||
#define MBEDTLS_VERSION_MINOR 21
|
#define MBEDTLS_VERSION_MINOR 22
|
||||||
#define MBEDTLS_VERSION_PATCH 0
|
#define MBEDTLS_VERSION_PATCH 0
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -47,9 +47,9 @@
|
||||||
* MMNNPP00
|
* MMNNPP00
|
||||||
* Major version | Minor version | Patch version
|
* Major version | Minor version | Patch version
|
||||||
*/
|
*/
|
||||||
#define MBEDTLS_VERSION_NUMBER 0x02150000
|
#define MBEDTLS_VERSION_NUMBER 0x02160000
|
||||||
#define MBEDTLS_VERSION_STRING "2.21.0"
|
#define MBEDTLS_VERSION_STRING "2.22.0"
|
||||||
#define MBEDTLS_VERSION_STRING_FULL "mbed TLS 2.21.0"
|
#define MBEDTLS_VERSION_STRING_FULL "mbed TLS 2.22.0"
|
||||||
|
|
||||||
#if defined(MBEDTLS_VERSION_C)
|
#if defined(MBEDTLS_VERSION_C)
|
||||||
|
|
||||||
|
|
|
@ -187,19 +187,19 @@ endif(USE_STATIC_MBEDTLS_LIBRARY)
|
||||||
if(USE_SHARED_MBEDTLS_LIBRARY)
|
if(USE_SHARED_MBEDTLS_LIBRARY)
|
||||||
|
|
||||||
add_library(mbedcrypto SHARED ${src_crypto})
|
add_library(mbedcrypto SHARED ${src_crypto})
|
||||||
set_target_properties(mbedcrypto PROPERTIES VERSION 2.21.0 SOVERSION 4)
|
set_target_properties(mbedcrypto PROPERTIES VERSION 2.22.0 SOVERSION 4)
|
||||||
target_link_libraries(mbedcrypto ${libs})
|
target_link_libraries(mbedcrypto ${libs})
|
||||||
target_include_directories(mbedcrypto
|
target_include_directories(mbedcrypto
|
||||||
PUBLIC ${MBEDTLS_DIR}/include/)
|
PUBLIC ${MBEDTLS_DIR}/include/)
|
||||||
|
|
||||||
add_library(mbedx509 SHARED ${src_x509})
|
add_library(mbedx509 SHARED ${src_x509})
|
||||||
set_target_properties(mbedx509 PROPERTIES VERSION 2.21.0 SOVERSION 1)
|
set_target_properties(mbedx509 PROPERTIES VERSION 2.22.0 SOVERSION 1)
|
||||||
target_link_libraries(mbedx509 ${libs} mbedcrypto)
|
target_link_libraries(mbedx509 ${libs} mbedcrypto)
|
||||||
target_include_directories(mbedx509
|
target_include_directories(mbedx509
|
||||||
PUBLIC ${MBEDTLS_DIR}/include/)
|
PUBLIC ${MBEDTLS_DIR}/include/)
|
||||||
|
|
||||||
add_library(mbedtls SHARED ${src_tls})
|
add_library(mbedtls SHARED ${src_tls})
|
||||||
set_target_properties(mbedtls PROPERTIES VERSION 2.21.0 SOVERSION 13)
|
set_target_properties(mbedtls PROPERTIES VERSION 2.22.0 SOVERSION 13)
|
||||||
target_link_libraries(mbedtls ${libs} mbedx509)
|
target_link_libraries(mbedtls ${libs} mbedx509)
|
||||||
target_include_directories(mbedtls
|
target_include_directories(mbedtls
|
||||||
PUBLIC ${MBEDTLS_DIR}/include/)
|
PUBLIC ${MBEDTLS_DIR}/include/)
|
||||||
|
|
|
@ -2016,6 +2016,20 @@ static int ecp_mul_comb_after_precomp( const mbedtls_ecp_group *grp,
|
||||||
|
|
||||||
final_norm:
|
final_norm:
|
||||||
#endif
|
#endif
|
||||||
|
/*
|
||||||
|
* Knowledge of the jacobian coordinates may leak the last few bits of the
|
||||||
|
* scalar [1], and since our MPI implementation isn't constant-flow,
|
||||||
|
* inversion (used for coordinate normalization) may leak the full value
|
||||||
|
* of its input via side-channels [2].
|
||||||
|
*
|
||||||
|
* [1] https://eprint.iacr.org/2003/191
|
||||||
|
* [2] https://eprint.iacr.org/2020/055
|
||||||
|
*
|
||||||
|
* Avoid the leak by randomizing coordinates before we normalize them.
|
||||||
|
*/
|
||||||
|
if( f_rng != 0 )
|
||||||
|
MBEDTLS_MPI_CHK( ecp_randomize_jac( grp, RR, f_rng, p_rng ) );
|
||||||
|
|
||||||
MBEDTLS_ECP_BUDGET( MBEDTLS_ECP_OPS_INV );
|
MBEDTLS_ECP_BUDGET( MBEDTLS_ECP_OPS_INV );
|
||||||
MBEDTLS_MPI_CHK( ecp_normalize_jac( grp, RR ) );
|
MBEDTLS_MPI_CHK( ecp_normalize_jac( grp, RR ) );
|
||||||
|
|
||||||
|
@ -2388,6 +2402,20 @@ static int ecp_mul_mxz( mbedtls_ecp_group *grp, mbedtls_ecp_point *R,
|
||||||
MBEDTLS_MPI_CHK( mbedtls_mpi_safe_cond_swap( &R->Z, &RP.Z, b ) );
|
MBEDTLS_MPI_CHK( mbedtls_mpi_safe_cond_swap( &R->Z, &RP.Z, b ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Knowledge of the projective coordinates may leak the last few bits of the
|
||||||
|
* scalar [1], and since our MPI implementation isn't constant-flow,
|
||||||
|
* inversion (used for coordinate normalization) may leak the full value
|
||||||
|
* of its input via side-channels [2].
|
||||||
|
*
|
||||||
|
* [1] https://eprint.iacr.org/2003/191
|
||||||
|
* [2] https://eprint.iacr.org/2020/055
|
||||||
|
*
|
||||||
|
* Avoid the leak by randomizing coordinates before we normalize them.
|
||||||
|
*/
|
||||||
|
if( f_rng != NULL )
|
||||||
|
MBEDTLS_MPI_CHK( ecp_randomize_mxz( grp, R, f_rng, p_rng ) );
|
||||||
|
|
||||||
MBEDTLS_MPI_CHK( ecp_normalize_mxz( grp, R ) );
|
MBEDTLS_MPI_CHK( ecp_normalize_mxz( grp, R ) );
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
|
|
|
@ -1578,6 +1578,19 @@ static int ssl_parse_hello_verify_request( mbedtls_ssl_context *ssl )
|
||||||
|
|
||||||
MBEDTLS_SSL_DEBUG_MSG( 2, ( "=> parse hello verify request" ) );
|
MBEDTLS_SSL_DEBUG_MSG( 2, ( "=> parse hello verify request" ) );
|
||||||
|
|
||||||
|
/* Check that there is enough room for:
|
||||||
|
* - 2 bytes of version
|
||||||
|
* - 1 byte of cookie_len
|
||||||
|
*/
|
||||||
|
if( mbedtls_ssl_hs_hdr_len( ssl ) + 3 > ssl->in_msglen )
|
||||||
|
{
|
||||||
|
MBEDTLS_SSL_DEBUG_MSG( 1,
|
||||||
|
( "incoming HelloVerifyRequest message is too short" ) );
|
||||||
|
mbedtls_ssl_send_alert_message( ssl, MBEDTLS_SSL_ALERT_LEVEL_FATAL,
|
||||||
|
MBEDTLS_SSL_ALERT_MSG_DECODE_ERROR );
|
||||||
|
return( MBEDTLS_ERR_SSL_BAD_HS_SERVER_HELLO );
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* struct {
|
* struct {
|
||||||
* ProtocolVersion server_version;
|
* ProtocolVersion server_version;
|
||||||
|
@ -1606,8 +1619,6 @@ static int ssl_parse_hello_verify_request( mbedtls_ssl_context *ssl )
|
||||||
}
|
}
|
||||||
|
|
||||||
cookie_len = *p++;
|
cookie_len = *p++;
|
||||||
MBEDTLS_SSL_DEBUG_BUF( 3, "cookie", p, cookie_len );
|
|
||||||
|
|
||||||
if( ( ssl->in_msg + ssl->in_msglen ) - p < cookie_len )
|
if( ( ssl->in_msg + ssl->in_msglen ) - p < cookie_len )
|
||||||
{
|
{
|
||||||
MBEDTLS_SSL_DEBUG_MSG( 1,
|
MBEDTLS_SSL_DEBUG_MSG( 1,
|
||||||
|
@ -1616,6 +1627,7 @@ static int ssl_parse_hello_verify_request( mbedtls_ssl_context *ssl )
|
||||||
MBEDTLS_SSL_ALERT_MSG_DECODE_ERROR );
|
MBEDTLS_SSL_ALERT_MSG_DECODE_ERROR );
|
||||||
return( MBEDTLS_ERR_SSL_BAD_HS_SERVER_HELLO );
|
return( MBEDTLS_ERR_SSL_BAD_HS_SERVER_HELLO );
|
||||||
}
|
}
|
||||||
|
MBEDTLS_SSL_DEBUG_BUF( 3, "cookie", p, cookie_len );
|
||||||
|
|
||||||
mbedtls_free( ssl->handshake->verify_cookie );
|
mbedtls_free( ssl->handshake->verify_cookie );
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
Check compiletime library version
|
Check compiletime library version
|
||||||
check_compiletime_version:"2.21.0"
|
check_compiletime_version:"2.22.0"
|
||||||
|
|
||||||
Check runtime library version
|
Check runtime library version
|
||||||
check_runtime_version:"2.21.0"
|
check_runtime_version:"2.22.0"
|
||||||
|
|
||||||
Check for MBEDTLS_VERSION_C
|
Check for MBEDTLS_VERSION_C
|
||||||
check_feature:"MBEDTLS_VERSION_C":0
|
check_feature:"MBEDTLS_VERSION_C":0
|
||||||
|
|
Loading…
Reference in a new issue