34778 Commits

Author SHA1 Message Date
Naveed
fbc06d7909 Add an out_cid case to the ssl_context_load OOB length test
Cover the serialized out_cid length with the same construction as the
in_cid one, and rename the existing case to IN_CID accordingly. Give
the client and server sentinel CIDs different lengths so the two
fields can be told apart in the serialized data. Skip the CID cases
under configurations of MBEDTLS_SSL_CID_IN_LEN_MAX and
MBEDTLS_SSL_CID_OUT_LEN_MAX that the test does not support.

Signed-off-by: Naveed <naveed@bugqore.com>
2026-09-22 17:27:35 +05:30
Naveed
a39d101718 Guard the in_cid size check in the CID case
The previous approach documented the in_cid_len > sizeof(in_cid) cap
as untestable, since the overflowing memcpy() lands inside the
transform structure where sanitizers cannot see it. It can be guarded
without a sanitizer: grow the in_cid field in the loaded data (keep
its bytes, pad to MBEDTLS_SSL_CID_IN_LEN_MAX + 1) and append the rest
of the serialized data untouched, so the in-buffer bounds check passes
and the cap is what must reject the length. Without the cap the
remaining data parses correctly aligned and the load succeeds, so the
test catches a regression by the return value alone.

Signed-off-by: Naveed <naveed@bugqore.com>
2026-09-22 17:23:31 +05:30
Naveed
13bbd7ec0b Keep the out_cid length byte in the CID case's truncated data
With the loaded data cut right after the in_cid bytes, even the
pristine in_cid length tripped the (end - p) < in_cid_len + 1u bounds
check, since the out_cid length byte it accounts for was missing: the
truncation, not the corruption, was what got rejected. Keep the
out_cid length byte in the loaded data, so the pristine length passes
the check and only the corrupted length trips it. Also document why
this pre-existing check is the only one in the in_cid path that a
regression test can guard: the in_cid_len > sizeof(in_cid) cap
protects the memcpy() destination, and without it the overflow lands
in the out_cid field inside the transform structure, where sanitizers
cannot see it.

Signed-off-by: Naveed <naveed@bugqore.com>
2026-09-22 17:23:31 +05:30
Naveed
05f02b1e40 Fix the CID case of the OOB length regression test
The corrupted in_cid length exercised the pre-existing size-cap check,
not the bounds check: the in_cid field is not the last one serialized,
and the MBEDTLS_SSL_CID_IN_LEN_MAX cap is smaller than the size of the
fields that follow it, so no corrupted length could reach past the end
of the full buffer, and reverting the bounds check did not change the
test's outcome. Truncate the loaded data right after the in_cid bytes,
load from a tightly allocated copy, and corrupt the length to one byte
past that end, so that reverting the bounds check now trips ASan with
an out-of-bounds read in the memcpy(), like the ALPN case.

Signed-off-by: Naveed <naveed@bugqore.com>
2026-09-22 17:23:31 +05:30
Naveed
467e053210 Address review: verify pristine load, corrupt ALPN length by exactly one
Load the serialized context once before corrupting it, to check the
data is well-formed to begin with. Shorten the second ALPN protocol so
the corrupted length overruns the serialized data by exactly one byte,
and assert that property at runtime. Document that the corrupted load
usually fails even without the bounds check, so the regression is only
caught when the suite runs under ASan or Valgrind.

Signed-off-by: Naveed <naveed@bugqore.com>
2026-09-22 17:23:31 +05:30
Naveed
8b670951eb Merge the two ssl_context_load OOB length tests
Fold ssl_context_load_rejects_oob_cid_length and
ssl_context_load_rejects_oob_alpn_length into a single parameterized
test function, since they shared most of their code.

