7122 Commits

Author SHA1 Message Date
Gilles Peskine
d558c59371
Merge pull request #1636 from mpg/restricted-rsa-padding-3.6
[3.6] Fix side-channel in PSA_ALG_RSA_PKCS1V15_CRYPT
2026-06-24 09:34:57 +02:00
Gilles Peskine
13020769a4
Merge pull request #1675 from valeriosetti/issue1598-backport3.6
[3.6] PKCS7 accepts weak hashes
2026-06-23 16:40:40 +02:00
Gilles Peskine
a2ede7033f
Merge pull request #1637 from bjwtaylor/chacha20-counter-overflow-restricted-3.6
Chacha20 counter overflow restricted 3.6
2026-06-22 12:49:53 +02:00
Valerio Setti
16415a66b4 pkcs7: do not mention PK algorithms in the documentation
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-06-22 11:55:14 +02:00
Valerio Setti
f3a69ab32a pkcs7: improve documentation and changelog for MBEDTLS_PKCS7_ALLOW_WEAK_SIGNATURES
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-06-22 11:55:14 +02:00
Valerio Setti
745fe11c86 pkcs7: mention MBEDTLS_PKCS7_ALLOW_WEAK_SIGNATURES in pkcs7.h documentation
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-06-22 11:55:14 +02:00
Valerio Setti
544721407e pkcs7: add MBEDTLS_PKCS7_ALLOW_WEAK_SIGNATURES build symbol
It allows weak hash algorithms to be used in PKCS7. It's only added in the
LTS branch for backward compatibility, but it's disabled by default because
that's the safest choice.

This commit also updates test data in order to test the new build symbol.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-06-22 11:55:14 +02:00
Valerio Setti
fecdad9b0c pkcs7: update documentation adding a note about rejecting weak hash algs
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-06-22 11:49:45 +02:00
Manuel Pégourié-Gonnard
7e51c31aef rsa/psa: tune doc about RSA v1.5 decrypt usage
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2026-06-08 11:39:44 +02:00
Ben Taylor
a6023aef67 update code docs
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-03 11:10:36 +01:00
Ben Taylor
2ddd6a2f25 Improve comments and guards
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-02 13:50:32 +01:00
Manuel Pégourié-Gonnard
ea0a2c6d03 rsa/psa/pk: warn more against PKCS#1 v1.5 decrypt
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2026-06-02 11:10:06 +02:00
Ben Taylor
dcf3b11749 Tidy ChaCha20 counter limit handling
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-05-29 13:17:36 +01:00
Ben Taylor
56b050d738 Add use of keystream_bytes_used as the exhausted marker
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-05-29 13:17:00 +01:00
Ben Taylor
609b1c51b1 Add fix for chacha20 counter overflow bug
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-05-29 13:16:53 +01:00
Ronald Cron
14ff18114f
Merge pull request #1635 from valeriosetti/issue1569-backport-3.6
[backport 3.6] TLS 1.3 certificate chain signature algorithm policy gap
2026-05-29 13:34:52 +02:00
Valerio Setti
4620095cdd ssl: improve documentation of mbedtls_ssl_conf_sig_algs()
Clarify that the 'sig_algs' set through this function are only enforced
during the key exchange and that 'mbedtls_ssl_conf_cert_profile()' should
instead be used to enforce the same algorithms when verifying certificates.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-05-28 13:19:14 +02:00
Manuel Pégourié-Gonnard
1e3c1db81c ecp: rm obsolete doc about alt implementations
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2026-05-20 12:01:49 +02:00
Manuel Pégourié-Gonnard
0f8a09a99c ecp: clarify static constants in grp
This is not really necessary for 1.0+, but for the 3.6 branch where the
structure and these constants are still public, it is cleaner.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2026-05-18 10:45:11 +02:00
Manuel Pégourié-Gonnard
0ebb3a9ff0 ecp: take advantage of new modp functions
The old functions only guaranteed an output in the range [-a * P, b * P]
for a and b "small enough".

The new functions have a stricter contract, allowing the final reduction
to be done efficiently in constant time.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2026-05-18 10:45:11 +02:00
Gilles Peskine
30f9444cd0 Merge remote-tracking branch 'mbedtls-3.6' into mbedtls-3.6-restricted 2026-05-06 22:40:58 +02:00
Manuel Pégourié-Gonnard
df13f5cd52 ECDH: document sufficient size for shared secret
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2026-03-31 12:00:59 +02:00
Minos Galanakis
3cfe12bf11 Bump version
./scripts/bump_version.sh --version 3.6.6

Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-03-26 21:48:57 +00:00
Ronald Cron
e7c9b1dfb3 Reduce duplication between save/load documentations
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2026-03-26 13:18:10 +01:00
Ronald Cron
dd20b0644a Add warning in mbedtls_ssl_session_load/save documentation
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2026-03-26 13:18:10 +01:00
Ronald Cron
6712bd07b3 Add warning in mbedtls_ssl_context_save/load documentation
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2026-03-26 13:18:10 +01:00
Ronald Cron
707c8c34ec Merge remote-tracking branch 'mbedtls-restricted/mbedtls-3.6-release-sync' into 'mbedtls-restricted/mbedtls-3.6-restricted' 2026-03-23 12:08:25 +01:00
Manuel Pégourié-Gonnard
b48ddb3f4e
Merge pull request #1485 from gilles-peskine-arm/dev-random-config-3.6
Backport 3.6: Use /dev/random and make it configurable
2026-03-17 10:54:46 +01:00
Gilles Peskine
03fafd2637 Update a statement about the default value (now /dev/random)
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-03-16 14:02:47 +01:00
Gilles Peskine
d05d789316 grammar
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-03-15 19:53:48 +01:00
Gilles Peskine
e6efd3e406 Match macro definition order with order in mbedtls_entropy_init
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-03-15 19:52:16 +01:00
Gilles Peskine
909055d760 Fix negation that broke psa_random_set_prediction_resistance
Platform entropy is available when `MBEDTLS_NO_PLATFORM_ENTROPY` is _not_
defined.

