Repository navigation
crypto/mbedtls: upgrade Mbed TLS to 3.6.5 - #4130
Open
ThePassionate wants to merge 1 commit into
Open
ThePassionate wants to merge 1 commit into
ThePassionate wants to merge 1 commit into
Conversation
Bump the build-time fetched Mbed TLS version from 3.6.2 to 3.6.5, a patch-level update on the 3.6 LTS branch. The public headers the alt layer implements (aes.h, cmac.h, sha*.h, ...) are unchanged between the two releases, and the three carry-in patches still apply on 3.6.5 (0003 with a 36-line offset). Along the bump: - crypto/controlse: track the new version in the MBEDTLS_VERSION dependency, in lockstep with the 3.4.0 -> 3.6.2 upgrade. - Expose MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED in Kconfig: the mbedtls_config.h mapping already existed but there was no way to enable it. - Expose MBEDTLS_SSL_KEYING_MATERIAL_EXPORT, new in 3.6.4, giving access to mbedtls_ssl_export_keying_material() (RFC 5705 / RFC 8446 section 7.5), and map it in mbedtls_config.h. Note for TLS client users: since 3.6.3 a client with MBEDTLS_SSL_VERIFY_REQUIRED that never calls mbedtls_ssl_set_hostname() fails the handshake with MBEDTLS_ERR_SSL_CERTIFICATE_VERIFICATION_WITHOUT_HOSTNAME (follow-up to CVE-2025-27809). Set the hostname, or define MBEDTLS_SSL_CLI_ALLOW_WEAK_CERTIFICATE_VERIFICATION_WITHOUT_HOSTNAME to restore the previous behavior. Notable fixes carried by 3.6.3 -> 3.6.5: CBC-PKCS7 padding timing side channels (CVE-2025-49087, CVE-2025-59438), modular inversion timing (CVE-2025-54764), LMS import/verify (CVE-2025-49600, CVE-2025-49601), x509 name parsing use-after-free (CVE-2025-47917), PEM integer underflow (CVE-2025-52497), reassembly of fragmented TLS handshake messages, and mbedtls_mpi_gcd() now always returns a non-negative result. Signed-off-by: makejian <makejian@xiaomi.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Bump the fetched Mbed TLS version from 3.6.2 to 3.6.5 (the
CONFIG_MBEDTLS_VERSIONdefault and the controlse dependency), and carry the two Kconfig entries the version brings:MBEDTLS_SSL_KEYING_MATERIAL_EXPORT(new API in 3.6.4) andMBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED(the mapping existed but was unreachable).3.6.3 to 3.6.5 are bugfix releases with no API break on the side NuttX consumes: the alternate layer headers are byte-identical between 3.6.2 and 3.6.5, and the wrapper's
MBEDTLS_PRIVATEsites are unaffected (the cipher padding rework of CVE-2025-59438 keeps thembedtls_cipher_finish()semantics). Notable behavior change recorded in the commit message: since 3.6.3, a TLS client without a hostname plusVERIFY_REQUIREDfails the handshake (follow-up to CVE-2025-27809); the recovery macro exists upstream and is left off, matching Vela.Impact
Default version bump only; boards that pin the version explicitly (e.g. esp32s3-devkit:mbedtls at 3.6.4) are unaffected. The three carry-in patches under
crypto/mbedtls/apply to 3.6.5 unchanged (0003 with a 36-line offset, handled automatically).Testing
Built from a fresh checkout state (distclean + refetch) with sim:nsh +
CONFIG_CRYPTO_MBEDTLS+CONFIG_OPENSSL_MBEDTLS_WRAPPER+ the cmocka test config: 0 warnings, 0 errors. The sim crypto regression (aescbc, des3cbc, aesctr, aesxts, chacha20, chachapoly, hmac) and the PKCS12 test (2/2) produce output byte-identical to the 3.6.2 baseline. Note for local verification: re-extracting the archive over an old build keeps the zip's internal timestamps, which hides the header change from make - a distclean is needed to see the new version actually rebuild.