Signed-off-by: Naveed <naveed@bugqore.com>
2026-09-22 17:23:31 +05:30
Naveed
c2c8d1e142 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-09-22 17:23:31 +05:30
Valerio Setti
f2e042eeba
Merge pull request #10958 from valeriosetti/improve-depends-py
scripts: depends-py: add the possibility to provide a fully custom build-and-test command
2026-09-21 15:04:31 +00:00
Valerio Setti
dd30cc683f scripts: depends-py: fix pylint complains
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2026-09-17 17:29:58 +02:00
Valerio Setti
00aff9cbb4 scripts: depends-py: add the possibility to provide a fully custom build-and-test command
This is useful for debugging purposes because, for example, the user
only want to build a specific suite and/or only run it instead of
building and testing everything for all the jobs.
For this scope the custom command can be a bash script that's executed
instead of 'make' + 'make test'.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2026-09-17 11:24:40 +02:00
Ronald Cron
3361ae00b4
Merge pull request #10921 from valeriosetti/blake2
Prerequisite for adding support for Blake2 in TF-PSA-Crypto
2026-09-10 13:17:12 +00:00
David Horstmann
9d76b2ee09
Merge pull request #10810 from davidhorstmann-arm/2026-07-update-python-dependencies
Update Python docs dependencies
2026-09-09 17:14:40 +00:00
Valerio Setti
e24a562fc7 framework: update reference
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2026-09-09 15:53:43 +02:00
Valerio Setti
9b0370e949 configuration-crypto: add ALG_SM3 to the components accelerating hash algs
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2026-09-09 15:52:59 +02:00
Valerio Setti
2f4b6f3bb9 tests: configuration-crypto: accelerate Blake2 on tests accelerating EC
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2026-09-09 15:52:59 +02:00
Valerio Setti
2b0003a134 scripts: libtestdriver1_rewrite.pl: fix tf-psa-crypto private headers path
Generated tf-psa-crypto private includes path in
'crypto_builtin_primitives.h' were wrong. For example the output for
'blake2.h' was:

"libtestdriver1/tf-psa-crypto/include/tf-psa-crypto/private/blake2.h"

whereas it should have been

"libtestdriver1/tf-psa-crypto/drivers/builtin/include/tf-psa-crypto/private/blake2.h"

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2026-09-09 15:52:59 +02:00
David Horstmann
3d98a17142 Update Python packages for docs
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2026-09-09 14:48:03 +01:00
Gilles Peskine
00d8124533
Merge pull request #10949 from gilles-peskine-arm/update-submodule-20261008-dev
Update framework with check-python-files fix
2026-09-09 14:37:30 +02:00
Gilles Peskine
07779d4137 Update framework with check-python-files fix
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-09-09 11:26:14 +02:00
David Horstmann
e3d5ae00cc
Merge pull request #10942 from ronald-cron-arm/cve_id_issue_1618
Add CVE-2026-73096 ID in ChangeLog
2026-09-03 11:02:29 +00:00
David Horstmann
f06454cd7b
Merge pull request #10927 from HelloOO7/development
Restore __cplusplus guard absent from oid.h
2026-09-03 10:30:12 +00:00
minosgalanakis
023aca8620
Merge pull request #10860 from yiwu0b11/cmake-config
Cmake custom compile-time config support
2026-09-02 15:16:33 +00:00
Ronald Cron
5cb95431c4 Add CVE ID
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2026-09-02 09:38:55 +02:00
Gilles Peskine
a5a368690e
Merge pull request #10394 from gilles-peskine-arm/threading-1.0-alt-build-mbedtls
Remove unused test headers
2026-09-01 11:00:04 +02:00
Valerio Setti
33f79f8ab0
Merge pull request #10493 from gilles-peskine-arm/all.sh-silence-support-failures-4.0
Silence support failures in all.sh
2026-08-31 14:36:46 +00:00
Yi Wu
9992b3d08e Update tf-psa-crypto with CMake config improvements
Signed-off-by: Yi Wu <yi.wu2@arm.com>
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-08-27 21:08:50 +02:00
HelloOO7
7145c949f0 Add missing __cplusplus guard to oid.h
Signed-off-by: HelloOO7 <cendarehor@gmail.com>
2026-08-22 00:36:34 +02:00
Yi Wu
8a7fdf2600 improve test coverage
Signed-off-by: Yi Wu <yi.wu2@arm.com>
2026-08-21 15:17:07 +01:00
Yi Wu
ebbe61a192 CMake: restore FILEPATH from STING for base
Signed-off-by: Yi Wu <yi.wu2@arm.com>
2026-08-21 12:13:28 +01:00
Yi Wu
d18007682d CMake: combine Mbed TLS and PSA transformations
Signed-off-by: Yi Wu <yi.wu2@arm.com>
2026-08-20 17:03:11 +01:00
Yi Wu
5c906f7fa0 compatible with PSA configs and test improvements
Signed-off-by: Yi Wu <yi.wu2@arm.com>
2026-08-19 15:57:00 +01:00
Gilles Peskine
522e2e4651
Merge pull request #10925 from gilles-peskine-arm/libtestdriver1-copy-pqcp-headers
Make installable pqcp headers available to the libtestdriver1 build
2026-08-18 16:33:48 +00:00
Gilles Peskine
50c40957c3 Make installable pqcp headers available to the libtestdriver1 build
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-08-18 16:07:13 +02:00
Yi Wu
c734d57590 test fixes: CMake 3.10 not support cmake -S -B
Signed-off-by: Yi Wu <yi.wu2@arm.com>
2026-08-14 17:23:24 +01:00
Yi Wu
166c69a921 CMake: make generated configs relocatable
Signed-off-by: Yi Wu <yi.wu2@arm.com>
2026-08-14 16:20:27 +01:00
Yi Wu
030f872a9b tests: cmake coverage improve
Signed-off-by: Yi Wu <yi.wu2@arm.com>
2026-08-14 15:28:29 +01:00
Yi Wu
1b5aabb7ff CMake: separate base config
Signed-off-by: Yi Wu <yi.wu2@arm.com>
2026-08-14 15:08:42 +01:00
Valerio Setti
0544d27cbc
Merge pull request #10628 from yiwu0b11/strcmp_for_md_programs_example
Replace mbedtls_md_info_from_string() with strcmp()
2026-08-14 10:19:01 +00:00
Valerio Setti
a6b469a5f5
Merge pull request #10848 from valeriosetti/issue10694
tests: scripts: remove _reference test components
2026-08-13 14:53:27 +00:00
Valerio Setti
88ae2c66c8
Merge pull request #10620 from mpg/ref-for-drivers
Check test dependencies against crypto internal macros
2026-08-13 09:56:09 +00:00
Yi Wu
efe8ab6518 fix guards and keep SHA
Signed-off-by: Yi Wu <yi.wu2@arm.com>
2026-08-13 09:35:50 +01:00
Yi Wu
3cf6109ccb Replace mbedtls_md_info_from_string() with strcmp()
Signed-off-by: Yi Wu <yi.wu2@arm.com>
2026-08-13 09:35:50 +01:00
Valerio Setti
67050ecbf1 tests: remove duplicate component_test_psa_crypto_config_accel_hash
Following recent removal for '_reference' and '_use_psa' functions we
ended up having 2 very similar test components named
'component_test_psa_crypto_config_accel_hash', one using 'default'
configuration and the other one using the 'full' one.

