33160 Commits

Author SHA1 Message Date
Ben Taylor
23370efdea Add comment explaining the derivation of the number of keys
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
(cherry picked from commit e0766f1b4a2133ea043e10cef86cc1c76f69b49b)
2026-10-21 08:24:45 +01:00
Ben Taylor
ad282114a1 Add ChangeLog for transform resource leak
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
(cherry picked from commit 5b4be7edaffe86553b4875f80c78c3befe4ae618)
2026-10-21 08:24:45 +01:00
Ben Taylor
3626aa2d34 Add fix for transform setup resource leak
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
(cherry picked from commit 0ad86e77b2e73100aa65f5148ea865a12caa87f0)
2026-10-21 08:24:45 +01:00
Ben Taylor
86ba516295 Add test for tansform setup resource leak
This is a manual backport, not a direct cherry-pick, because 3.6 can build TLS without PSA-backed transforms. Gate the regression on MBEDTLS_USE_PSA_CRYPTO.

Signed-off-by: Ben Taylor <ben.taylor@linaro.org>

(cherry picked from commit 95e95268a4c26608612f34f2bb76ff1dfa9ded0a)
2026-10-21 08:24:45 +01:00
Manuel Pégourié-Gonnard
27e5c190dc
Merge pull request #10994 from saadgodikat/backport-10973-3.6
[3.6] Fix DER certificate output on Windows
2026-10-06 09:38:27 +00:00
Ronald Cron
8396312553
Merge pull request #10990 from nvxbug/ssl-context-load-alpn-bounds-3.6
Backport 3.6: Reject out-of-bounds ALPN length in ssl_context_load
2026-10-05 11:39:59 +00:00
saadgodikat
955c52b246 Add changelog for DER certificate output fix
Signed-off-by: saadgodikat <saadgodikat601@gmail.com>
2026-10-05 16:19:05 +05:30
saadgodikat
d8fd242a72 Fix DER certificate output on Windows
Fixes #10152

Signed-off-by: saadgodikat <saadgodikat601@gmail.com>
2026-10-05 16:17:00 +05:30
Naveed
ebcb95c130 Add regression tests for ssl_context_load length checks
Backport the ssl_context_load_rejects_oob_length test function from
development in its final form, with cases for the serialized in_cid,
out_cid and ALPN lengths.

mbedtls_test_ssl_dtls_join_endpoints() and
mbedtls_test_ssl_perform_connection() do not exist on this branch, so
set up the DTLS endpoints and run the handshake with the helpers that
do: mbedtls_test_ssl_endpoint_init() with message queues,
mbedtls_test_mock_socket_connect() and
mbedtls_test_move_handshake_to_state(). Exchange application data
explicitly before saving the context, as
mbedtls_test_ssl_perform_connection() does on development: the server
keeps its handshake structure until then, and
mbedtls_ssl_context_save() refuses to run while it exists.

Signed-off-by: Naveed <naveed@bugqore.com>
2026-10-04 22:53:31 +05:30
Naveed
f0e6883dd9 Reject out-of-bounds ALPN length in ssl_context_load
The serialized ALPN length was passed to memcmp() against each configured protocol without checking it against the remaining serialized data, so a malformed context could read past the end of the buffer. Bound it before the comparison, like the adjacent CID fields.

Signed-off-by: Naveed <naveed@bugqore.com>
2026-10-04 22:49:43 +05:30
Gilles Peskine
1ee94c5a11
Merge pull request #10400 from gilles-peskine-arm/compliance-split-3.6
Backport 3.6: Split test_psa_compliance.py
2026-09-17 10:23:54 +00:00
Gilles Peskine
eea0f8c0c1 Clarify that this is the "calling script"
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-09-15 12:04:47 +02:00
Gilles Peskine
32da0ae9c3 Improve docstring following the split
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-09-15 12:04:47 +02:00
Gilles Peskine
22885b6bd9 Import PSA compliance test script entry point from the framework
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-09-15 12:04:47 +02:00
Gilles Peskine
623eda9700 Update framework with psa_compliance.py module
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-09-15 12:04:45 +02:00
David Horstmann
08e82477d8
Merge pull request #10811 from davidhorstmann-arm/2026-07-update-python-dependencies-3.6
[Backport 3.6] Update Python docs dependencies
2026-09-09 13:46:17 +00:00
David Horstmann
86207cd137 Update Python packages for docs
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2026-09-09 11:05:12 +01:00
Ronald Cron
7b7ff06d6a
Merge pull request #10947 from gilles-peskine-arm/update-submodule-20261008-3.6
Backport 3.6: Update framework with check-python-files fix
2026-09-09 09:08:01 +02:00
Gilles Peskine
212aedf694 Update framework with check-python-files fix
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-09-08 19:24:49 +02:00
Gilles Peskine
091fd1b188
Merge pull request #10945 from okning/backport/3.6-musl-getrandom
Backport 3.6: Fix getrandom detection with musl libc
2026-09-03 16:41:13 +00:00
Ning Xia
5d7359d884 fix(platform): detect getrandom syscall support
Backport the final approved implementation from Mbed-TLS/TF-PSA-Crypto#843
to mbedtls-3.6.

Enable the existing Linux getrandom syscall path when sys/syscall.h
is available and defines SYS_getrandom. Preserve the existing
glibc/Midipix detection and runtime ENOSYS fallback.

Apply the platform change to library/entropy_poll.c in this branch.

Signed-off-by: Ning Xia <hi@nosec.me>
2026-09-03 19:17:28 +08:00
David Horstmann
3003321c07
Merge pull request #10943 from ronald-cron-arm/cve_id_issue_1618-3.6
3.6: Add CVE-2026-73096 ID in ChangeLog
2026-09-03 11:02:35 +00:00
minosgalanakis
d6664ceac9
Merge pull request #10920 from yiwu0b11/psa-its-uid0-errorcode-fix-3.6
[Backport 3.6] PSA its function uid0 errorcode fix
2026-09-02 14:46:59 +00:00
Ronald Cron
0f82ff2d25 Add CVE ID
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2026-09-02 09:37:47 +02:00
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
Valerio Setti
e6e01cd4d9
Merge pull request #10586 from gilles-peskine-arm/all.sh-silence-support-failures-3.6
Backport 3.6: Silence support failures in all.sh
2026-08-31 14:36:50 +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
7d443f3534 improve test coverage
Signed-off-by: Yi Wu <yi.wu2@arm.com>
2026-08-21 15:14:20 +01:00
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
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
Yi Wu
d039c5fe50 test: use TEST_EQUAL for ITS UID 0 errors
Signed-off-by: Yi Wu <yi.wu2@arm.com>
2026-08-12 20:18:29 +01:00
Yi Wu
9a23f70ee0 Reject UID 0 in pas_its
function changed: psa_its_set, _get, _get_info, _remove

Signed-off-by: Yi Wu <yi.wu2@arm.com>
2026-08-12 16:00:36 +01:00
Yi Wu
1e8647ff92 CMake: add support for config options
Signed-off-by: Yi Wu <yi.wu2@arm.com>
2026-08-10 08:58:34 +01: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
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
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