34795 Commits

Author SHA1 Message Date
Ben Taylor
1a5e328377 Fix style issue
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-12 09:13:45 +01:00
Ben Taylor
f5cb455b5c Correct ChangeLog style
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-12 09:13:45 +01:00
Ben Taylor
ff8de9cec9 Add CVE to ChangeLog
Co-authored-by: Ronald Cron <ronald.cron@arm.com>
Signed-off-by: Ben Taylor <32939606+bjwtaylor@users.noreply.github.com>
2026-06-12 09:13:45 +01:00
Ben Taylor
4cb3470f91 Improve the wording of the ChangeLog
Co-authored-by: Ronald Cron <ronald.cron@arm.com>
Signed-off-by: Ben Taylor <32939606+bjwtaylor@users.noreply.github.com>
2026-06-12 09:13:45 +01:00
Ben Taylor
cf37056714 Add improvements to ChangeLog
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-12 09:13:45 +01:00
Ben Taylor
f2a1306c86 Correct syntax of MBEDTLS_GET_UINT32_BE in write_new_session_ticket_mem
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-11 16:24:04 +01:00
Ben Taylor
e9332e8ebe Add ChangeLog
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-11 16:24:04 +01:00
Ben Taylor
5fa28bb6cd Improve test of non-initilisation of lifetime
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-11 16:24:04 +01:00
Ben Taylor
dd5a8501c0 Improve robustness of tlen and lifetime variables
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-11 16:24:04 +01:00
Ben Taylor
56e314728b Add fix for leak
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-11 16:24:04 +01:00
Ben Taylor
75cfc5c0b9 Add test for leak
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-11 16:24:04 +01:00
Ben Taylor
1e061ee95a Add reported by and CVE placeholder
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
(cherry picked from commit ab2a7d5a3472f39190344f754e6cee5039fcba50)
2026-06-10 14:34:10 +01:00
Ben Taylor
afdbd67f21 Correct style of ChangeLog
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
(cherry picked from commit 0501e447cc19ed06b69daea5e17585e1294030cd)
2026-06-10 14:34:10 +01:00
Ben Taylor
2705873c5a Improve ChangeLog
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
(cherry picked from commit c058818451833a748da112e3b8129fd299480ceb)
2026-06-10 14:34:10 +01:00
Ben Taylor
93b10471aa Add ChangeLog
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
(cherry picked from commit e71e49e634ba49b2b630f268bc8f0dd392751ec3)
2026-06-10 14:34:10 +01:00
Ben Taylor
4afd1c1685 Add in tests for ECDHE-PSK integer overflow
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
(cherry picked from commit c567299ee6bade9547a97d3ad1dcd5f3bd98ea6f)
2026-06-10 14:34:10 +01:00
Ben Taylor
f63ca6e0af Added fix for Integer overflow using a large ECDHE Identity
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
(cherry picked from commit baf449db7e31f031ed5def0fecf417122f72d3ee)
2026-06-10 14:34:10 +01:00
Ronald Cron
b9af3cd809
Merge pull request #1608 from minosgalanakis/security/mlfbyt4c_tls13_policy_bypass_4.1
Backport 4.1: TLS1.3 client HRR policy bypass[ARM-MLFBYT4C]
2026-06-10 13:04:01 +02:00
Ronald Cron
6b175d2404
Merge pull request #10771 from mpg/security-link-4.1
[4.1] Update broken link in SECURITY.md
2026-06-05 16:49:28 +00:00
Manuel Pégourié-Gonnard
a982231904 Update broken link
I believe the existing link was to the TF wiki which has been retired
for some time now.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2026-06-05 12:28:01 +02:00
Gilles Peskine
6181a54b57 Add CVE-ID
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-06-05 11:34:32 +02:00
Gilles Peskine
3345a59385 Add attribution for the second bug
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-06-05 11:34:32 +02:00
Gilles Peskine
5427ccf723 Update dependencies in forward port from 3.6
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-06-05 11:34:32 +02:00
Gilles Peskine
4e5d350871 Switch to MBEDTLS_ERROR_ADD for combining X509 and ASN1 error codes
Since Mbed TLS 4.0, this is just the low-level error code. But keep the
combination for uniformity with the rest of the file, and to reduce the
differences with the 3.6 branch.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-06-05 11:34:32 +02:00
Gilles Peskine
0c8913d906 basicConstraints with leading INTEGER field: document the behavior change
Announce the security fix together with the overflow fix, since the two bugs
are pretty much indistinguishable from a black-box perspective, despite
being due to independent problems in the code.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-06-05 11:34:32 +02:00
Gilles Peskine
4ac13cc65f Stop accepting basicConstraints with only pathLenConstraint
In an X.509 certificate, a basicConstraints extension where the cA
field (BOOLEAN) is omitted but the pathLenConstraint field (INTEGER )is
present is syntactically valid, but RFC 5280 states that CAs MUST NOT emit
such a certificate.

