Debian Codegraph @

others/mbedtls/tf-psa-crypto/ChangeLog

raw
1 = TF-PSA-Crypto 1.1.0 branch released 2026-03-31
2
3 Removals
4 * The undocumented ability to load persistent keys outside the user key ID
5 range has been removed. (This does not affect
6 MBEDTLS_PSA_CRYPTO_BUILTIN_KEYS.)
7 * The headers no longer define 'inline' as a macro. This was done on Arm
8 Compiler 5 and MSVC. The compiler versions that needed this definition are
9 no longer supported since TF-PSA-Crypto 1.0.
10
11 Features
12 * The automatic computation of MBEDTLS_PSA_STATIC_KEY_SLOT_BUFFER_SIZE has
13 been improved to take into account the following key types:
14 asymmetric keys, ciphers, AEADs, CMAC and HMAC.
15 * mbedtls_pk_write_pubkey_psa() is introduced to allow exporting the public
16 key from a PK context in a format that can easily be imported into PSA.
17 * Implement SHAKE (PSA_ALG_SHAKE128, PSA_ALG_SHAKE256).
18 * The device for reading entropy on platforms without a dedicated system
19 call can now be configured with MBEDTLS_PLATFORM_DEV_RANDOM or
20 mbedtls_platform_dev_random.
21 * Applications can use the new functions psa_random_reseed() to
22 request an immediate reseed of the PSA random generator, or
23 psa_random_deplete() to force a reseed on the next random generator call.
24 * Applications can call psa_random_set_prediction_resistance() to toggle
25 prediction resistance in the PSA random generator.
26
27 Security
28 * The default device for reading entropy on platforms without a dedicated
29 system call is now /dev/random instead of /dev/urandom. This is safer
30 on Linux in case the application runs early after the kernel boots,
31 but may block needlessly on Linux <= 5.6. Reported by supers1ngular
32 (BayLibre).
33 * Fix missing validation of the peer's key in key agreement operations using
34 PSA_ALG_FFDH: low-order elements were not rejected as they should be. This
35 is a problem for protocols using FFDH that expect contributory behaviour,
36 that is, where neither party should be able to force the shared secret
37 into a small set. Reported independently by Eva Crystal (0xiviel) and
38 + another reporter.
39 * Add tag length validation in mbedtls_ccm_finish() to prevent
40 out-of-bounds reads and mitigate potential application buffer
41 overflows where applications relied on the library to enforce
42 tag length constraints.
43 Reported by Eva Crystal (0xiviel).
44 * Fix a buffer overflow in psa_export_public_key() for FFDH keys when the
45 output buffer is too small. Found by Haruto Kimura (Stella).
46 * If an application called psa_crypto_init() then fork() and continued to
47 use cryptography APIs (possibly indirectly, e.g. for TLS), the random
48 generator states were duplicated. Fix this by forcing a RNG reseed in
49 the child process. CVE-2026-25835
50 * Applications running in environments where the application state is
51 cloned (for example due to resuming a frozen system state multiple
52 times, or due to cloning a virtual machine image) should arrange to
53 reseed the random generator using one of the new functions
54 psa_random_reseed() or psa_random_deplete(). CVE-2026-25835
55
56 Bugfix
57 * Appease GCC 14.3's array bounds checker by inserting checks in mbedtls_xor
58 that bail before the byte-at-a-time loop when the array size is a constant
59 (using MBEDTLS_HAS_BUILTIN) and an exact multiple of the larger loop size.
60 * CMake now installs headers to `CMAKE_INSTALL_INCLUDEDIR` instead of the
61 hard-coded `include` directory.
62 * Fix CMake package version that was inconsistent with the product version.
63 Fixes #553.
64 * Fix CMake failure on Windows because of a native directory separator.
65 Fixes Mbed-TLS/mbedtls#10502.
66 * Partially fix a performance regression in RSA operations introduced by a
67 security fix in 1.0, by improving the performance of RSA private key
68 operations when MBEDTLS_RSA_NO_CRT is disabled, which is the default.
69 * Fix compilation errors in `aesce.c` in some Visual Studio builds.
70 Fixes #548.
71 * Interruptible operations (ECDH key agreement, ECC key generation) were not
72 actually interruptible (always completed in one go) in builds with ECDSA
73 disabled.
74 * Built-in SHA3 was included in the build even when SHA3 had a PSA
75 accelerator. Fix this. Fixes #542.
76 * Fix a bug that caused GCM tag calculations to fail, so that data was
77 correctly encrypted but could not be authenticated. The bug was only
78 observed with GCC 10.0 to 14.2 inclusive, when compiling with -O3, and
79 running without AESNI or AESCE.
80 Fixes #665.
81 * Fix a build failure with dietlibc.
82 * Some functions in PK were using large buffers (around 2KB in the default
83 configuration) on the stack, which was a problem in environments with a
84 small stack. Those buffers are now allocated on the heap, except in
85 configurations where ECC is the only supported key type in PK, making PK
86 still independent of the heap in such configurations (if the ECC driver
87 itself is not using the heap). Fixes #476.
88
89 Changes
90 * ChaCha20 size and performance: add a Neon implementation of ChaCha20 for
91 Thumb2 and 32 and 64-bit Arm, for Armv7 onwards. At default settings,
92 this improves performance by around 2x to 2.7x on Aarch64.
93 * Add a new function, mbedtls_pk_get_key_type(), which returns the PSA
94 key type corresponding to the type of the key represented by the
95 given PK object.
96 * Running the unit tests now requires a heap (possibly from
97 MBEDTLS_MEMORY_BUFFER_ALLOC_C). They now use less stack (almost
98 5000 bytes less).
99 * Static assertions in the library (`MBEDTLS_STATIC_ASSERT`) are now
100 always enabled, using indirect methods in pre-C11 compilers. This change
101 also fixes warnings in pedantic mode with GCC or Clang on some platforms.
102 * Tweak the detection of Unix-like platforms, which makes more system
103 interfaces (timing, threading) available on Haiku, QNX and Midipix.
104 * On MinGW, always use a standard-compliant printf function family.
105 * Non-driver files have been moved out of `drivers/builtin/src` into three
106 new directories at the root of the repository:
107 - `extras`: modules implemented on top of the PSA Cryptography API, or
108 providing functionality beyond it (for example, the LMS stateful hash
109 implementation currently).
110 - `platform`: modules implementing the platform abstraction layer.
111 - `utilities`: utility modules used by the built-in drivers, the PSA
112 Cryptography API implementation, modules in `extras`, and potentially
113 by security protocols such as TLS.
114 * A new directory `dispatch` has been added at the root of the repository
115 to eventually host all code that dispatches cryptographic operations to
116 drivers, such as `psa_crypto_driver_wrappers_no_static.c`. For the time
117 being, it only contains `psa_crypto_driver_wrappers_no_static.h`.
118
119 = TF-PSA-Crypto 1.0.0 branch released 2025-10-15
120
121 API changes
122 * The experimental functions psa_generate_key_ext() and
123 psa_key_derivation_output_key_ext() have been replaced by
124 psa_generate_key_custom() and psa_key_derivation_output_key_custom().
125 They have almost exactly the same interface, but the variable-length
126 data is passed in a separate parameter instead of a flexible array
127 member. This resolves a build failure under C++ compilers that do not
128 support flexible array members (a C99 feature not adopted by C++).
129 Fixes #9020.
130 * The PSA and Mbed TLS error spaces are now unified. mbedtls_xxx()
131 functions can now return PSA_ERROR_xxx values.
132 This will not affect most applications since the error values are
133 between -32767 and -1 as before.
134 * Remove MBEDTLS_PK_RSA_ALT from the PK module.
135 * MBEDTLS_ERR_PK_SIG_LEN_MISMATCH is no longer a distinct error code.
136 A valid signature with trailing garbage is now reported as an invalid
137 signature with all algorithms.
138 * All API functions now use the PSA random generator psa_generate_random()
139 internally. As a consequence, functions no longer take RNG parameters.
140 Please refer to the migration guide at :
141 docs/4.0-migration-guide.md.
142 * Privatize the functions mbedtls_ecc_group_to_psa and
143 mbedtls_ecc_group_from_psa.
144 * Remove the functions mbedtls_ecc_group_to_psa() and
145 mbedtls_ecc_group_from_psa(), which are no longer meaningful since
146 ECC groups are no longer exposed directly in the API.
147 * mbedtls_pk_verify_ext() ignores the options parameter when an
148 MBEDTLS_PK_RSASSA_PSS context type is used. The function assumes that
149 salt length is any and that the hash algorithm used for message, encoding
150 and MGF1 is the same. An error will be returned if any of these assumptions
151 is false.
152 * Align the mbedtls_nist_kw_wrap() and mbedtls_nist_kw_unwrap() functions
153 with the PSA Crypto API. The functions mbedtls_nist_kw_wrap() and
154 mbedtls_nist_kw_unwrap() now take a PSA key identifier instead of a
155 plain-text key via a custom context.
156 * Remove mbedtls_pk_encrypt() and mbedtls_pk_decrypt(). Convert the
157 key to PSA and use the PSA functions instead, see the migration guide for
158 details.
159 * Change MBEDTLS_ERR_ECP_IN_PROGRESS to be an alias of
160 PSA_OPERATION_INCOMPLETE and MBEDTLS_ERR_RSA_VERIFY_FAILED to be an alias
161 of PSA_ERROR_INVALID_SIGNATURE.
162 * Rename mbedtls_pk_setup_opaque to mbedtls_pk_wrap_psa.
163 * The custom entropy collector callback mbedtls_hardware_poll()
164 (enabled by MBEDTLS_ENTROPY_HARDWARE_ALT) has been replaced by a
165 new callback mbedtls_platform_get_entropy() with different parameters
166 (enabled by MBEDTLS_PSA_DRIVER_GET_ENTROPY). See the new function's
167 documentation and “Custom entropy collector” in the migration guide.
168 * To build the library with only a nonvolatile seed and no actual entropy
169 source, you now need to enable the new option
170 MBEDTLS_ENTROPY_NO_SOURCES_OK.
171 * Due to the entropy configuration changes, if you write a configuration file
172 from scratch, the default entropy source MBEDTLS_PSA_BUILTIN_GET_ENTROPY
173 now needs to be enabled explicitly.
174 * The configuration options MBEDTLS_CTR_DRBG_RESEED_INTERVAL and
175 MBEDTLS_HMAC_DRBG_RESEED_INTERVAL have been replaced by a unified
176 setting of MBEDTLS_PSA_RNG_RESEED_INTERVAL.
177 * The configuration option MBEDTLS_ENTROPY_FORCE_SHA256 has been removed.
178 MBEDTLS_PSA_CRYPTO_RNG_HASH can now be used to select the entropy
179 module's hashing algorithm.
180 * The mutex functions provided by platforms where MBEDTLS_THREADING_ALT is
181 enabled have changed in minor ways:
182 - The type of mutex objects provided by the platform functions is
183 now called mbedtls_platform_mutex_t, distinct from the API type
184 mbedtls_threading_mutex_t.
185 - The mutex_init function now returns an error code.
186 - Mutex functions other than mutex_init can now assume that the mutex
187 has been successfully initialized.
188 * The Random Number Generator configuration options have been refactored.
189 The following options have been removed:
190 MBEDTLS_ENTROPY_C, MBEDTLS_ENTROPY_FORCE_SHA256,
191 MBEDTLS_ENTROPY_MAX_GATHER, MBEDTLS_ENTROPY_MAX_SOURCES,
192 MBEDTLS_CTR_DRBG_ENTROPY_LEN, MBEDTLS_CTR_DRBG_MAX_INPUT,
193 MBEDTLS_CTR_DRBG_MAX_REQUEST, MBEDTLS_CTR_DRBG_MAX_SEED_INPUT,
194 MBEDTLS_CTR_DRBG_USE_128_BIT_KEY, MBEDTLS_HMAC_DRBG_MAX_INPUT,
195 MBEDTLS_HMAC_DRBG_MAX_REQUEST, MBEDTLS_HMAC_DRBG_MAX_SEED_INPUT and
196 MBEDTLS_PSA_HMAC_DRBG_MD_TYPE.
197 The following options have been introduced:
198 MBEDTLS_PSA_CRYPTO_RNG_HASH and MBEDTLS_PSA_CRYPTO_RNG_STRENGTH.
199 See "Random number generation configuration" in the migration guide for
200 more information.
201 * The following PK interfaces are now private and should no longer be used.
202 mbedtls_pk_type_t
203 mbedtls_pk_debug_type
204 mbedtls_pk_debug_item
205 MBEDTLS_PK_DEBUG_MAX_ITEMS
206 mbedtls_pk_info_from_type()
207 mbedtls_pk_setup()
208 mbedtls_pk_get_len()
209 mbedtls_pk_can_do()
210 mbedtls_pk_can_do_ext()
211 mbedtls_pk_debug()
212 mbedtls_pk_get_name()
213 mbedtls_pk_get_type()
214 mbedtls_pk_rsa()
215 mbedtls_pk_ec()
216 mbedtls_pk_parse_subpubkey()
217 mbedtls_pk_write_pubkey()
218 mbedtls_pk_verify_new()
219 * The hmac parameter of the mbedtls_md_setup() function must now always be
220 set to 0 as HMAC is no longer supported by MD. To use HMAC, please use
221 the psa_mac_ API.
222 * Make the following error codes aliases of their PSA equivalents, where
223 xxx is a module, e.g. ASN1 or PK.
224 MBEDTLS_ERR_xxx_BAD_INPUT[_DATA] -> PSA_ERROR_INVALID_ARGUMENT
225 MBEDTLS_ERR_xxx_ALLOC_FAILED -> PSA_ERROR_INSUFFICIENT_MEMORY
226 MBEDTLS_ERR_xxx_[AUTH/VERIFY]_FAILED -> PSA_ERROR_INVALID_SIGNATURE
227 MBEDTLS_ERR_xxx_BUFFER_TOO_SMALL -> PSA_ERROR_BUFFER_TOO_SMALL
228 MBEDTLS_ERR_xxx_OUTPUT_TOO_LARGE -> PSA_ERROR_BUFFER_TOO_SMALL
229 MBEDTLS_ERR_xxx_INVALID_PADDING -> PSA_ERROR_INVALID_PADDING
230 * A PK context no longer associates specific algorithms with the key, except
231 when wrapping a PSA key. In particular, after mbedtls_pk_copy_from_psa() or
232 mbedtls_pk_copy_public_from_psa() on an RSA key, the functions
233 mbedtls_pk_get_psa_attributes(), mbedtls_pk_sign() and mbedtls_pk_verify()
234 will use PKCS#1v1.5 signature or encryption, regardless of the original
235 key's policy.
236
237 Default behavior changes
238 * In a PSA-client-only build (i.e. MBEDTLS_PSA_CRYPTO_CLIENT &&
239 !MBEDTLS_PSA_CRYPTO_C), do not automatically enable local crypto when the
240 corresponding PSA mechanism is enabled, since the server provides the
241 crypto. Fixes #9126.
242 * The PK module now always uses the PSA subsystem
243 to perform cryptographic operations, with a few exceptions documented
244 in docs/architecture/psa-migration/psa-limitations.md. This
245 corresponds to the behavior of Mbed TLS 3.x when
246 MBEDTLS_USE_PSA_CRYPTO is enabled. In effect, MBEDTLS_USE_PSA_CRYPTO
247 is now always enabled.
248 * psa_crypto_init() must be called before performing any cryptographic
249 operation, including indirect requests such as parsing a key or
250 certificate or starting a TLS handshake.
251 * The `PSA_WANT_XXX` symbols as defined in
252 tf-psa-crypto/include/psa/crypto_config.h are now always used in the
253 configuration of the cryptographic mechanisms exposed by the PSA API.
254 This corresponds to the configuration behavior of Mbed TLS 3.x when
255 MBEDTLS_PSA_CRYPTO_CONFIG is enabled. In effect, MBEDTLS_PSA_CRYPTO_CONFIG
256 is now always enabled and the configuration option has been removed.
257
258 Requirement changes
259 * Implementations of MBEDTLS_THREADING_ALT must now provide condition
260 variables in addition to mutexes.
261
262 Removals
263 * Drop support for crypto alt interface. Removes MBEDTLS_XXX_ALT options
264 at the module and function level for crypto mechanisms only. The remaining
265 alt interfaces for platform, threading and timing are unchanged.
266 Fixes #8149.
267 * Drop support for VIA Padlock. Removes MBEDTLS_PADLOCK_C.
268 Fixes #5903.
269 * Remove many MBEDTLS_ERR_xxx error codes, superseded by PSA_ERROR_xxx.
270 See the 4.0 migration guide for details.
271 * Support for dynamic secure elements (i.e. MBEDTLS_PSA_CRYPTO_SE_C) was
272 already marked as deprecated and it has been removed.
273 * Removed the MBEDTLS_PSA_INJECT_ENTROPY configuration option from
274 crypto_config.h. The functionality that this option was enabling will be
275 reintroduced as part of the work on issue #8150.
276 * MBEDTLS_NO_PLATFORM_ENTROPY and the previously deprecated
277 MBEDTLS_ENTROPY_HARDWARE_ALT are removed. See the documentation of
278 MBEDTLS_PLATFORM_GET_ENTROPY_ALT for a description on how the entropy
279 module gathers entropy data.
280 * MBEDTLS_ENTROPY_MIN_HARDWARE is also removed following the removal of
281 MBEDTLS_ENTROPY_HARDWARE_ALT.
282 * TF-PSA-Crypto does not provide an OID API. A subset of the OID
283 interfaces of Mbed TLS 3.x are now in the X.509 library in
284 Mbed TLS 4.x.
285 * Removed the MBEDTLS_SHA3_C configuration option from crypto_config.h.
286 SHA3 can now be configured with the PSA_WANT_SHA3_* options.
287 * The library no longer offers interfaces to look up values by OID
288 or OID by enum values. The compilation option MBEDTLS_OID_C no longer
289 exists. OID tables are included in the build automatically as needed.
290 OIDs that are not relevant to TF-PSA-Crypto have been removed.
291 * Remove the function mbedtls_asn1_get_mpi() from the public interface.
292 It is replaced by mbedtls_asn1_get_integer().
293 * Remove mbedtls_asn1_write_mpi() from the public API. This has been replaced
294 by mbedtls_asn1_write_integer(), which does not use the legacy mbedtls_mpi
295 type.
296 * Remove the legacy HKDF module (mbedtls_hkdf_xxx enabled by
297 MBEDTLS_HKDF_C). Use PSA instead (psa_key_derivation_xxx with
298 PSA_ALG_HKDF, enabled by PSA_WANT_ALG_HKDF).
299 * Remove mbedtls_asn1_free_named_data(). Use
300 mbedtls_asn1_free_named_data_list() or
301 mbedtls_asn1_free_named_data_list_shallow() instead.
302 * The options MBEDTLS_NO_PLATFORM_ENTROPY,
303 MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES, MBEDTLS_ENTROPY_HARDWARE_ALT and
304 MBEDTLS_ENTROPY_MIN_HARDWARE have been removed. Entropy sources are
305 now controlled by MBEDTLS_PSA_BUILTIN_GET_ENTROPY and
306 MBEDTLS_PSA_DRIVER_GET_ENTROPY. See “Entropy configuration” in the
307 migration guide for more information.
308 * MBEDTLS_PLATFORM_GET_ENTROPY_ALT, introduced in TF-PSA-Crypto 1.0.0-beta,
309 has been removed in favor of MBEDTLS_PSA_DRIVER_GET_ENTROPY.
310 * Remove the PKCS12 module, which provided the ability to read keys
311 encrypted with PKCS#5 v1.5 PBES1 with a DES-based cipher.
312 * Removed the `psa_pake_set_password_key()` function to comply
313 with the PSA API 1.2 PAKE extension.
314 * Removed the `psa_pake_get_implicit_key()` function. Removed to comply
315 with PSA API 1.2 PAKE extension.
316 * Support for EC curves secp224r1, secp224k1, secp192k1 and secp192r1 is
317 removed.
318 * mbedtls_pk_rsassa_pss_options has been removed from the interface.
319 * The configuration options MBEDTLS_MD5_C, MBEDTLS_RIPEMD160_C,
320 MBEDTLS_SHA1_C, MBEDTLS_SHA224_C, MBEDTLS_SHA256_C, MBEDTLS_SHA384_C and
321 MBEDTLS_SHA512_C have been removed. Support for hash algorithms can now
322 only be enabled through the hash-related `PSA_WANT_XXX` symbols. See
323 psa-transition.md for more information.
324
325 * The configuration options MBEDTLS_AES_C, MBEDTLS_ARIA_C,
326 MBEDTLS_CAMELLIA_C, MBEDTLS_CCM_C, MBEDTLS_CHACHA20_C,
327 MBEDTLS_CHACHAPOLY_C, MBEDTLS_CIPHER_C, MBEDTLS_CIPHER_MODE_CBC,
328 MBEDTLS_CIPHER_MODE_CFB, MBEDTLS_CIPHER_MODE_CTR, MBEDTLS_CIPHER_MODE_OFB,
329 MBEDTLS_CIPHER_MODE_XTS, MBEDTLS_CIPHER_NULL_CIPHER,
330 MBEDTLS_CIPHER_PADDING_PKCS7, MBEDTLS_CIPHER_PADDING_ONE_AND_ZEROS,
331 MBEDTLS_CIPHER_PADDING_ZEROS_AND_LEN, MBEDTLS_CIPHER_PADDING_ZEROS,
332 MBEDTLS_CMAC_C, MBEDTLS_DES_C MBEDTLS_GCM_C and MBEDTLS_POLY1305_C have
333 been removed. Support for ciphers and AEAD algorithms can now only be
334 enabled through the cipher and AEAD related `PSA_WANT_XXX` symbols. The
335 only padding mode now supported in CBC cipher mode is PKCS7. See
336 psa-transition.md for more information.
337
338 * The configuration options MBEDTLS_GENPRIME, MBEDTLS_PKCS1_V15,
339 MBEDTLS_PKCS1_V21 and MBEDTLS_RSA_C have been removed. Support for
340 RSA algorithms can now only be enabled through the RSA-related
341 `PSA_WANT_XXX` symbols. See psa-transition.md for more information.
342
343 * The configuration options MBEDTLS_ECDH_C, MBEDTLS_ECDSA_C,
344 MBEDTLS_ECDSA_DETERMINISTIC, MBEDTLS_ECJPAKE_C, MBEDTLS_ECP_C,
345 MBEDTLS_ECP_DP_BP256R1_ENABLED, MBEDTLS_ECP_DP_BP384R1_ENABLED,
346 MBEDTLS_ECP_DP_BP512R1_ENABLED, MBEDTLS_ECP_DP_CURVE25519_ENABLED,
347 MBEDTLS_ECP_DP_CURVE448_ENABLED, MBEDTLS_ECP_DP_SECP192K1_ENABLED,
348 MBEDTLS_ECP_DP_SECP192R1_ENABLED, MBEDTLS_ECP_DP_SECP224R1_ENABLED,
349 MBEDTLS_ECP_DP_SECP256K1_ENABLED, MBEDTLS_ECP_DP_SECP256R1_ENABLED,
350 MBEDTLS_ECP_DP_SECP384R1_ENABLED, MBEDTLS_ECP_DP_SECP521R1_ENABLE have
351 been removed. Support for algorithms based on elliptic curves can now
352 only be enabled through the elliptic-curve-related `PSA_WANT_XXX` symbols.
353 See psa-transition.md for more information.
354
355 * The configuration option MBEDTLS_BIGNUM_C has been removed. Support for
356 big number calculations is now enabled internally only when required by
357 enabled asymmetric cryptographic algorithms.
358 * Removed the ability to customize psa_can_do_hash() and
359 psa_can_do_cipher(), which allowed hash or cipher operations to be
360 performed through a legacy implementation when PSA is not yet fully
361 initialized.
362 * The following options have been removed as
363 they are deprecated:
364 PSA_WANT_KEY_TYPE_ECC_KEY_PAIR
365 PSA_WANT_KEY_TYPE_RSA_KEY_PAIR
366 MBEDTLS_PSA_BUILTIN_KEY_TYPE_RSA_KEY_PAIR
367 MBEDTLS_PSA_BUILTIN_KEY_TYPE_ECC_KEY_PAIR
368 MBEDTLS_PSA_ACCEL_KEY_TYPE_RSA_KEY_PAIR
369 MBEDTLS_PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR
370 MBEDTLS_SHA256_USE_A64_CRYPTO_IF_PRESENT
371 MBEDTLS_SHA256_USE_A64_CRYPTO_ONLY
372 * Deprecated PSA key handle related functions and macros are removed:
373 psa_open_key() and psa_close_key() functions, PSA_KEY_HANDLE_INIT
374 macro and psa_key_handle_t type.
375 * Deprecated PSA custom Diffie-Hellman group support functions and macros
376 are removed: psa_get_key_domain_parameters() and
377 psa_set_key_domain_parameters() functions, PSA_DH_FAMILY_CUSTOM and
378 PSA_KEY_DOMAIN_PARAMETERS_SIZE macros.
379 * The following functions have been removed from the MD module:
380 mbedtls_md_list()
381 mbedtls_md_info_from_string()
382 mbedtls_md_get_name()
383 mbedtls_md_info_from_ctx()
384 mbedtls_md_file()
385 mbedtls_md_hmac_starts()
386 mbedtls_md_hmac_update()
387 mbedtls_md_hmac_finish()
388 mbedtls_md_hmac_reset()
389 mbedtls_md_hmac()
390 To use HMAC, please use the psa_mac_ API. Looking up hash algorithms by
391 name is no longer supported.
392 * Removed DES (including 3DES)
393
394 Features
395 * Added new configuration option MBEDTLS_PSA_STATIC_KEY_SLOTS, which
396 uses static storage for keys, enabling malloc-less use of key slots.
397 The size of each buffer is given by the option
398 MBEDTLS_PSA_STATIC_KEY_SLOT_BUFFER_SIZE. By default it accommodates the
399 largest PSA key enabled in the build.
400 * Add an interruptible version of generate key to the PSA interface.
401 See psa_generate_key_iop_setup() and related functions.
402 * Add an interruptible version of key agreement to the PSA interface.
403 See psa_key_agreement_iop_setup() and related functions.
404 * Add a new psa_key_agreement() PSA API to perform key agreement and return
405 an identifier for the newly created key.
406 * When the new compilation option MBEDTLS_PSA_KEY_STORE_DYNAMIC is enabled,
407 the number of volatile PSA keys is virtually unlimited, at the expense
408 of increased code size. This option is off by default, but enabled in
409 the default mbedtls_config.h. Fixes #9216.
410 * Add an interruptible version of export public-key to the PSA interface.
411 See psa_export_public_key_iop_setup() and related functions.
412 * MD module can now perform PSA dispatching also when
413 `MBEDTLS_PSA_CRYPTO_CLIENT && !MBEDTLS_PSA_CRYPTO_C`, even though this
414 configuration is not officially supported. This requires that a
415 PSA Crypto provider library which:
416 * supports the required `PSA_WANT_ALG_xxx` and
417 * implements `psa_can_do_hash()` on the client interface
418 is linked against Mbed TLS and that `psa_crypto_init()` is called before
419 performing any PSA call.
420 * Add a program (which_aes) that uses an internal function to print out
421 the current implementation of AES, i.e. software, AESCE, AESNI assembly,
422 or AESNI intrinsics.
423 * To supply a platform-specific entropy source, define the compilation option
424 MBEDTLS_PLATFORM_GET_ENTROPY_ALT and provide the callback function
425 mbedtls_platform_get_entropy_alt(). This function should typically access
426 a TRNG ("true hardware random generator") device on bare-metal platforms,
427 or call an operating system function to obtain cryptographic-quality random
428 data. Mbed TLS requires that a minimum of 32 bytes (not configurable) are
429 returned from this function for a successful entropy gathering round.
430 * The new function mbedtls_asn1_get_integer() parses an integer into a byte
431 array. It replaces mbedtls_asn1_get_mpi().
432 * Add a new function mbedtls_asn1_write_integer() that encodes an arbitrary
433 precision integer into ASN.1 DER format. This function replaces
434 mbedtls_asn1_write_mpi(), which has been made internal-only.
435 * Introduce macros and functions for getting the current version of
436 TF-PSA-Crypto at build time and at runtime. These can be accessed
437 by including "tf-psa-crypto/version.h".
438 * Helper symbol MBEDTLS_PK_ALG_ECDSA is added to the public "mbedtls/pk.h"
439 header file. It exposes the ECDSA variant used by the PK module.
440 * The threading platform abstraction now exposes condition variables
441 in addition to mutexes.
442 * Function mbedtls_pk_can_do_psa() is added to allow testing PK context
443 capabilities against a specified algorithm and usage.
444 * Users can set the macro TF_PSA_CRYPTO_CONFIG_VERSION in the TF-PSA-Crypto
445 config file to maximize backward compatibility in case of future changes
446 to how the config file is interpreted. TF-PSA-Crypto will maintain
447 backward compatibility on functional matters (except at major version
448 changes, e.g. from 1.x.y to 2.0), but the config version may influence
449 other aspect such as optimisations, or experimental options.
450
451 Security
452 * Fix a buffer underrun in mbedtls_pk_write_key_der() when
453 called on an opaque key, MBEDTLS_USE_PSA_CRYPTO is enabled,
454 and the output buffer is smaller than the actual output.
455 Fix a related buffer underrun in mbedtls_pk_write_key_pem()
456 when called on an opaque RSA key, MBEDTLS_USE_PSA_CRYPTO is enabled
457 and MBEDTLS_MPI_MAX_SIZE is smaller than needed for a 4096-bit RSA key.
458 CVE-2024-49195
459 * Unlike previously documented, enabling MBEDTLS_PSA_HMAC_DRBG_MD_TYPE does
460 not cause the PSA subsystem to use HMAC_DRBG: it uses HMAC_DRBG only when
461 MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG and MBEDTLS_CTR_DRBG_C are disabled.
462 CVE-2024-45157
463 * Fix a stack buffer overflow in mbedtls_ecdsa_der_to_raw() and
464 mbedtls_ecdsa_raw_to_der() when the bits parameter is larger than the
465 largest supported curve. In some configurations with PSA disabled,
466 all values of bits are affected. This never happens in internal library
467 calls, but can affect applications that call these functions directly.
468 CVE-2024-45158
469 * Zeroize a temporary heap buffer used in psa_key_derivation_output_key()
470 when deriving an ECC key pair.
471 * Zeroize temporary heap buffers used in PSA operations.
472 * Fix a buffer overread in mbedtls_lms_import_public_key() when the input is
473 less than 3 bytes. Reported by Linh Le and Ngan Nguyen from Calif.
474 CVE-2025-49601
475 * Fix a vulnerability in LMS verification through which an adversary could
476 get an invalid signature accepted if they could cause a hash accelerator
477 to fail. Found and reported by Linh Le and Ngan Nguyen from Calif.
478 CVE-2025-49600
479 * On x86/amd64 platforms, with some compilers, when the library is
480 compiled with support for both AESNI and software AES and AESNI is
481 available in hardware, an adversary with fine control over which
482 threads make progress in a multithreaded program could force software
483 AES to be used for some time when the program starts. This could allow
484 the adversary to conduct timing attacks and potentially recover the
485 key. In particular, this attacker model may be possible against an SGX
486 enclave.
487 The same vulnerability affects GCM acceleration, which could allow
488 a similarly powerful adversary to craft GCM forgeries.
489 CVE-2025-52496
490 * Fix a bug in mbedtls_asn1_store_named_data() where it would sometimes leave
491 an item in the output list in an inconsistent state with val.p == NULL but
492 val.len > 0. Functions using the structure after that, including
493 mbedtls_asn1_store_named_data() itself would then dereference a NULL
494 pointer. Applications that do not call this function are not affected.
495 Found by Linh Le and Ngan Nguyen from Calif.
496 CVE-2025-48965
497 * Fix an integer underflow that could occur when parsing malformed PEM
498 keys, which could be used by an attacker capable of feeding encrypted
499 PEM keys to a user. This could cause a crash or information disclosure.
500 Found and reported by Linh Le and Ngan Nguyen from Calif.
501 CVE-2025-52497
502 * Fix a timing side channel in the implementation of PKCS#7 padding
503 which would allow an attacker who can request decryption of arbitrary
504 ciphertexts to recover the plaintext through a timing oracle attack.
505 Reported by Ka Lok Wu from Stony Brook University and Doria Tang from
506 The Chinese University of Hong Kong.
507 CVE-2025-49087
508 * Fix a timing side channel in CBC-PKCS7 decryption that could
509 allow an attacker who can submit chosen ciphertexts to recover
510 some plaintexts through a timing-based padding oracle attack.
511 Credits to Beat Heeb from Oberon microsystems AG. CVE-2025-59438
512 * Fix a local timing side-channel in modular inversion and GCD that was
513 exploitable in RSA key generation and other RSA operations (see the full
514 advisory for details), allowing a local attacker to fully recover the
515 private key. This can be exploited on some Arm-v9 CPUs by an unprivileged
516 attacker running code on the same core (SSBleed), or when Trustzone-M is
517 used, by the non-secure side abusing timer interrupts (M-Step), and
518 probably in other similar settings as well. Found and reported
519 independently by: SSBleed: Chang Liu (Tsinghua University) and Trevor E.
520 Carlson (National University of Singapore); M-Step: Cristiano Rodrigues
521 (University of Minho), Marton Bognar (DistriNet, KU Leuven), Sandro Pinto
522 (University of Minho), Jo Van Bulck (DistriNet, KU Leuven). CVE-2025-54764
523
524 Bugfix
525 * MBEDTLS_ASN1_PARSE_C and MBEDTLS_ASN1_WRITE_C are now automatically enabled
526 as soon as MBEDTLS_RSA_C is enabled. Fixes #9041.
527 * Fix interference between PSA volatile keys and built-in keys
528 when MBEDTLS_PSA_CRYPTO_BUILTIN_KEYS is enabled and
529 MBEDTLS_PSA_KEY_SLOT_COUNT is more than 4096.
530 * Fix missing constraints on the AES-NI inline assembly which is used on
531 GCC-like compilers when building AES for generic x86_64 targets. This
532 may have resulted in incorrect code with some compilers, depending on
533 optimizations. Fixes #9819.
534 * Fix rare concurrent access bug where attempting to operate on a
535 non-existent key while concurrently creating a new key could potentially
536 corrupt the key store.
537 * Fix invalid JSON schemas for driver descriptions used by
538 generate_driver_wrappers.py.
539 * Fix the build when MBEDTLS_PSA_CRYPTO_CONFIG is enabled and the built-in
540 CMAC is enabled, but no built-in unauthenticated cipher is enabled.
541 Fixes #9209.
542 * Fix issue of redefinition warning messages for _GNU_SOURCE in
543 entropy_poll.c and sha_256.c. There was a build warning during
544 building for linux platform.
545 Resolves #9026
546 * Fix unintended performance regression when using short RSA public keys.
547 Fixes #9232.
548 * Fix error handling when creating a key in a dynamic secure element
549 (feature enabled by MBEDTLS_PSA_CRYPTO_SE_C). In a low memory condition,
550 the creation could return PSA_SUCCESS but using or destroying the key
551 would not work. Fixes #8537.
552 * Fix redefinition warnings when SECP192R1 and/or SECP192K1 are disabled.
553 Fixes #9029.
554 * Fix undefined behaviour (incrementing a NULL pointer by zero length) when
555 passing in zero length additional data to multipart AEAD.
556 * Document and enforce the limitation of mbedtls_psa_register_se_key()
557 to persistent keys. Resolves #9253.
558 * Fix a memory leak that could occur when failing to process an RSA
559 key through some PSA functions due to low memory conditions.
560 * Fix a compilation warning in pk.c when PSA is enabled and RSA is disabled.
561 * Fix psa_cipher_decrypt() with CCM* rejecting messages less than 3 bytes
562 long. Credit to Cryptofuzz. Fixes #9314.
563 * Fix undefined behavior in some cases when mbedtls_psa_raw_to_der() or
564 mbedtls_psa_der_to_raw() is called with bits=0.
565 * When MBEDTLS_PSA_CRYPTO_C was disabled and MBEDTLS_ECDSA_C enabled,
566 some code was defining 0-size arrays, resulting in compilation errors.
567 Fixed by disabling the offending code in configurations without PSA
568 Crypto, where it never worked. Fixes #9311.
569 * Remove Everest Visual Studio 2010 compatibility headers, which could
570 shadow standard CRT headers inttypes.h and stdbool.h with incomplete
571 implementatios if placed on the include path.
572 * Fix issue where psa_key_derivation_input_integer() is not detecting
573 bad state after an operation has been aborted.
574 * Fix failures of PSA multipart or interruptible operations when the
575 library or the application is built with a compiler where
576 "union foo x = {0}" does not initialize non-default members of the
577 union, such as GCC 15 and some versions of Clang 18. This affected MAC
578 multipart operations, MAC-based key derivation operations, interruptible
579 signature, interruptible verification, and potentially other operations
580 when using third-party drivers. This also affected one-shot MAC
581 operations using the built-in implementation. Fixes #9814.
582 * On entry to PSA driver entry points that set up a multipart operation
583 ("xxx_setup"), the operation object is supposed to be all-bits-zero.
584 This was sometimes not the case when an operation object is reused,
585 or with compilers where "union foo x = {0}" does not initialize
586 non-default members of the union. The PSA core now ensures that this
587 guarantee is met in all cases. Fixes #9975.
588 * Resolved build issue with C++ projects using TF-PSA-Crypto when compiling
589 with the MSVC toolset v142 and earlier. Fixes mbedtls issue #7087.
590 * Silence spurious -Wunterminated-string-initialization warnings introduced
591 by GCC 15. Fixes #9944.
592 * Fix a sloppy check in LMS public key import, which could lead to accepting
593 keys with a different LMS or LM-OTS types on some platforms. Specifically,
594 this could happen on platforms where enum types are smaller than 32 bits
595 and compiler optimization is enabled. Found and reported by Linh Le and
596 Ngan Nguyen from Calif.
597 * Fix a race condition on x86/amd64 platforms in AESNI support detection
598 that could lead to using software AES in some threads at the very
599 beginning of a multithreaded program. Reported by Solar Designer.
600 Fixes #9840.
601 * Fix mbedtls_base64_decode() on inputs that did not have the correct
602 number of trailing equal signs, or had 4*k+1 digits. They were accepted
603 as long as they had at most two trailing equal signs. They are now
604 rejected. Furthermore, before, on inputs with too few equal signs, the
605 function reported the correct size in *olen when it returned
606 MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL, but truncated the output to the
607 last multiple of 3 bytes.
608 * When calling mbedtls_asn1_write_raw_buffer() with NULL, 0 as the last two
609 arguments, undefined behaviour would be triggered, in the form of a call to
610 memcpy(..., NULL, 0). This was harmless in practice, but could trigger
611 complains from sanitizers or static analyzers.
612 * Fix occasional CMake parallel build failure when building both the
613 static and shared tfpsacrypto libraries. Fixes #286.
614 * PAKE returns PSA_ERROR_INVALID_SIGNATURE instead of PSA_ERROR_DATA_INVALID
615 when the signature in Schnorr NIZKP is invalid.
616
617 Changes
618 * Cryptography and platform configuration options have been migrated
619 from the Mbed TLS library configuration file mbedtls_config.h to
620 crypto_config.h that is now the TF-PSA-Crypto configuration file.
621 The reference and test custom configuration files respectively in
622 configs/ and tests/configs/ have been updated accordingly.
623 To migrate custom Mbed TLS configurations where
624 MBEDTLS_PSA_CRYPTO_CONFIG is disabled, you should first adapt them
625 to the PSA configuration scheme based on PSA_WANT_XXX symbols
626 (see psa-conditional-inclusion-c.md for more information).
627 To migrate custom Mbed TLS configurations where
628 MBEDTLS_PSA_CRYPTO_CONFIG is enabled, you should migrate the
629 cryptographic and platform configuration options from mbedtls_config.h
630 to crypto_config.h (see the 4.0 configuration guide at
631 docs/4.0-migration-guide/configuration.md which includes
632 configuration details and examples).
633 * Improve performance of PSA key generation with ECC keys: it no longer
634 computes the public key (which was immediately discarded). Fixes #9732.
635 * Make the file p256-m.h internal, it is no longer installed or documented.
636 * Added the `key_confirmation` field to the PAKE cipher suite to conform to
637 PSA API 1.2 PAKE extension
638 * Added the `psa_pake_cs_get_key_confirmation()` function which retrieves
639 the value from a cipher suite, the `psa_pake_cs_set_key_confirmation()`
640 function which declares the value for a cipher suite
641 * Now the functionality of `psa_pake_set_password_key()` is implemented in
642 `psa_pake_setup()` function, as per the PSA API 1.2 PAKE extension.
643 * Changed the `PSA_ALG_JPAKE` macro to accommodate the hash algorithm
644 parameter, to be conformant to the PSA API 1.2 PAKE extension
645 * Added the `PSA_ALG_IS_JPAKE` macro to test whether a given algorithm is
646 JPAKE
647 * All tf-psa-crypto private headers were moved to a private subdirectory
648 * Implemented the `psa_pake_get_shared_key()` function, compliant with the
649 PSA API 1.2 PAKE extension, replacement for `psa_pake_get_implicit_key()`
650
651 = Mbed TLS 3.6.0 branch released 2024-03-28
652 Please refer to the Mbed TLS changelog, available at
653 https://github.com/Mbed-TLS/mbedtls/blob/mbedtls-3.6.0/ChangeLog