34795 Commits

Author SHA1 Message Date
Yi Wu
9671dd208c 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:19:14 +02:00
Yi Wu
af4e77afd4 improve test coverage
Signed-off-by: Yi Wu <yi.wu2@arm.com>
2026-08-27 21:19:14 +02:00
Yi Wu
79e39ed09e CMake: restore FILEPATH from STING for base
Signed-off-by: Yi Wu <yi.wu2@arm.com>
2026-08-27 12:34:42 +02:00
Yi Wu
d110a4c5ad CMake: combine Mbed TLS and PSA transformations
Signed-off-by: Yi Wu <yi.wu2@arm.com>
2026-08-27 12:34:42 +02:00
Yi Wu
ef31cfb509 compatible with PSA configs and test improvements
Signed-off-by: Yi Wu <yi.wu2@arm.com>
2026-08-27 12:34:42 +02:00
Yi Wu
abd4caa18d test fixes: CMake 3.10 not support cmake -S -B
Signed-off-by: Yi Wu <yi.wu2@arm.com>
2026-08-27 12:34:42 +02:00
Yi Wu
52d8e85a7e CMake: make generated configs relocatable
Signed-off-by: Yi Wu <yi.wu2@arm.com>
2026-08-27 12:34:42 +02:00
Yi Wu
aa92ab7b41 tests: cmake coverage improve
Signed-off-by: Yi Wu <yi.wu2@arm.com>
2026-08-27 12:34:42 +02:00
Yi Wu
231807ff87 CMake: separate base config
Signed-off-by: Yi Wu <yi.wu2@arm.com>
2026-08-27 12:34:42 +02:00
Yi Wu
c744bdc7fe CMake: support custom base configurations
Signed-off-by: Yi Wu <yi.wu2@arm.com>
2026-08-27 12:34:42 +02:00
Yi Wu
b387391623 add component test
Signed-off-by: Yi Wu <yi.wu2@arm.com>
2026-08-27 12:34:42 +02:00
Yi Wu
3008501bf1 Cmake: add support for config options
Signed-off-by: Yi Wu <yi.wu2@arm.com>
2026-08-27 12:34:42 +02:00
Naveed
8a69d73b79 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:52:19 +05:30
Naveed
46771343fc bound two-byte length reads in tls 1.2 handshake parsing
Signed-off-by: Naveed <naveed@bugqore.com>
2026-08-24 21:52:19 +05:30
Valerio Setti
eee512afe1
Merge pull request #10923 from yiwu0b11/strcmp_for_md_programs_example-4.1
[Backport 4.1] Replace mbedtls_md_info_from_string() with strcmp()
2026-08-14 10:19:10 +00:00
Valerio Setti
532e8ff382
Merge pull request #10922 from valeriosetti/issue10694-backport
[1.1] tests: scripts: remove _reference test components
2026-08-13 14:53:22 +00:00
Valerio Setti
76db1b6c71
Merge pull request #10832 from yiwu0b11/ref-for-drivers-4.1
[Backport 4.1] Check test dependencies against crypto internal macros
2026-08-13 09:56:15 +00:00
Yi Wu
c869effbe9 fix guards and keep SHA
Signed-off-by: Yi Wu <yi.wu2@arm.com>
2026-08-13 10:04:47 +01:00
Yi Wu
727f5d8368 Replace mbedtls_md_info_from_string() with strcmp()
Signed-off-by: Yi Wu <yi.wu2@arm.com>
2026-08-13 10:04:47 +01:00
Valerio Setti
9e43a472ae 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-12 16:30:20 +02:00
Valerio Setti
f48fe5ebe2 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-12 16:30:20 +02:00
Valerio Setti
8cda0b83c9 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-12 16:30:20 +02:00
Valerio Setti
0b1f37e040 tests: configuration-crypto: fix comments still referencing reference components
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2026-08-12 16:30:20 +02:00
Valerio Setti
67d0925d1e tests: scripts: remove _reference test components
These were useful in the 3.6 days when 'analyze_outcomes.py' was used to
check that driver acceleration was providing the same coverage as the
reference legacy modules. Since this check has recently been removed
from 'analyze_outcomes.py' all the '_reference' component can be
removed as they are just wasting CI time.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2026-08-12 16:30:20 +02:00
Gilles Peskine
798b0b9f2d
Merge pull request #10847 from valeriosetti/remove-ecp-deps-backport4.1
[4.1] Reduce dependencies on private `ecp.h` header
2026-08-04 13:43:23 +00:00
Valerio Setti
be621858b9
Merge pull request #10854 from nvxbug/tls12-session-id-bounds-4.1
Backport 4.1: Reject out-of-bounds session ID length in ssl_tls12_session_load
2026-08-03 15:24:18 +00:00
Naveed
84f571eafb Force sentinel session ID length in serialized-load test
Signed-off-by: Naveed <naveed@bugqore.com>
2026-08-03 13:44:23 +05:30
Naveed
1933e828d0 Reject out-of-bounds session ID length in ssl_tls12_session_load
Signed-off-by: Naveed <naveed@bugqore.com>
2026-08-03 13:44:23 +05:30
Valerio Setti
a48935588a library: ssl_tls: replace wrong usage of mbedtls_pk_get_type with mbedtls_pk_get_key_type
The intent on these lines was to get 'psa_key_type_t' for which
'mbedtls_pk_get_key_type' should clearly be used, not
'mbedtls_pk_get_type'.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2026-07-30 10:52:36 +02:00
Valerio Setti
b368a7a1b9 library: ssl: remove usage of MBEDTLS_ECP_DP_MAX
MBEDTLS_ECP_DP_MAX is defined in 'ecp.h' which is a tf-psa-crypto private
header. Instead of relying on that value define a new function named
'mbedtls_ssl_get_supported_tls_id_count' which returns the number of
entries in 'tls_id_match_table'.
Rationale: it does not have too much sense to allocate an array for TLS
IDs which is larger than the list of supported TLS IDs in the current
build.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2026-07-30 10:52:36 +02:00
Valerio Setti
f3e424057f tests: ssl_helpers: update TEST_AVAILABLE_ECC and TEST_UNAVAILABLE_ECC
Align to recent changes in TLS group ID related functions:
- 'mbedtls_ssl_get_ecp_group_id_from_tls_id' renamed to
  'mbedtls_ssl_is_tls_id_supported'.