Historically, since XySSL 0.9 in 2008, if a basicConstraints extension
started with an INTEGER field, we interpreted that field as a cA value. This
was a deliberate change:

> Fixed x509_get_ext() to accept some rare certificates (like
> www.openssl.org:443) which have an INTEGER instead of a BOOLEAN for
> Extension::BasicConstraints::cA.

However, 18 years later, this does not seem to be relevant, and the details
seem to have been lost. Furthermore, major implementations follow RFC 5280
and interpret `SEQUENCE { INTEGER n }` with cA being set to its default
value (FALSE) and pathLenConstraint set to `n`. This means that such a
certificate with n != 0 would be interpreted as a CA certificate in Mbed TLS
but as a leaf certificate elsewhere, which is dangerous.

Since CAs are not supposed to emit such certificates, stop accepting them
altogether.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-06-05 11:34:32 +02:00
Gilles Peskine
f6afd20e71 basicConstraints pathLenConstraint tests: use standard cA type
In test cases for pathLenConstraint parsing in a basicConstraints extension
of an X.509 certificate, use the standard type for the leading cA field,
namely BOOLEAN. The test data was encoding that field as INTEGER, which was
accepted as a deviation from the standard since XySSL 0.9.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-06-05 11:34:32 +02:00
Gilles Peskine
ef81e71061 Remove unreachable CSR extensionRequest check
It is now unreachable because:

- end_set == end_attr_data is enforced at library/x509_csr.c:236.
- end_exts == end_set is enforced at library/x509_csr.c:248.
- x509_csr_parse_extensions() only returns success if *p == end_exts, enforced
  at library/x509_csr.c:188.

So after a successful x509_csr_parse_extensions() call, *p == end_exts ==
end_set == end_attr_data. The condition at line 257 cannot be true.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-06-05 11:34:22 +02:00
Gilles Peskine
44b833324b Tighten CSR extensionRequest bounds
Don't allow parts of a compound (SEQUENCE or SET) to go beyond the
containing compound.

The inline CSR regression test is derived from the existing "X509 CSR
ASN.1 (OK)" DER test vector. In the extensionRequest attribute, the original
well-formed fragment is:

    a029 3027 06092a864886f70d01090e 311a 3018 ...

where 31 1a is the SET containing the Extensions sequence and 30 18 is the
contained Extensions sequence. The malformed test changes only the SET
length byte, from 1a to 19:

    a029 3027 06092a864886f70d01090e 3119 3018 ...

The attribute SEQUENCE length and the inner Extensions sequence length are
left unchanged. This makes the SET one byte too short for its containing
attribute, so the parser must reject it with
MBEDTLS_ERR_ASN1_LENGTH_MISMATCH instead of parsing the trailing byte as
data outside the SET.

