Skip to content

Commit b5ac64f

Browse files
committed
Merge tag 'mbedtls-3.6.0' into bump_to_3.6.0
Mbed TLS 3.6.0
2 parents 463656e + 2ca6c28 commit b5ac64f

File tree

504 files changed

+48880
-21173
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

504 files changed

+48880
-21173
lines changed

.github/pull_request_template.md

+7
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,10 @@ Please tick as appropriate and edit the reasons (e.g.: "backport: not needed bec
1818

1919
Please refer to the [contributing guidelines](https://github.com/Mbed-TLS/mbedtls/blob/development/CONTRIBUTING.md), especially the
2020
checklist for PR contributors.
21+
22+
Help make review efficient:
23+
* Multiple simple commits
24+
- please structure your PR into a series of small commits, each of which does one thing
25+
* Avoid force-push
26+
- please do not force-push to update your PR - just add new commit(s)
27+
* See our [Guidelines for Contributors](https://mbed-tls.readthedocs.io/en/latest/reviews/review-for-contributors/) for more details about the review process.

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -63,5 +63,7 @@ massif-*
6363
/cscope*.out
6464
/tags
6565

66-
# Clangd compilation database
66+
# clangd compilation database
6767
compile_commands.json
68+
# clangd index files
69+
/.cache/clangd/index/

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "framework"]
2+
path = framework
3+
url = https://github.com/Mbed-TLS/mbedtls-framework

.readthedocs.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
# Required
66
version: 2
77

8+
# Include the framework submodule in the build
9+
submodules:
10+
include:
11+
- framework
12+
813
# Set the version of Python and other tools you might need
914
build:
1015
os: ubuntu-20.04

3rdparty/Makefile.inc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
THIRDPARTY_DIR = $(dir $(word 2, $(MAKEFILE_LIST)))
1+
THIRDPARTY_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
22
include $(THIRDPARTY_DIR)/everest/Makefile.inc
33
include $(THIRDPARTY_DIR)/p256-m/Makefile.inc

3rdparty/everest/Makefile.inc

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
THIRDPARTY_INCLUDES+=-I../3rdparty/everest/include -I../3rdparty/everest/include/everest -I../3rdparty/everest/include/everest/kremlib
1+
THIRDPARTY_INCLUDES+=-I$(THIRDPARTY_DIR)/everest/include -I$(THIRDPARTY_DIR)/everest/include/everest -I$(THIRDPARTY_DIR)/everest/include/everest/kremlib
22

33
THIRDPARTY_CRYPTO_OBJECTS+= \
4-
../3rdparty/everest/library/everest.o \
5-
../3rdparty/everest/library/x25519.o \
6-
../3rdparty/everest/library/Hacl_Curve25519_joined.o
4+
$(THIRDPARTY_DIR)/everest/library/everest.o \
5+
$(THIRDPARTY_DIR)/everest/library/x25519.o \
6+
$(THIRDPARTY_DIR)/everest/library/Hacl_Curve25519_joined.o

3rdparty/p256-m/Makefile.inc

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
THIRDPARTY_INCLUDES+=-I../3rdparty/p256-m/p256-m/include -I../3rdparty/p256-m/p256-m/include/p256-m -I../3rdparty/p256-m/p256-m_driver_interface
1+
THIRDPARTY_INCLUDES+=-I$(THIRDPARTY_DIR)/p256-m/p256-m/include -I$(THIRDPARTY_DIR)/p256-m/p256-m/include/p256-m -I$(THIRDPARTY_DIR)/p256-m/p256-m_driver_interface
22

33
THIRDPARTY_CRYPTO_OBJECTS+= \
4-
../3rdparty/p256-m//p256-m_driver_entrypoints.o \
5-
../3rdparty/p256-m//p256-m/p256-m.o
4+
$(THIRDPARTY_DIR)/p256-m//p256-m_driver_entrypoints.o \
5+
$(THIRDPARTY_DIR)/p256-m//p256-m/p256-m.o

BRANCHES.md

+17-13
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,32 @@
22

33
At any point in time, we have a number of maintained branches, currently consisting of:
44

5-
- The [`master`](https://github.com/Mbed-TLS/mbedtls/tree/master) branch:
5+
- The [`main`](https://github.com/Mbed-TLS/mbedtls/tree/main) branch:
66
this always contains the latest release, including all publicly available
77
security fixes.
88
- The [`development`](https://github.com/Mbed-TLS/mbedtls/tree/development) branch:
9-
this is where the current major version of Mbed TLS (version 3.x) is being
10-
prepared. It has API changes that make it incompatible with Mbed TLS 2.x,
9+
this is where the next major version of Mbed TLS (version 4.0) is being
10+
prepared. It has API changes that make it incompatible with Mbed TLS 3.x,
1111
as well as all the new features and bug fixes and security fixes.
1212
- One or more long-time support (LTS) branches: these only get bug fixes and
13-
security fixes. Currently, the only supported LTS branch is:
14-
[`mbedtls-2.28`](https://github.com/Mbed-TLS/mbedtls/tree/mbedtls-2.28).
13+
security fixes. Currently, the supported LTS branches are:
14+
- [`mbedtls-2.28`](https://github.com/Mbed-TLS/mbedtls/tree/mbedtls-2.28).
15+
- [`mbedtls-3.6`](https://github.com/Mbed-TLS/mbedtls/tree/mbedtls-3.6).
1516

1617
We retain a number of historical branches, whose names are prefixed by `archive/`,
1718
such as [`archive/mbedtls-2.7`](https://github.com/Mbed-TLS/mbedtls/tree/archive/mbedtls-2.7).
1819
These branches will not receive any changes or updates.
1920

2021
We use [Semantic Versioning](https://semver.org/). In particular, we maintain
21-
API compatibility in the `master` branch across minor version changes (e.g.
22+
API compatibility in the `main` branch across minor version changes (e.g.
2223
the API of 3.(x+1) is backward compatible with 3.x). We only break API
2324
compatibility on major version changes (e.g. from 3.x to 4.0). We also maintain
2425
ABI compatibility within LTS branches; see the next section for details.
2526

26-
Every major version will become an LTS branch when the next major version is
27-
released. We may occasionally create LTS branches from other releases at our
28-
discretion.
29-
When a new LTS branch is created, it usually remains supported for three years.
27+
We will make regular LTS releases on an 18-month cycle, each of which will have
28+
a 3 year support lifetime. On this basis, 3.6 LTS (released March 2024) will be
29+
supported until March 2027. The next LTS release will be a 4.x release, which is
30+
planned for September 2025.
3031

3132
## Backwards Compatibility for application code
3233

@@ -102,10 +103,13 @@ CONTRIBUTING](CONTRIBUTING.md#backwards-compatibility).
102103

103104
The following branches are currently maintained:
104105

105-
- [master](https://github.com/Mbed-TLS/mbedtls/tree/master)
106+
- [main](https://github.com/Mbed-TLS/mbedtls/tree/main)
106107
- [`development`](https://github.com/Mbed-TLS/mbedtls/)
108+
- [`mbedtls-3.6`](https://github.com/Mbed-TLS/mbedtls/tree/mbedtls-3.6)
109+
maintained until March 2027, see
110+
<https://github.com/Mbed-TLS/mbedtls/releases/tag/v3.6.0>.
107111
- [`mbedtls-2.28`](https://github.com/Mbed-TLS/mbedtls/tree/mbedtls-2.28)
108-
maintained until at least the end of 2024, see
109-
<https://github.com/Mbed-TLS/mbedtls/releases/tag/v2.28.7>.
112+
maintained until the end of 2024, see
113+
<https://github.com/Mbed-TLS/mbedtls/releases/tag/v2.28.8>.
110114

111115
Users are urged to always use the latest version of a maintained branch.

BUGS.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Known issues in Mbed TLS are [tracked on GitHub](https://github.com/Mbed-TLS/mbe
77
If you think you've found a bug in Mbed TLS, please follow these steps:
88

99
1. Make sure you're using the latest version of a
10-
[maintained branch](BRANCHES.md): `master`, `development`,
10+
[maintained branch](BRANCHES.md): `main`, `development`,
1111
or a long-time support branch.
1212
2. Check [GitHub](https://github.com/Mbed-TLS/mbedtls/issues) to see if
1313
your issue has already been reported. If not, …

CMakeLists.txt

+28-4
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,15 @@ cmake_policy(SET CMP0011 NEW)
3434
cmake_policy(SET CMP0012 NEW)
3535

3636
if(TEST_CPP)
37-
project("Mbed TLS" LANGUAGES C CXX)
37+
project("Mbed TLS"
38+
LANGUAGES C CXX
39+
VERSION 3.6.0
40+
)
3841
else()
39-
project("Mbed TLS" LANGUAGES C)
42+
project("Mbed TLS"
43+
LANGUAGES C
44+
VERSION 3.6.0
45+
)
4046
endif()
4147

4248
include(GNUInstallDirs)
@@ -114,10 +120,15 @@ if(MBEDTLS_PYTHON_EXECUTABLE)
114120

115121
endif()
116122

123+
# We now potentially need to link all executables against PThreads, if available
124+
set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
125+
set(THREADS_PREFER_PTHREAD_FLAG TRUE)
126+
find_package(Threads)
127+
117128
# If this is the root project add longer list of available CMAKE_BUILD_TYPE values
118129
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
119130
set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE}
120-
CACHE STRING "Choose the type of build: None Debug Release Coverage ASan ASanDbg MemSan MemSanDbg Check CheckFull"
131+
CACHE STRING "Choose the type of build: None Debug Release Coverage ASan ASanDbg MemSan MemSanDbg Check CheckFull TSan TSanDbg"
121132
FORCE)
122133
endif()
123134

@@ -212,6 +223,8 @@ if(CMAKE_COMPILER_IS_GNU)
212223
set(CMAKE_C_FLAGS_COVERAGE "-O0 -g3 --coverage")
213224
set(CMAKE_C_FLAGS_ASAN "-fsanitize=address -fno-common -fsanitize=undefined -fno-sanitize-recover=all -O3")
214225
set(CMAKE_C_FLAGS_ASANDBG "-fsanitize=address -fno-common -fsanitize=undefined -fno-sanitize-recover=all -O1 -g3 -fno-omit-frame-pointer -fno-optimize-sibling-calls")
226+
set(CMAKE_C_FLAGS_TSAN "-fsanitize=thread -O3")
227+
set(CMAKE_C_FLAGS_TSANDBG "-fsanitize=thread -O1 -g3 -fno-omit-frame-pointer -fno-optimize-sibling-calls")
215228
set(CMAKE_C_FLAGS_CHECK "-Os")
216229
set(CMAKE_C_FLAGS_CHECKFULL "${CMAKE_C_FLAGS_CHECK} -Wcast-qual")
217230
endif(CMAKE_COMPILER_IS_GNU)
@@ -225,6 +238,8 @@ if(CMAKE_COMPILER_IS_CLANG)
225238
set(CMAKE_C_FLAGS_ASANDBG "-fsanitize=address -fno-common -fsanitize=undefined -fno-sanitize-recover=all -O1 -g3 -fno-omit-frame-pointer -fno-optimize-sibling-calls")
226239
set(CMAKE_C_FLAGS_MEMSAN "-fsanitize=memory -O3")
227240
set(CMAKE_C_FLAGS_MEMSANDBG "-fsanitize=memory -O1 -g3 -fno-omit-frame-pointer -fno-optimize-sibling-calls -fsanitize-memory-track-origins=2")
241+
set(CMAKE_C_FLAGS_TSAN "-fsanitize=thread -O3")
242+
set(CMAKE_C_FLAGS_TSANDBG "-fsanitize=thread -O1 -g3 -fno-omit-frame-pointer -fno-optimize-sibling-calls")
228243
set(CMAKE_C_FLAGS_CHECK "-Os")
229244
endif(CMAKE_COMPILER_IS_CLANG)
230245

@@ -268,12 +283,19 @@ if(LIB_INSTALL_DIR)
268283
set(CMAKE_INSTALL_LIBDIR "${LIB_INSTALL_DIR}")
269284
endif()
270285

286+
if (NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/framework/CMakeLists.txt")
287+
message(FATAL_ERROR "${CMAKE_CURRENT_SOURCE_DIR}/framework/CMakeLists.txt not found. Run `git submodule update --init` from the source tree to fetch the submodule contents.")
288+
endif()
289+
add_subdirectory(framework)
290+
271291
add_subdirectory(include)
272292

273293
add_subdirectory(3rdparty)
274294

275295
add_subdirectory(library)
276296

297+
add_subdirectory(pkgconfig)
298+
277299
#
278300
# The C files in tests/src directory contain test code shared among test suites
279301
# and programs. This shared test code is compiled and linked to test suites and
@@ -297,6 +319,8 @@ if(ENABLE_TESTING OR ENABLE_PROGRAMS)
297319
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tests/include
298320
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include
299321
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/library)
322+
# Request C11, needed for memory poisoning tests
323+
set_target_properties(mbedtls_test PROPERTIES C_STANDARD 11)
300324

301325
file(GLOB MBEDTLS_TEST_HELPER_FILES
302326
${CMAKE_CURRENT_SOURCE_DIR}/tests/src/test_helpers/*.c)
@@ -377,7 +401,7 @@ if(NOT DISABLE_PACKAGE_CONFIG_AND_INSTALL)
377401
write_basic_package_version_file(
378402
"cmake/MbedTLSConfigVersion.cmake"
379403
COMPATIBILITY SameMajorVersion
380-
VERSION 3.5.2)
404+
VERSION 3.6.0)
381405

382406
install(
383407
FILES "${CMAKE_CURRENT_BINARY_DIR}/cmake/MbedTLSConfig.cmake"

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ License and Copyright
8686

8787
Unless specifically indicated otherwise in a file, Mbed TLS files are provided under a dual [Apache-2.0](https://spdx.org/licenses/Apache-2.0.html) OR [GPL-2.0-or-later](https://spdx.org/licenses/GPL-2.0-or-later.html) license. See the [LICENSE](LICENSE) file for the full text of these licenses. This means that users may choose which of these licenses they take the code under.
8888

89-
Contributors must accept that their contributions are made under both the Apache-2.0 AND [GPL-2.0-or-later](https://spdx.org/licenses/GPL-2.0-or-later.html) licenses. This enables LTS (Long Term Support) branches of the software to be provided under either the Apache-2.0 or GPL-2.0-or-later licenses.
89+
Contributors must accept that their contributions are made under both the Apache-2.0 AND [GPL-2.0-or-later](https://spdx.org/licenses/GPL-2.0-or-later.html) licenses.
9090

9191
All new files should include the standard SPDX license identifier where possible, i.e. "SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later".
9292

0 commit comments

Comments
 (0)