Skip to content

Commit bff88ab

Browse files
authored
Merge pull request #874 from ARMmbed/mbedtls-3.1.0_merge_into_release
Mbedtls 3.1.0 merge into release
2 parents ba57427 + 77d778e commit bff88ab

Some content is hidden

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

52 files changed

+358
-254
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ if(NOT DISABLE_PACKAGE_CONFIG_AND_INSTALL)
344344
write_basic_package_version_file(
345345
"cmake/MbedTLSConfigVersion.cmake"
346346
COMPATIBILITY SameMajorVersion
347-
VERSION 3.0.0)
347+
VERSION 3.1.0)
348348

349349
install(
350350
FILES "${CMAKE_CURRENT_BINARY_DIR}/cmake/MbedTLSConfig.cmake"

ChangeLog

Lines changed: 179 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,184 @@
11
mbed TLS ChangeLog (Sorted per branch, date)
22

3+
= mbed TLS 3.1.0 branch released 2021-12-17
4+
5+
API changes
6+
* New error code for GCM: MBEDTLS_ERR_GCM_BUFFER_TOO_SMALL.
7+
Alternative GCM implementations are expected to verify
8+
the length of the provided output buffers and to return the
9+
MBEDTLS_ERR_GCM_BUFFER_TOO_SMALL in case the buffer length is too small.
10+
* You can configure groups for a TLS key exchange with the new function
11+
mbedtls_ssl_conf_groups(). It extends mbedtls_ssl_conf_curves().
12+
* Declare a number of structure fields as public: the fields of
13+
mbedtls_ecp_curve_info, the fields describing the result of ASN.1 and
14+
X.509 parsing, and finally the field fd of mbedtls_net_context on
15+
POSIX/Unix-like platforms.
16+
17+
Requirement changes
18+
* Sign-magnitude and one's complement representations for signed integers are
19+
not supported. Two's complement is the only supported representation.
20+
21+
New deprecations
22+
* Deprecate mbedtls_ssl_conf_curves() in favor of the more generic
23+
mbedtls_ssl_conf_groups().
24+
25+
Removals
26+
* Remove the partial support for running unit tests via Greentea on Mbed OS,
27+
which had been unmaintained since 2018.
28+
29+
Features
30+
* Enable support for Curve448 via the PSA API. Contributed by
31+
Archana Madhavan in #4626. Fixes #3399 and #4249.
32+
* The identifier of the CID TLS extension can be configured by defining
33+
MBEDTLS_TLS_EXT_CID at compile time.
34+
* Implement the PSA multipart AEAD interface, currently supporting
35+
ChaChaPoly and GCM.
36+
* Warn if errors from certain functions are ignored. This is currently
37+
supported on GCC-like compilers and on MSVC and can be configured through
38+
the macro MBEDTLS_CHECK_RETURN. The warnings are always enabled
39+
(where supported) for critical functions where ignoring the return
40+
value is almost always a bug. Enable the new configuration option
41+
MBEDTLS_CHECK_RETURN_WARNING to get warnings for other functions. This
42+
is currently implemented in the AES, DES and md modules, and will be
43+
extended to other modules in the future.
44+
* Add missing PSA macros declared by PSA Crypto API 1.0.0:
45+
PSA_ALG_IS_SIGN_HASH, PSA_ALG_NONE, PSA_HASH_BLOCK_LENGTH, PSA_KEY_ID_NULL.
46+
* Add support for CCM*-no-tag cipher to the PSA.
47+
Currently only 13-byte long IV's are supported.
48+
For decryption a minimum of 16-byte long input is expected.
49+
These restrictions may be subject to change.
50+
* Add new API mbedtls_ct_memcmp for constant time buffer comparison.
51+
* Add functions to get the IV and block size from cipher_info structs.
52+
* Add functions to check if a cipher supports variable IV or key size.
53+
* Add the internal implementation of and support for CCM to the PSA multipart
54+
AEAD interface.
55+
* Mbed TLS provides a minimum viable implementation of the TLS 1.3
56+
protocol. See docs/architecture/tls13-support.md for the definition of
57+
the TLS 1.3 Minimum Viable Product (MVP). The MBEDTLS_SSL_PROTO_TLS1_3
58+
configuration option controls the enablement of the support. The APIs
59+
mbedtls_ssl_conf_min_version() and mbedtls_ssl_conf_max_version() allow
60+
to select the 1.3 version of the protocol to establish a TLS connection.
61+
* Add PSA API definition for ARIA.
62+
63+
Security
64+
* Zeroize several intermediate variables used to calculate the expected
65+
value when verifying a MAC or AEAD tag. This hardens the library in
66+
case the value leaks through a memory disclosure vulnerability. For
67+
example, a memory disclosure vulnerability could have allowed a
68+
man-in-the-middle to inject fake ciphertext into a DTLS connection.
69+
* In psa_aead_generate_nonce(), do not read back from the output buffer.
70+
This fixes a potential policy bypass or decryption oracle vulnerability
71+
if the output buffer is in memory that is shared with an untrusted
72+
application.
73+
* In psa_cipher_generate_iv() and psa_cipher_encrypt(), do not read back
74+
from the output buffer. This fixes a potential policy bypass or decryption
75+
oracle vulnerability if the output buffer is in memory that is shared with
76+
an untrusted application.
77+
* Fix a double-free that happened after mbedtls_ssl_set_session() or
78+
mbedtls_ssl_get_session() failed with MBEDTLS_ERR_SSL_ALLOC_FAILED
79+
(out of memory). After that, calling mbedtls_ssl_session_free()
80+
and mbedtls_ssl_free() would cause an internal session buffer to
81+
be free()'d twice.
82+
83+
Bugfix
84+
* Stop using reserved identifiers as local variables. Fixes #4630.
85+
* The GNU makefiles invoke python3 in preference to python except on Windows.
86+
The check was accidentally not performed when cross-compiling for Windows
87+
on Linux. Fix this. Fixes #4774.
88+
* Prevent divide by zero if either of PSA_CIPHER_ENCRYPT_OUTPUT_SIZE() or
89+
PSA_CIPHER_UPDATE_OUTPUT_SIZE() were called using an asymmetric key type.
90+
* Fix a parameter set but unused in psa_crypto_cipher.c. Fixes #4935.
91+
* Don't use the obsolete header path sys/fcntl.h in unit tests.
92+
These header files cause compilation errors in musl.
93+
Fixes #4969.
94+
* Fix missing constraints on x86_64 and aarch64 assembly code
95+
for bignum multiplication that broke some bignum operations with
96+
(at least) Clang 12.
97+
Fixes #4116, #4786, #4917, #4962.
98+
* Fix mbedtls_cipher_crypt: AES-ECB when MBEDTLS_USE_PSA_CRYPTO is enabled.
99+
* Failures of alternative implementations of AES or DES single-block
100+
functions enabled with MBEDTLS_AES_ENCRYPT_ALT, MBEDTLS_AES_DECRYPT_ALT,
101+
MBEDTLS_DES_CRYPT_ECB_ALT or MBEDTLS_DES3_CRYPT_ECB_ALT were ignored.
102+
This does not concern the implementation provided with Mbed TLS,
103+
where this function cannot fail, or full-module replacements with
104+
MBEDTLS_AES_ALT or MBEDTLS_DES_ALT. Reported by Armelle Duboc in #1092.
105+
* Some failures of HMAC operations were ignored. These failures could only
106+
happen with an alternative implementation of the underlying hash module.
107+
* Fix the error returned by psa_generate_key() for a public key. Fixes #4551.
108+
* Fix compile-time or run-time errors in PSA
109+
AEAD functions when ChachaPoly is disabled. Fixes #5065.
110+
* Remove PSA'a AEAD finish/verify output buffer limitation for GCM.
111+
The requirement of minimum 15 bytes for output buffer in
112+
psa_aead_finish() and psa_aead_verify() does not apply to the built-in
113+
implementation of GCM.
114+
* Move GCM's update output buffer length verification from PSA AEAD to
115+
the built-in implementation of the GCM.
116+
The requirement for output buffer size to be equal or greater then
117+
input buffer size is valid only for the built-in implementation of GCM.
118+
Alternative GCM implementations can process whole blocks only.
119+
* Fix the build of sample programs when neither MBEDTLS_ERROR_C nor
120+
MBEDTLS_ERROR_STRERROR_DUMMY is enabled.
121+
* Fix PSA_ALG_RSA_PSS verification accepting an arbitrary salt length.
122+
This algorithm now accepts only the same salt length for verification
123+
that it produces when signing, as documented. Use the new algorithm
124+
PSA_ALG_RSA_PSS_ANY_SALT to accept any salt length. Fixes #4946.
125+
* The existing predicate macro name PSA_ALG_IS_HASH_AND_SIGN is now reserved
126+
for algorithm values that fully encode the hashing step, as per the PSA
127+
Crypto API specification. This excludes PSA_ALG_RSA_PKCS1V15_SIGN_RAW and
128+
PSA_ALG_ECDSA_ANY. The new predicate macro PSA_ALG_IS_SIGN_HASH covers
129+
all algorithms that can be used with psa_{sign,verify}_hash(), including
130+
these two.
131+
* Fix issue in Makefile on Linux with SHARED=1, that caused shared libraries
132+
not to list other shared libraries they need.
133+
* Fix a bug in mbedtls_gcm_starts() when the bit length of the iv
134+
exceeds 2^32. Fixes #4884.
135+
* Fix an uninitialized variable warning in test_suite_ssl.function with GCC
136+
version 11.
137+
* Fix the build when no SHA2 module is included. Fixes #4930.
138+
* Fix the build when only the bignum module is included. Fixes #4929.
139+
* Fix a potential invalid pointer dereference and infinite loop bugs in
140+
pkcs12 functions when the password is empty. Fix the documentation to
141+
better describe the inputs to these functions and their possible values.
142+
Fixes #5136.
143+
* The key usage flags PSA_KEY_USAGE_SIGN_MESSAGE now allows the MAC
144+
operations psa_mac_compute() and psa_mac_sign_setup().
145+
* The key usage flags PSA_KEY_USAGE_VERIFY_MESSAGE now allows the MAC
146+
operations psa_mac_verify() and psa_mac_verify_setup().
147+
148+
Changes
149+
* Explicitly mark the fields mbedtls_ssl_session.exported and
150+
mbedtls_ssl_config.respect_cli_pref as private. This was an
151+
oversight during the run-up to the release of Mbed TLS 3.0.
152+
The fields were never intended to be public.
153+
* Implement multi-part CCM API.
154+
The multi-part functions: mbedtls_ccm_starts(), mbedtls_ccm_set_lengths(),
155+
mbedtls_ccm_update_ad(), mbedtls_ccm_update(), mbedtls_ccm_finish()
156+
were introduced in mbedTLS 3.0 release, however their implementation was
157+
postponed until now.
158+
Implemented functions support chunked data input for both CCM and CCM*
159+
algorithms.
160+
* Remove MBEDTLS_SSL_EXPORT_KEYS, making it always on and increasing the
161+
code size by about 80B on an M0 build. This option only gated an ability
162+
to set a callback, but was deemed unnecessary as it was yet another define
163+
to remember when writing tests, or test configurations. Fixes #4653.
164+
* Improve the performance of base64 constant-flow code. The result is still
165+
slower than the original non-constant-flow implementation, but much faster
166+
than the previous constant-flow implementation. Fixes #4814.
167+
* Ignore plaintext/ciphertext lengths for CCM*-no-tag operations.
168+
For CCM* encryption/decryption without authentication, input
169+
length will be ignored.
170+
* Indicate in the error returned if the nonce length used with
171+
ChaCha20-Poly1305 is invalid, and not just unsupported.
172+
* The mbedcrypto library includes a new source code module constant_time.c,
173+
containing various functions meant to resist timing side channel attacks.
174+
This module does not have a separate configuration option, and functions
175+
from this module will be included in the build as required. Currently
176+
most of the interface of this module is private and may change at any
177+
time.
178+
* The generated configuration-independent files are now automatically
179+
generated by the CMake build system on Unix-like systems. This is not
180+
yet supported when cross-compiling.
181+
3182
= Mbed TLS 3.0.0 branch released 2021-07-07
4183

5184
API changes

ChangeLog.d/add_psa_m_aead.txt

Lines changed: 0 additions & 3 deletions
This file was deleted.

ChangeLog.d/add_psa_m_aead_ccm.txt

Lines changed: 0 additions & 3 deletions
This file was deleted.

ChangeLog.d/additional_cipher_info_getters.txt

Lines changed: 0 additions & 3 deletions
This file was deleted.

ChangeLog.d/base64-ranges.txt

Lines changed: 0 additions & 4 deletions
This file was deleted.

ChangeLog.d/bugfix-for-gcm-long-iv-size.txt

Lines changed: 0 additions & 4 deletions
This file was deleted.

ChangeLog.d/build-without-sha.txt

Lines changed: 0 additions & 3 deletions
This file was deleted.

ChangeLog.d/ccm_star_no_tag.txt

Lines changed: 0 additions & 10 deletions
This file was deleted.

ChangeLog.d/chacha20-poly1305-invalid-nonce.txt

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)