34765 Commits

Author SHA1 Message Date
v1rtu3x
fd919be981 Test TLS 1.2 signature algorithm policy enforcement
Add ssl-opt.sh tests exercising mbedtls_ssl_conf_sig_algs in TLS 1.2
with (hash,sig) pairs expressed as hex: positive control, hash-
accepted/signature-rejected (client and server side), and signature-
accepted/hash-rejected via a stricter server policy.

Signed-off-by: v1rtu3x <149050962+v1rtu3x@users.noreply.github.com>
2026-10-07 10:10:16 +03:00
v1rtu3x
d0af7c1f3b Move sig_algs parsing to ssl_test_lib.c and add TLS 1.2 hex pairs
Unify the duplicated sig_algs option parsing from ssl_client2.c and
ssl_server2.c into parse_sig_algs() in ssl_test_lib.c, next to
parse_groups(). Move mbedtls_print_supported_sig_algs() there as well
(it only exists for the parse-error path) and drop its static copy
from ssl_test_common_source.c.

In addition to TLS 1.3 signature scheme names, parse_sig_algs() now
accepts a TLS 1.2 SignatureAndHashAlgorithm pair as 4 hex digits
(e.g. "0401" for SHA-256 with RSA). Documented in USAGE_SIG_ALGS.

Signed-off-by: v1rtu3x <149050962+v1rtu3x@users.noreply.github.com>
2026-10-06 12:45:48 +03:00
Valerio Setti
77eacf4c93
Merge pull request #10971 from valeriosetti/replace-legacy-rsa-symbols-followup-4.1
[4.1] Replace legacy rsa symbols followup
2026-09-25 14:53:18 +00:00
Valerio Setti
1b40f0d573 tests: ssl: refine RSA dependencies of test functions
- mbedtls_endpoint_sanity() is only used for TLS 1.2 tests, where RSA
  signatures are limited to PKCS#1 v1.5. Moreover the test does not
  perform a full handshake, so only being able to hold an RSA public key
  is required here: PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY.
- move_handshake_to_state() is used for both TLS 1.2 and TLS 1.3 tests
  and the RSA capabilities it needs depend on the handshake state being
  reached, so the RSA dependency is set on test data instead.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2026-09-25 09:18:41 +02:00
Valerio Setti
88a3ee59eb tests: ssl: refine RSA dependencies in test data
- Mbed TLS only implements TLS 1.2 and DTLS 1.2 (not 1.0/1.1) and there
  RSA signatures are limited to PKCS#1 v1.5, so replace
  PSA_HAVE_ALG_SOME_RSA_SIGN with PSA_HAVE_ALG_RSA_PKCS1V15_SIGN.
- move_handshake_to_state() sets options.pk_alg = MBEDTLS_PK_RSA, so some
  minimal support for RSA keys is always needed: at least an RSA public
  key. Stricter requirements only apply depending on the protocol version
  (TLS 1.2 vs 1.3) and on the handshake state reached by the test (ex:
  initial phase vs ending phase), so they are set per test case.
- Test cases already requiring MBEDTLS_X509_RSASSA_PSS_SUPPORT don't need
  PSA_WANT_ALG_RSA_PSS too, since the former depends on the latter.
- Add a comment to the handshake_psk_cipher test cases to explain why a
  test which is ideally about PSK has requirements on RSA and EC keys.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2026-09-25 09:18:41 +02:00
Valerio Setti
f207f1949b tests: pkcs7: remove RSA dependency from pkcs7_verify()
PKCS7 supports ECC as well so the test function should not be guarded or
limited to RSA build symbols. Those guards are now set on the test data
as required by each test itself. This allows for test extension to also
include ECC testing (not present now).

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2026-09-25 09:18:41 +02:00
Valerio Setti
dceeba6ca5 tests: pkcs7: set proper RSA dependencies on pkcs7_verify() test data
pkcs7_verify() is about to lose its blanket RSA guard, so each test case
must declare what it actually needs:
- cases that really validate an RSA signature require
  PSA_HAVE_ALG_RSA_PKCS1V15_VERIFY. This includes the cases which used
  to pass accidentally because the certificate is invalid and the code
  never gets to verify the signature: using the same dependency as the
  valid cases is more uniform;
- cases which are expected to fail before reaching signature
  verification only require PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2026-09-25 09:18:41 +02:00