There is no known security impact, just some risk reduction.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-06-05 11:34:13 +02:00
Ben Taylor
0cc307762a Add ChangeLog
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-05 10:21:36 +01:00
Ben Taylor
1ac3989db6 Add fix for OOB key exchange error
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-05 09:49:35 +01:00
Ben Taylor
fd5b76b8db Add ret return pattern to avoid variable ret was set but never used warning
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-04 14:07:58 +01:00
Ronald Cron
a73dce874b
Merge pull request #1588 from gilles-peskine-arm/ssl_tls13_prepare_new_session_ticket-psa_get_random-4.1
Backport 4.1: Fix ssl_tls13_prepare_new_session_ticket returning 1 on an RNG failure
2026-05-29 16:20:07 +02:00
Ronald Cron
a9e971b1b0
Merge pull request #1634 from valeriosetti/issue1569-backport-4.1
[backport 4.1] TLS 1.3 certificate chain signature algorithm policy gap
2026-05-29 13:35:08 +02:00
Gilles Peskine
b05434c1b1 Improve changelog wording
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-05-28 16:32:35 +02:00
Valerio Setti
bd57fb5e8a changelog: fix typos
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-05-28 13:07:51 +02:00
Valerio Setti
f0ed933ca8 changelog: add note about issue 1569 resolution
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-05-28 13:07:51 +02:00
Valerio Setti
271bf18193 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:07:51 +02:00
Gilles Peskine
9007fc4b9b Fix lax basicConstraints parsing
When parsing the basicConstraints extension, reject junk after the SEQUENCE
inside the extension (which is probably benign), and reject a SEQUENCE that
extends beyond the extension (could be very dangerous).

Add a non-regression test where a certificate that is technically malformed,
but accepted as a leaf certificate by OpenSSL and other X.509
implementations, to be accepted as a CA certificate by Mbed TLS.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-05-26 20:51:52 +02:00
Gilles Peskine
1af2443a38 Update framework with test certificate with basicConstraints overflow
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-05-26 20:51:49 +02:00
Minos Galanakis
e16f0e0b01 ssl_write_supported_groups_ext: Updated documentation
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-05-26 10:31:03 +01:00
Janos Follath
a4f79350ac
Merge pull request #10742 from valeriosetti/backport-pr10741
[backport 4.1] mbedtls_config.c missing mbedtls_platform_requirements.h
2026-05-26 09:24:50 +00:00
Nadav0077
e0a83c328d
Harden serialized data deserialization
Reject malformed TLS 1.3 serialized sessions instead of accepting
unterminated strings or extra trailing data, and reject serialized SSL
contexts whose DTLS Connection ID length exceeds the maximum supported
size instead of overflowing the internal buffer.

Backport of #10715 (development).

Signed-off-by: Nadav0077 <18245584+Nadav0077@users.noreply.github.com>
2026-05-22 13:07:17 +03:00
Minos Galanakis
2e2087d246 test_suite_ssl: Added MBEDTLS_DEBUG_C guards to logs
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-05-20 15:01:43 +01:00
Minos Galanakis
c4461967af test_suite_ssl: Restructured reject_hrr_selecting_unoffered_group
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-05-20 15:01:21 +01:00
Minos Galanakis
d3931632fa test_suite_ssl: Renamed hrr_reject_selecting_unoffered_group
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-05-20 15:01:00 +01:00
Minos Galanakis
f8adf74988 sll_client: align TLS 1.3 supported_groups filtering with PSA curve support
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-05-20 15:00:52 +01:00
minosgalanakis
e862725edd
Merge pull request #10709 from yiwu0b11/remove_unused_ffdh_code-4.1
Backport 4.1: tests: remove remaining FFDH code in compat.sh
2026-05-13 16:49:07 +00:00
Minos Galanakis
be84be5d9a test_suite_ssl: doc fixes
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-05-13 11:45:44 +01:00
Minos Galanakis
45ca9e1e06 Added ChangeLog
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-05-12 15:02:05 +01:00