This caused the ok/not-supported behavior of `broke
psa_random_set_prediction_resistance() to be inverted, and the unit tests
checking that behavior to be similarly inverted, so the unit tests didn't
catch it.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-03-15 19:32:39 +01:00
Manuel Pégourié-Gonnard
e24f1e5c2c
Merge pull request #10609 from mpg/pk-psa-large-stack-buffers
[3.6] PK: avoid large stack buffers in "to/from PSA" functions
2026-03-13 08:53:48 +00:00
Gilles Peskine
9d17d28dda More documentation improvements
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-03-12 12:39:16 +01:00
Gilles Peskine
f05a711011 Minor documentation improvements
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-03-11 12:58:22 +01:00
Gilles Peskine
43afaa5343 Fix Doxygen warning in realfull config
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-03-11 12:21:18 +01:00
Gilles Peskine
d8ce52df19 Fix Doxygen comment start
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-03-11 10:48:58 +01:00
Gilles Peskine
409427eac4 Fix grammar
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-03-11 10:31:59 +01:00
Ronald Cron
828e3817ac
Merge pull request #10623 from ronald-cron-arm/dtls-client-hello-defragmentation-3.6
Backport 3.6: Add support for (D)TLS 1.2 client hello defragmentation
2026-03-10 14:46:41 +00:00
Gilles Peskine
855e10c108
Merge pull request #10068 from gilles-peskine-arm/pk-0e-prototype-3.6
Minor documentation fixes in pk.h
2026-03-09 13:57:34 +00:00
Gilles Peskine
de1a7f2fbb Remove documentation about fork protection
It's coming, but not here yet.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-03-04 17:54:56 +01:00
Gilles Peskine
a863415205 New API psa_random_set_prediction_resistance()
Let applications configure prediction resistance at runtime.

Prediction resistance is always considered disabled when there is no actual
entropy source, only a nonvolatile seed.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-03-04 17:54:56 +01:00
Gilles Peskine
5093f08415 New API psa_random_deplete(): force a reseed on the next RNG query
In some scenarios, application or integration code knows that the random
generator should be reseeded, but the reseed cannot or must not happen
immediately and there is no way to report errors. In such scenarios, users
can call the new function `psa_random_deplete()`, which just marks the DRBG
as needing a reseed.

This change requires DRBG modules to treat `reseed_counter == reseed_interval`
as a condition that requires a reseed. Historically they reseeded when
`reseed_counter > reseed_interval`, but that made it impossible to require
a reseed when `reseed_interval == MAX_INT`. Note that this edge case is not
tested.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-03-04 17:54:56 +01:00
Gilles Peskine
bd57d52490 DRBG: make reseed_counter not be off by 1
Change `reseed_counter` to be the number of requests made since the last
reseed, rather than this number minus 1. Thus, reseed when
`reseed_counter >= reseed_interval` rather than
`reseed_counter > reseed_interval`. The field `reseed_counter` is private so
this is not an API change.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-03-04 17:54:56 +01:00
Gilles Peskine
ccfb7357a3 New function psa_random_reseed()
Explicit reseed of the PSA random generator.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-03-04 17:54:56 +01:00
Gilles Peskine
2a92659034 Define derived config macros for entropy sources
Define `MBEDTLS_ENTROPY_TRUE_SOURCES` and `MBEDTLS_ENTROPY_HAVE_SOURCES`
similarly to TF-PSA-Crypto 1.0. Also define
`MBEDTLS_ENTROPY_HAVE_TRUE_SOURCES` for test function dependencies.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-03-04 17:54:56 +01:00
Gilles Peskine
3f8f4a0c3f Improve advice
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-02-27 20:45:48 +01:00
Gilles Peskine
6f63121a00 Change the default from /dev/urandom to /dev/random
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-02-27 20:37:28 +01:00
Gilles Peskine
409baa7b7b Document /dev/random vs /dev/urandom on Linux
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-02-25 22:43:19 +01:00
Gilles Peskine
8f962c1b22 Add MBEDTLS_PLATFORM_DEV_RANDOM as a compile-time option
Document when this is not used. This was the case in TF-PSA-Crypto 1.0.0,
but not yet in Mbed TLS 3.6.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-02-25 22:43:19 +01:00