Valerio Setti
5086860839 tests: x509parse: ease RSA requirements in test data
- Tests that only parse a certificate/CRL/CSR without verifying any
  signature only need to be able to hold an RSA public key, so replace
  PSA_HAVE_ALG_SOME_RSA_VERIFY with PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY.
  PSA_HAVE_ALG_SOME_RSA_VERIFY is kept in x509_verify tests, which do
  verify signatures.
- x509_parse_rsassa_pss_params tests don't need any explicit RSA
  dependency: the test function already depends on
  MBEDTLS_X509_RSASSA_PSS_SUPPORT which itself depends on
  PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_BASIC, i.e. something "stronger" than
  PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2026-09-25 09:18:39 +02:00
Valerio Setti
2682ef0bd7 depends.py: add PSA_WANT_ALG_RSA_PSS to pkalgs domain
MBEDTLS_X509_RSASSA_PSS_SUPPORT depends on PSA_WANT_ALG_RSA_PSS, so add
the corresponding reverse dependency and include PSA_WANT_ALG_RSA_PSS in
the 'pkalgs' ComplementaryDomain in order to also test builds where
RSA-PSS is disabled.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2026-09-25 09:14:09 +02:00
Gilles Peskine
0970a715f1
Merge pull request #10963 from davidhorstmann-arm/fix-check-config-rsa-pss-4.1
[Backport 4.1] Fix incorrect check in `check_config.h`
2026-09-22 12:43:25 +00:00
David Horstmann
480a9bfb09 Fix incorrect check in check_config.h
OAEP is for RSA encryption and therefore is not the correct check when
we want to test for signatures with PSS.

Additionally, we can use RSA PSS when we only have public key support
(not key pairs) so check for PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY (which is
auto-enabled when we have key pairs enabled anyway).

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2026-09-22 11:20:07 +01:00
Valerio Setti
67e43044c1
Merge pull request #10960 from valeriosetti/improve-depends-py-4.1
[4.1] scripts: depends-py: add the possibility to provide a fully custom build-and-test command
2026-09-21 15:04:35 +00:00
Valerio Setti
3c1b87e387 scripts: depends-py: fix pylint complains
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2026-09-21 11:37:10 +02:00
Valerio Setti
dff951822a 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-21 11:37:10 +02:00
David Horstmann
5471f382e5
Merge pull request #10812 from davidhorstmann-arm/2026-07-update-python-dependencies-4.1
[Backport 4.1] Update Python docs dependencies
2026-09-09 17:18:43 +00:00
David Horstmann
0b46f15a07 Update Python packages for docs
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2026-09-09 14:48:28 +01:00
Gilles Peskine
3f1ce37679
Merge pull request #10948 from gilles-peskine-arm/update-submodule-20261008-4.1
Backport 4.1: Update framework with check-python-files fix
2026-09-09 14:40:57 +02:00
Gilles Peskine
c2f44402f8 Update framework with check-python-files fix
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-09-09 11:27:10 +02:00
David Horstmann
56e1c4058e
Merge pull request #10944 from ronald-cron-arm/cve_id_issue_1618-4.1
4.1: Add CVE-2026-73096 ID in ChangeLog
2026-09-03 11:02:32 +00:00
David Horstmann
b4e7dd432c
Merge pull request #10940 from HelloOO7/mbedtls-4.1
Backport 4.1: Restore __cplusplus guard absent from oid.h
2026-09-03 10:30:17 +00:00
minosgalanakis
150d1ea6f0
Merge pull request #10935 from gilles-peskine-arm/cmake-config-4.1
Backport 4.1: Cmake custom compile-time config support
2026-09-02 15:16:25 +00:00
HelloOO7
3416cba59b Add missing __cplusplus guard to oid.h
Signed-off-by: HelloOO7 <cendarehor@gmail.com>
2026-09-02 13:59:12 +02:00
Ronald Cron
cbc8c55b0c Add CVE ID
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2026-09-02 09:36:33 +02:00
Gilles Peskine
7ce654d532
Merge pull request #10938 from gilles-peskine-arm/threading-1.0-alt-build-mbedtls
Backport 4.1: Remove unused test headers
2026-09-01 11:00:13 +02:00
Valerio Setti
87e8d096b1
Merge pull request #10681 from gilles-peskine-arm/all.sh-silence-support-failures-4.0
Backport 4.1: Silence support failures in all.sh
2026-08-31 16:07:19 +00:00
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
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