7131 Commits

Author SHA1 Message Date
Gilles Peskine
154a78c78b
Merge pull request #10912 from yiwu0b11/cmake-config-3.6
[Backport 3.6] Cmake custom compile-time config support
2026-09-01 14:43:32 +00:00
David Horstmann
8d692f375d
Merge pull request #10850 from AaryanCdry/fix/sha3-docs-olen
Backport 3.6: Fix inconsistent docs for mbedtls_sha3_finish and mbedtls_sha3 olen
2026-08-27 16:13:00 +00:00
Yi Wu
51a8076902 CMake improvements: relocatable, transformation, and more test
Signed-off-by: Yi Wu <yi.wu2@arm.com>
2026-08-20 09:10:41 +01:00
AaryanCdry
874f087502 Fix inconsistent docs for mbedtls_sha3_finish and mbedtls_sha3 olen
Change the documentation of mbedtls_sha3_finish() and mbedtls_sha3()
to state that olen must be at least the digest size (28, 32, 48, or 64
for SHA3-224/256/384/512) rather than must equal it.

The implementation accepts olen larger than the digest size — it
silently writes the digest and ignores the excess. The previous docs
incorrectly suggested that olen larger than the digest size would be
an error.

Fixes #10844

Signed-off-by: AaryanCdry <AaryanCdry@users.noreply.github.com>
2026-08-01 00:57:03 +00:00
Valerio Setti
090c8842a7 include: ssl: add a typedef for unused data in mbedtls_ssl_config and mbedtls_ssl_context
Add mbedtls_ssl_unused_data_t type instead of embedding the union inside
both structures.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-07-29 11:36:27 +02:00
Ben Taylor
191b8cb03a Correct code style
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
(cherry picked from commit ef8c07b36af416958079e8f783e14c5330a27791)
2026-07-21 10:22:24 +01:00
Ben Taylor
aacb344f31 Add parentheses to unsafe macros
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>

This is a manual backport, not a direct cherry-pick, because the 3.6 branch uses different file paths and keeps a direct PSA_ALG_JPAKE comparison in the PAKE size macros.

(cherry picked from commit ebda5da117af7e57bad47bc3337e364365a8f357)
2026-07-21 10:21:43 +01:00
Minos Galanakis
b767964cef Bump version --version 3.6.7
./scripts/bump_version.sh --version 3.6.7

Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-06-26 15:32:38 +01:00
Valerio Setti
a60a318f63 include: ssl: fix documentation of mbedtls_ssl_set_cid
Specify that the configured CID will apply to all subsequent handshakes
not just to the next one.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-06-25 14:01:15 +02:00
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