Skip to content

Commit 2a962b0

Browse files
authored
Merge pull request #374 from s-arash/arash/mbedtls-2.28.9
Update vendored mbedtls to v2.28.9 Updated the vendored mbedtls by running ./upgrade_vendor.sh v2.28.9.
2 parents 9b0dbdb + 068560b commit 2a962b0

File tree

178 files changed

+44393
-28685
lines changed

Some content is hidden

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

178 files changed

+44393
-28685
lines changed

Cargo.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

mbedtls-sys/Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "mbedtls-sys-auto"
3-
version = "2.28.7"
3+
version = "2.28.9"
44
authors = ["Jethro Beekman <[email protected]>"]
55
build = "build/build.rs"
66
license = "Apache-2.0 OR GPL-2.0-or-later"
@@ -15,8 +15,8 @@ links = "mbedtls"
1515

1616
[package.metadata.mbedtls]
1717
git = "https://github.com/Mbed-TLS/mbedtls.git"
18-
version = "2.28.7"
19-
rev = "555f84735aecdbd76a566cf087ec8425dfb0c8ab"
18+
version = "2.28.9"
19+
rev = "5e146adef63b326b04282252639bebc2730939c6"
2020

2121
[lib]
2222
name = "mbedtls_sys"

mbedtls-sys/vendor/.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
seedfile
33
# MBEDTLS_PSA_INJECT_ENTROPY seed file created by the test framework
44
00000000ffffff52.psa_its
5+
# Log files created by all.sh to reduce the logs in case a component runs
6+
# successfully
7+
quiet-make.*
58

69
# CMake build artifacts:
710
CMakeCache.txt

mbedtls-sys/vendor/3rdparty/CMakeLists.txt

+1-5
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,7 @@ list (APPEND thirdparty_inc_public)
44
list (APPEND thirdparty_inc)
55
list (APPEND thirdparty_def)
66