- 'mbedtls_ssl_get_tls_id_from_ecp_group_id' renamed to
  'mbedtls_ssl_get_tls_id_from_ecp_group_id'.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2026-07-30 10:52:36 +02:00
Valerio Setti
aee1caf749 library: ssl: remove mbedtls_ecp_group_id field from mbedtls_ecp_group_id
This field is now completely useless.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2026-07-30 10:52:36 +02:00
Valerio Setti
512e6bbc69 library: ssl: remove mbedtls_ssl_check_curve
Its main functionality was to get a TLS ID from 'mbedtls_ecp_group_id' and
then call 'mbedtls_ssl_check_curve_tls_id'. The same can be achieved
with public PK functions and 'mbedtls_ssl_get_tls_id_from_curve_info',
then calling into 'mbedtls_ssl_check_curve_tls_id' as before.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2026-07-30 10:52:36 +02:00
Valerio Setti
2e6c0e03a8 library: replace mbedtls_ssl_get_tls_id_from_ecp_group_id
Instead of retrieving the TLS ID using 'mbedtls_ecp_group_id', which
creates a dependency on the (now tf-psa-crypto private) 'ecp.h' header,
use PSA info to get the same result. Therefore rename the function as
'mbedtls_ssl_get_tls_id_from_curve_info'.

This new function has basically the opposite behavior than
'mbedtls_ssl_get_psa_curve_info_from_tls_id'.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2026-07-30 10:52:36 +02:00
Valerio Setti
25829c8f38 library: replace mbedtls_ssl_get_ecp_group_id_from_tls_id
All the usages of 'mbedtls_ssl_get_ecp_group_id_from_tls_id' basically
reduce to checking if a specific TLS ID is supported or not. Therefore
the function is replaced with 'mbedtls_ssl_is_tls_id_supported'.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2026-07-30 10:52:36 +02:00
David Horstmann
aff0185563
Merge pull request #10822 from minosgalanakis/tools/fix-auto-generated-files-4.1
[4.1 backport]Fix generate_errors.pl
2026-07-20 09:57:25 +00:00
Yi Wu
7bd7981302 test: move temp files to out_of_source
Signed-off-by: Yi Wu <yi.wu2@arm.com>
2026-07-15 09:48:06 +01:00
Yi Wu
65dbfc8e87 test: check both .data and .function
Signed-off-by: Yi Wu <yi.wu2@arm.com>
2026-07-15 09:48:06 +01:00
Yi Wu
4947a45c19 fix typo
Signed-off-by: Yi Wu <yi.wu2@arm.com>
2026-07-15 09:48:06 +01:00
Yi Wu
37a33ab5cc test: dependency macros order fix
Signed-off-by: Yi Wu <yi.wu2@arm.com>
2026-07-15 09:48:06 +01:00
Yi Wu
937f006632 tests: allow RSA helper dependency macros
Signed-off-by: Yi Wu <yi.wu2@arm.com>
2026-07-15 09:48:06 +01:00
Yi Wu
2965533b08 test: remove obsolete macro checks
Signed-off-by: Yi Wu <yi.wu2@arm.com>
2026-07-15 09:48:05 +01:00
Manuel Pégourié-Gonnard
b157aa1fce Add test for dependencies on crypto-internal macros
Previously this was tested indirectly by comparing driver vs reference
components in analyze-outcomes.py, but now that the number of exceptions
is low, it's much more efficient to test this directly.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2026-07-15 09:48:05 +01:00
Manuel Pégourié-Gonnard
e8ed43bcee tests: avoid useless use of low-level crypto deps
Take our low-level error for test from our own side of the split.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2026-07-15 09:48:05 +01:00
Manuel Pégourié-Gonnard
41d0f47970 ssl-opt: rm references to !MBEDTLS_USE_PSA_CRYPTO
Also remove the "no USE_PSA" tests: they are not executed, and are not
useful for the future - when we add support for restartable ECDH in TLS,
we can just use the existing tests and update the assertions, which
we'll have to do anyway (the tests being removed were asserting about
a legacy crypto function that no longer exists).

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2026-07-15 09:48:05 +01:00
Minos Galanakis
b736ab022d Fix generate_errors.pl
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-07-09 15:59:21 +01:00
Ronald Cron
8828120c8a
Merge pull request #10816 from Mbed-TLS/mbedtls-4.1.1_mergeback
Mbedtls 4.1.1 mergeback
2026-07-08 13:16:11 +00:00
Minos Galanakis
c8ab24b67c Updated framework
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-07-08 10:47:30 +01:00
Minos Galanakis
cf644361ff Updated tf-psa-crypto submodule
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-07-08 10:47:30 +01:00
Minos Galanakis
a0bbf7649f Merge tag 'mbedtls-4.1.1' into mbedtls-4.1.1_mergeback
Mbed TLS 4.1.1

Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-07-07 16:55:23 +01:00