Let's keep the 'full' configuration version and get rid of the 'default'
case.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2026-08-11 16:59:39 +02:00
Yi Wu
346ece94cc CMake: support custom base configurations
Signed-off-by: Yi Wu <yi.wu2@arm.com>
2026-08-06 16:21:07 +01:00
Valerio Setti
8a97676cb7 tests: configuration-crypto: remove ssl-opt.sh and compat.sh testing from accel components
'ssl-opt.sh' and 'compat.sh' in accel components were mostly useful back
when the accelerated components were to be compared against the reference
ones to ensure proper test coverage. Now that the reference components
have been removed it doesn't make sense to keep 'ssl-opt.sh' and
'compat.sh' around because they take a lot of simulation time for almost
no benefit. From TLS point of view we can rely on normal 'test_suite_'
testing to be sure that the crypto mechanism works as expected.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2026-08-06 14:36:08 +02:00
Valerio Setti
73c48eb654 tests: configuration-crypto: remove mentions to USE_PSA_CRYPTO
Nowadays USE_PSA_CRYPTO is always enabled and there is no way to disable
it. It doesn't give more information to know that we're setting that
build symbol. Remove that.

While at this remove also '_use_psa' from some test component still using
it in the name for the same reason.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2026-08-06 14:27:54 +02:00
Valerio Setti
6eda95fec1 tests: configuration-crypto: fix comments still referencing reference components
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2026-08-06 14:01:41 +02:00
Yi Wu
bf92cc769c add component test
Signed-off-by: Yi Wu <yi.wu2@arm.com>
2026-08-06 10:45:17 +01:00
Yi Wu
160096a0a3 Cmake: add support for config options
Signed-off-by: Yi Wu <yi.wu2@arm.com>
2026-08-06 09:46:32 +01:00
Gilles Peskine
ce0384b999
Merge pull request #10814 from valeriosetti/remove-ecp-deps
Reduce dependencies on private `ecp.h` header
2026-08-04 13:43:26 +00:00