CBL-8182: Upgrade mbedTLS to 3.6.6#2487
Merged
Merged
Conversation
Also includes: Windows threading abstraction for mbedTLS (#2435) 1. Cmake will now use config.py to switch PTHREAD for ALT in the mbedTLS threading implementation (ifdef causes python errors) 2. Add a static instance that will set up the threading model (mbedThreading.cc) 3. Add a threading_alt.h header that CMake will copy into mbedTLS's include directory so that the downstream library can find it 4. Bump mbedTLS submodule to get rid of header ifdef
|
This is a release branch and commits are restricted. Please confirm this PR is one of the following:
|
|
Code Coverage Results:
|
There was a problem hiding this comment.
Pull request overview
Upgrades the vendored mbedTLS dependency to 3.6.6 and updates the Windows build to use mbedTLS’s alternate threading abstraction (ALT) via a CMake-time configuration step and a Windows CRITICAL_SECTION-based mutex implementation.
Changes:
- Bump mbedTLS version in the Black Duck manifest to 3.6.6.
- Update Windows CMake configure step to switch mbedTLS threading from PTHREAD to ALT and copy
threading_alt.hinto the mbedTLS include tree. - Add Windows-specific
threading_alt.hand a static initializer (mbedThreading.cc) that wires mbedTLS threading callbacks toCRITICAL_SECTION.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| jenkins/couchbase-lite-core-black-duck-manifest.yaml | Updates the recorded mbedTLS component version to 3.6.6. |
| cmake/platform_win.cmake | Adds Windows configure-time mbedTLS threading configuration and copies the ALT header into vendor includes. |
| MSVC/threading_alt.h | Introduces the Windows ALT mutex type definition for mbedTLS. |
| MSVC/mbedThreading.cc | Registers Windows mutex init/free/lock/unlock callbacks with mbedTLS at startup. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+41
to
+42
| file(COPY ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/../MSVC/threading_alt.h | ||
| DESTINATION ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/../vendor/mbedtls/include/mbedtls) |
Comment on lines
+33
to
+37
| #endif //_WIN32 | ||
|
|
||
| #ifdef __cplusplus | ||
| } | ||
| #endif |
Comment on lines
+1
to
+5
| #include "threading_alt.h" | ||
| #include "mbedtls/threading.h" | ||
|
|
||
| #if defined(_WIN32) && defined(MBEDTLS_THREADING_ALT) | ||
|
|
Comment on lines
+35
to
+40
| WORKING_DIRECTORY "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/.." | ||
| ) | ||
| execute_process( | ||
| COMMAND "${Python3_EXECUTABLE}" "${_mbedtls_config_py}" set MBEDTLS_THREADING_ALT | ||
| WORKING_DIRECTORY "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/.." | ||
| ) |
pasin
approved these changes
May 2, 2026
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.
Also includes:
Windows threading abstraction for mbedTLS (#2435)