33126 Commits

Author SHA1 Message Date
Naveed
6cffad7e1b rework handshake length checks per review
ClientHello: narrow the session-id check to the session id itself, check
the cookie length byte before reading it, and let the ciphersuite-list
length check cover both transports.

CertificateRequest: make the signature-algorithms check also reserve the
two certificate-authorities length bytes instead of adding a separate
check, use the available < needed pattern throughout, and reject an
odd-length signature-algorithms list.

Add injected truncated-ClientHello test cases (TLS 1.2-only builds).

Signed-off-by: Naveed <naveed@bugqore.com>
2026-08-24 21:58:01 +05:30
Naveed
94d46cdb00 bound two-byte length reads in tls 1.2 handshake parsing
Signed-off-by: Naveed <naveed@bugqore.com>
2026-08-24 21:58:01 +05:30
Gilles Peskine
70058ce4b6
Merge pull request #10845 from gilles-peskine-arm/issue1585-backport3.6-visualc
[3.6 only] Test mbedtls_ssl_session_reset()
2026-08-20 16:01:14 +00:00
Valerio Setti
35bc09db98
Merge pull request #10853 from nvxbug/tls12-session-id-bounds-3.6
Backport 3.6: Reject out-of-bounds session ID length in ssl_tls12_session_load
2026-08-03 14:24:00 +00:00
Naveed
61a2877a8e Force sentinel session ID length in serialized-load test
Signed-off-by: Naveed <naveed@bugqore.com>
2026-08-03 13:45:52 +05:30
Naveed
b6d607d310 Reject out-of-bounds session ID length in ssl_tls12_session_load
Signed-off-by: Naveed <naveed@bugqore.com>
2026-08-03 13:45:52 +05:30
Gilles Peskine
6be594ffca Expose tests/src/test_helpers
Make SSL test helper code potentially available to sample programs. This is
notably useful for `ssl_client2` and `ssl_server2`, which may reasonably use
some test helper code even in the default configuration.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-07-29 11:36:43 +02:00
Gilles Peskine
a16f9fa503 Use a list for test source directories
No change to the output except some reordering of elements in a list.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-07-29 11:36:43 +02:00
Manuel Pégourié-Gonnard
7902021aeb Move context verifier to a better place
In terms of CMake, we want it to be part of the mbedtls_test_helpers
object collection, which as the name does not suggest, is actually for
SSL, and not part of mbedtls_test which is generic.

The easiest way to achieve that is to move the source file to
test_helpers which again as the name does not reflect is for SSL.

Then we just need ssl_server2 and ssl_client2 to link to
mbedtls_test_helpers.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2026-07-29 11:36:43 +02:00
Valerio Setti
41ada48936 tests: generate_ssl_session_reset_check: adjust rules for 3.6 branch
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-07-29 11:36:43 +02:00
Valerio Setti
9c2ef6a4da tests: ssl_helpers: run ssl_context reset check only when the SSL context is setup
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-07-29 11:36:43 +02:00
Valerio Setti
2c35acc231 tests: generate_ssl_session_reset_check: remove trailing whitespace
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-07-29 11:36:27 +02:00
Valerio Setti
eb9fd86745 tests: generate_ssl_session_reset_check: pacify pylint
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-07-29 11:36:27 +02:00
Valerio Setti
96423d43d0 tests: generate_ssl_session_reset_check: order rules as fields in the struct
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-07-29 11:36:27 +02:00
Valerio Setti
778a0546a5 tests: ssl_helpers: fix documentation of mbedtls_test_ssl_check_context_after_session_reset
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-07-29 11:36:27 +02:00
Valerio Setti
40f82abadb tests: ssl_context_reset_verifier: add missing semicolon in generated file
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-07-29 11:36:27 +02:00
Valerio Setti
d36dedc033 tests: generate_ssl_session_reset_check: add missing semicolon in generated file
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-07-29 11:36:27 +02:00
Valerio Setti
c2568cb96b tests|programs: call check_context_after_session_reset whenever mbedtls_ssl_session_reset
Call mbedtls_test_ssl_check_context_after_session_reset both in programs
(ssl_client2 and ssl_server2) and tests to ensure that the SSL context
has been properly handled when mbedtls_ssl_session_reset was called.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-07-29 11:36:27 +02:00
Valerio Setti
0568836744 tests: add prototype and implementation of mbedtls_test_ssl_check_context_after_session_reset
Ideally the implementation shouldn't be checked in git, but for the time
being there is no support in building source code for tests from the
binary folder, so it's accepted as a temporary solution.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-07-29 11:36:27 +02:00
Valerio Setti
066f0f98a8 tests: scripts: add generate_ssl_session_reset_check.py
Togethere with the framework counterpart ('ssl_session_reset_check.py')
this script is used to automatically generate the function
'mbedtls_test_ssl_check_context_after_session_reset()'.
The goal of this function is to verify that 'mbedtls_ssl_session_reset()'
properly handled (reset or keep) all the fields of the
'mbedtls_ssl_context' structure.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-07-29 11:36:27 +02:00
Valerio Setti
b4eb39217b tests: ssl: split ssl_helpers between public and internal functions
Move functions in "ssl_helpers.h" that depend on internal headers to
"ssl_helpers_internal.h". This allows to include "ssl_helpers.h" also
in programs (which do not have access to internal headers).

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-07-29 11:36:27 +02: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
Valerio Setti
f4a1aceb8c
Merge pull request #10805 from bjwtaylor/unsafe-macros-3.6
Backport 3.6: Unsafe macros
2026-07-27 15:49:59 +00: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
d76aeff750 Remove surplus parentheses
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>