7-
execute_process(COMMAND ${MBEDTLS_PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/../scripts/config.py -f ${CMAKE_CURRENT_SOURCE_DIR}/../include/mbedtls/config.h get MBEDTLS_ECDH_VARIANT_EVEREST_ENABLED RESULT_VARIABLE result)
8-
9-
if(${result} EQUAL 0)
10-
add_subdirectory(everest)
11-
endif()
7+
add_subdirectory(everest)
128

139
set(thirdparty_src ${thirdparty_src} PARENT_SCOPE)
1410
set(thirdparty_lib ${thirdparty_lib} PARENT_SCOPE)

mbedtls-sys/vendor/BRANCHES.md

+68-34
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,33 @@
11
# Maintained branches
22

3-
At any point in time, we have a number of maintained branches consisting of:
3+
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 new features land,
10-
as well as bug fixes and security fixes.
11-
- One or more long-time support (LTS) branches:
12-
these only get bug fixes and security fixes.
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,
11+
as well as all the new features and bug fixes and security fixes.
12+
- One or more long-time support (LTS) branches: these only get bug fixes and
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).
16+
17+
We retain a number of historical branches, whose names are prefixed by `archive/`,
18+
such as [`archive/mbedtls-2.7`](https://github.com/Mbed-TLS/mbedtls/tree/archive/mbedtls-2.7).
19+
These branches will not receive any changes or updates.
1320

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

19-
Every major version will become an LTS branch when the next major version is
20-
released. We may occasionally create LTS branches from other releases at our
21-
discretion.
22-
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.
2331

2432
## Backwards Compatibility for application code
2533

@@ -30,30 +38,33 @@ modification with any later release x.y'.z' with the same major version
3038
number, and your code will still build, be secure, and work.
3139

3240
Note that this guarantee only applies if you either use the default
33-
compile-time configuration (`mbedtls/config.h`) or the same modified
41+
compile-time configuration (`mbedtls/mbedtls_config.h`) or the same modified
3442
compile-time configuration. Changing compile-time configuration options can
3543
result in an incompatible API or ABI, although features will generally not
3644
affect unrelated features (for example, enabling or disabling a
3745
cryptographic algorithm does not break code that does not use that
3846
algorithm).
3947

40-
There are rare exceptions: code that was relying on something that became
41-
insecure in the meantime (for example, crypto that was found to be weak) may
42-
need to be changed. In case security comes in conflict with backwards
43-
compatibility, we will put security first, but always attempt to provide a
44-
compatibility option.
45-
46-
For the LTS branches, additionally we try very hard to also maintain ABI
47-
compatibility (same definition as API except with re-linking instead of
48-
re-compiling) and to avoid any increase in code size or RAM usage, or in the
49-
minimum version of tools needed to build the code. The only exception, as
50-
before, is in case those goals would conflict with fixing a security issue, we
51-
will put security first but provide a compatibility option. (So far we never
52-
had to break ABI compatibility in an LTS branch, but we occasionally had to
53-
increase code size for a security fix.)
54-
55-
For contributors, see the [Backwards Compatibility section of
56-
CONTRIBUTING](CONTRIBUTING.md#backwards-compatibility).
48+
Note that new releases of Mbed TLS may extend the API. Here are some
49+
examples of changes that are common in minor releases of Mbed TLS, and are
50+
not considered API compatibility breaks:
51+
52+
* Adding or reordering fields in a structure or union.
53+
* Removing a field from a structure, unless the field is documented as public.
54+
* Adding items to an enum.
55+
* Returning an error code that was not previously documented for a function
56+
when a new error condition arises.
57+
* Changing which error code is returned in a case where multiple error
58+
conditions apply.
59+
* Changing the behavior of a function from failing to succeeding, when the
60+
change is a reasonable extension of the current behavior, i.e. the
61+
addition of a new feature.
62+
63+
There are rare exceptions where we break API compatibility: code that was
64+
relying on something that became insecure in the meantime (for example,
65+
crypto that was found to be weak) may need to be changed. In case security
66+
comes in conflict with backwards compatibility, we will put security first,
67+
but always attempt to provide a compatibility option.
5768

5869
## Backward compatibility for the key store
5970

@@ -68,14 +79,37 @@ Mbed TLS 3.x can also read keys written by Mbed TLS 2.25.0 through 2.28.x
6879
LTS, but future major version upgrades (for example from 2.28.x/3.x to 4.y)
6980
may require the use of an upgrade tool.
7081

82+
Note that this guarantee does not currently fully extend to drivers, which
83+
are an experimental feature. We intend to maintain compatibility with the
84+
basic use of drivers from Mbed TLS 2.28.0 onwards, even if driver APIs
85+
change. However, for more experimental parts of the driver interface, such
86+
as the use of driver state, we do not yet guarantee backward compatibility.
87+
88+
## Long-time support branches
89+
90+
For the LTS branches, additionally we try very hard to also maintain ABI
91+
compatibility (same definition as API except with re-linking instead of
92+
re-compiling) and to avoid any increase in code size or RAM usage, or in the
93+
minimum version of tools needed to build the code. The only exception, as
94+
before, is in case those goals would conflict with fixing a security issue, we
95+
will put security first but provide a compatibility option. (So far we never
96+
had to break ABI compatibility in an LTS branch, but we occasionally had to
97+
increase code size for a security fix.)
98+
99+
For contributors, see the [Backwards Compatibility section of
100+
CONTRIBUTING](CONTRIBUTING.md#backwards-compatibility).
101+
71102
## Current Branches
72103

73104
The following branches are currently maintained:
74105

75-
- [master](https://github.com/Mbed-TLS/mbedtls/tree/master)
106+
- [main](https://github.com/Mbed-TLS/mbedtls/tree/main)
76107
- [`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.1>.
77111
- [`mbedtls-2.28`](https://github.com/Mbed-TLS/mbedtls/tree/mbedtls-2.28)
78-
maintained until at least the end of 2024, see
79-
<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.9>.
80114

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

mbedtls-sys/vendor/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, …

mbedtls-sys/vendor/CMakeLists.txt

+5-2
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ else()
3939
project("Mbed TLS" C)
4040
endif()
4141

42+
include(GNUInstallDirs)
43+
4244
# Set the project root directory.
4345
set(MBEDTLS_DIR ${CMAKE_CURRENT_SOURCE_DIR})
4446

@@ -259,8 +261,7 @@ if(CMAKE_BUILD_TYPE STREQUAL "Coverage")
259261
endif(CMAKE_BUILD_TYPE STREQUAL "Coverage")
260262

261263
if(LIB_INSTALL_DIR)
262-
else()
263-
set(LIB_INSTALL_DIR lib)
264+
set(CMAKE_INSTALL_LIBDIR "${LIB_INSTALL_DIR}")
264265
endif()
265266

266267
if(ENABLE_ZLIB_SUPPORT)
@@ -278,6 +279,8 @@ list(APPEND libs ${thirdparty_lib})
278279

279280
add_subdirectory(library)
280281

282+
add_subdirectory(pkgconfig)
283+
281284
#
282285
# The C files in tests/src directory contain test code shared among test suites
283286
# and programs. This shared test code is compiled and linked to test suites and

mbedtls-sys/vendor/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

mbedtls-sys/vendor/ChangeLog

+76
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,81 @@
11
Mbed TLS ChangeLog (Sorted per branch, date)
22

3+
= Mbed TLS 2.28.9 branch released 2024-08-30
4+
5+
Security
6+
* Unlike previously documented, enabling MBEDTLS_PSA_HMAC_DRBG_MD_TYPE does
7+
not cause the PSA subsystem to use HMAC_DRBG: it uses HMAC_DRBG only when
8+
MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG and MBEDTLS_CTR_DRBG_C are disabled.
9+
CVE-2024-45157
10+
11+
Bugfix
12+
* Fix the build in some configurations when check_config.h is not included.
13+
Fix #9152.
14+
* Fix issue of redefinition warning messages for _GNU_SOURCE in
15+
entropy_poll.c and sha_256.c. There was a build warning during
16+
building for linux platform.
17+
Resolves #9026
18+
* Fix error handling when creating a key in a dynamic secure element
19+
(feature enabled by MBEDTLS_PSA_CRYPTO_SE_C). In a low memory condition,
20+
the creation could return PSA_SUCCESS but using or destroying the key
21+
would not work. Fixes #8537.
22+
* Fix a memory leak that could occur when failing to process an RSA
23+
key through some PSA functions due to low memory conditions.
24+
* Document and enforce the limitation of mbedtls_psa_register_se_key()
25+
to persistent keys. Resolves #9253.
26+
27+
= Mbed TLS 2.28.8 branch released 2024-03-28
28+
29+
Features
30+
* AES-NI is now supported in Windows builds with clang and clang-cl.
31+
Resolves #8372.
32+
* Add pc files for pkg-config, e.g.:
33+
pkg-config --cflags --libs (mbedtls|mbedcrypto|mbedx509)
34+
35+
Security
36+
* Passing buffers that are stored in untrusted memory as arguments
37+
to PSA functions is now secure by default.
38+
The PSA core now protects against modification of inputs or exposure
39+
of intermediate outputs during operations. This is currently implemented
40+
by copying buffers.
41+
This feature increases code size and memory usage. If buffers passed to
42+
PSA functions are owned exclusively by the PSA core for the duration of
43+
the function call (i.e. no buffer parameters are in shared memory),
44+
copying may be disabled by setting MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS.
45+
Note that setting this option will cause input-output buffer overlap to
46+
be only partially supported (#3266).
47+
Fixes CVE-2024-28960.
48+
49+
Bugfix
50+
* Fix the build with CMake when Everest is enabled through
51+
a user configuration file or the compiler command line. Fixes #8165.
52+
* Fix an inconsistency between implementations and usages of `__cpuid`,
53+
which mainly causes failures when building Windows target using
54+
mingw or clang. Fixes #8334 & #8332.
55+
* Correct initial capacities for key derivation algorithms: TLS12_PRF,
56+
TLS12_PSK_TO_MS.
57+
* Fix mbedtls_pk_get_bitlen() for RSA keys whose size is not a
58+
multiple of 8. Fixes #868.
59+
* Avoid segmentation fault caused by releasing not initialized
60+
entropy resource in gen_key example. Fixes #8809.
61+
* Fix missing bitflags in SSL session serialization headers. Their absence
62+
allowed SSL sessions saved in one configuration to be loaded in a
63+
different, incompatible configuration.
64+
* Fix the restoration of the ALPN when loading serialized connection with
65+
the mbedtls_ssl_context_load() API.
66+
* Fully support arbitrary overlap between inputs and outputs of PSA
67+
functions. Note that overlap is still only partially supported when
68+
MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS is set (#3266).
69+
70+
Changes
71+
* Use heap memory to allocate DER encoded public/private key.
72+
This reduces stack usage significantly for writing a public/private
73+
key to a PEM string.
74+
* cmake: Use GnuInstallDirs to customize install directories
75+
Replace custom LIB_INSTALL_DIR variable with standard CMAKE_INSTALL_LIBDIR
76+
variable. For backward compatibility, set CMAKE_INSTALL_LIBDIR if
77+
LIB_INSTALL_DIR is set.
78+
379
= Mbed TLS 2.28.7 branch released 2024-01-26
480

581
Security

mbedtls-sys/vendor/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ For machines with a Unix shell and OpenSSL (and optionally GnuTLS) installed, ad
190190
- `tests/scripts/depends.py` test builds in configurations with a single curve, key exchange, hash, cipher, or pkalg on.
191191
- `tests/scripts/all.sh` runs a combination of the above tests, plus some more, with various build options (such as ASan, full `config.h`, etc).
192192

193-
Instead of manually installing the required versions of all tools required for testing, it is possible to use the Docker images from our CI systems, as explained in [our testing infrastructure repository](https://github.com/Mbed-TLS/mbedtls-test/blob/master/README.md#quick-start).
193+
Instead of manually installing the required versions of all tools required for testing, it is possible to use the Docker images from our CI systems, as explained in [our testing infrastructure repository](https://github.com/Mbed-TLS/mbedtls-test/blob/main/README.md#quick-start).
194194

195195
Porting Mbed TLS
196196
----------------

0 commit comments

Comments
 (0)