This is a manual backport, not a direct cherry-pick, because the 3.6 PAKE macros retain a direct PSA_ALG_JPAKE comparison where the source branch adjusted a PSA_ALG_IS_JPAKE call.

(cherry picked from commit 733ed07f29144ee9b99165e36eaf9b9b69317834)
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
Ronald Cron
8572c4a99b
Merge pull request #10815 from Mbed-TLS/mbedtls-3.6.7_mergeback
Mbedtls 3.6.7 mergeback
2026-07-08 13:15:28 +00:00
Minos Galanakis
451c1b12a2 Updated framework pointer
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-07-08 10:48:23 +01:00
Minos Galanakis
d5b20d4a1e Revert "Added generated files"
This reverts commit 3b42ba863ee7cd0bcd14bb57156af0961f8febd9.

Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-07-07 17:26:50 +01:00
Minos Galanakis
ab18cc38f1 Merge tag 'mbedtls-3.6.7' into mbedtls-3.6.7_mergeback-2
Mbed TLS mbedtls-3.6.7

Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-07-07 17:25:52 +01:00
Minos Galanakis
068ff080b3 ChangeLog: Removed CVE-ID
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
v3.6.7 mbedtls-3.6.7
2026-07-01 12:03:41 +01:00
Valerio Setti
52beeef988
Merge pull request #10657 from bjwtaylor/unused-variable-ret-3.6
Backport 3.6: Fix variable set but not used warning
2026-07-01 08:26:39 +00:00
David Horstmann
a065f0b0db
Merge pull request #10731 from AmyChan-Intel/mbedtls-3.6
library/alignment.h: Fix 'MBEDTLS_GCC_VERSION' is not defined error
2026-06-30 09:34:49 +00:00
Minos Galanakis
fb50b4cd1b ChangeLog: Removed todo placeholder for CVE
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-06-29 18:35:23 +01:00
Minos Galanakis
3b42ba863e Added generated files
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-06-26 21:18:01 +01:00
Minos Galanakis
2901266764 Update BRANCHES.md
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-06-26 21:18:01 +01:00
Minos Galanakis
71c6e06676 Assemble ChangeLog
./framework/scripts/assemble_changelog.py

Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-06-26 21:18:01 +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
Minos Galanakis
ea1cb6d14f Updated framework submodule
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-06-26 15:21:14 +01:00
Minos Galanakis
4476f02593 Merge remote-tracking branch 'restricted/mbedtls-3.6-restricted' into mbedtls-3.6.7.rc 2026-06-26 15:19:55 +01:00
Ronald Cron
4259a7aa63
Merge pull request #1699 from valeriosetti/issue1585-backport3.6-only-fix
[3.6] [minimal] Stale DTLS- SRTP negotiation state after session_reset() (ARM-RZ7EMQAA)
2026-06-26 12:17:27 +02:00
Ronald Cron
9020195c1e
Merge pull request #1687 from minosgalanakis/security/mlfbyt4c_tls13_policy_bypass_changelog_3.6
Add Attribution CVE mbedtls:mbedtls-3.6-restricted
2026-06-25 15:58:22 +02:00
Ronald Cron
823f79b88d
Merge pull request #10784 from minosgalanakis/mbedtls-3.6-release-sync
MbedTLS 3.6.7 release sync
2026-06-25 12:07:06 +00:00
Valerio Setti
e093798e77 changelog: add note for documentation fix for mbedtls_ssl_set_cid
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-06-25 14:01:15 +02: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
Valerio Setti
890c8a1d69 changelog: add reset for some fields of the SSL context structure
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-06-25 14:01:15 +02:00
Valerio Setti
2c33afacd5 library: ssl: reset some SSL context's fields in mbedtls_ssl_session_reset
Following fields were not properly reset when mbedtls_ssl_session_reset
was called:

- badmac_seen
- dtls_srtp_info
- alert_reason
- alert_type

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-06-25 14:01:15 +02:00
Minos Galanakis
677ed44d5e Added attribution to chacha20-counter-overflow.txt
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-06-25 10:16:13 +01:00
Minos Galanakis
70c55db4cc Updated framework pointer
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-06-25 00:54:31 +01:00
Gilles Peskine
8cef139002
Merge pull request #10789 from bensze01/readthedocs-3.6
[Backport 3.6] Upgrade readthedocs builder to Ubuntu 26.04
2026-06-24 18:23:01 +00:00