12937 Commits

Author SHA1 Message Date
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
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
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
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
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
Valerio Setti
795e7e6fd4
Merge pull request #10791 from nvxbug/tls12-session-id-bounds
Reject out-of-bounds session ID length in ssl_tls12_session_load
2026-08-03 14:24:15 +00:00
Valerio Setti
92cd477ffd 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-07-30 15:27:46 +02:00
David Horstmann
12556bc2a2
Merge pull request #10804 from valeriosetti/improve-rsa-pubkey-import-err-code
pk: improve error code failure reporting when RSA public key parsing fails (1/2)
2026-07-15 11:09:33 +00:00
Valerio Setti
b1c673471f 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-10 12:14:20 +02:00
Naveed
852c6bee29 Force sentinel session ID length in serialized-load test
Signed-off-by: Naveed <naveed@bugqore.com>
2026-07-09 13:16:14 +05:30
Naveed
c099994dca Reject out-of-bounds session ID length in ssl_tls12_session_load
Signed-off-by: Naveed <naveed@bugqore.com>
2026-07-09 13:07:44 +05:30
Valerio Setti
a5b83aea58 tests: x509parse: add temporary fallback mechanism for PK error codes
Add a temporary fallback mechanism in 'x509parse_crt' while crypto#827
is merged.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2026-07-07 22:56:30 +02:00
Valerio Setti
8607628249 tests: x509parse: adjust some PK related error codes
After crypto#827 some PK error codes changed from
MBEDTLS_ERR_PK_INVALID_PUBKEY to MBEDTLS_ERR_PK_INVALID_ALG.
This commit adjusts failing test cases.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2026-07-02 14:05:15 +02:00
Minos Galanakis
b11a07f274 Bump version --version 4.2.0
./scripts/bump_version.sh --version 4.2.0

Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-06-29 18:12:41 +01:00
Minos Galanakis
d156cf4c02 Merge remote-tracking branch 'development-restricted' into mbedtls-4.2.0.rc 2026-06-26 22:23:37 +01:00
Ronald Cron
41a8bdf109
Merge pull request #1619 from valeriosetti/issue1585
[development] Stale DTLS- SRTP negotiation state after session_reset() (ARM-RZ7EMQAA)
2026-06-26 12:17:06 +02:00
Ronald Cron
74b9ab2008 tls13_fetch_handshake_msg(): Remove require_record_boundary parameter
Deduce it from the handshake message type

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2026-06-24 15:51:33 +02:00
Ronald Cron
e08cea612f tls13_record_boundary_alignement: Append empty hs msg
Append an empty handshake message to expand
the record instead of just a zero byte.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2026-06-24 15:51:33 +02:00
Ronald Cron
1a58c59470 Various improvements of tls13_(drop_early_data|record_boundary_alignment)()
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2026-06-24 15:51:33 +02:00
Ronald Cron
86315b62a8 test_suite_ssl: Add initialization to all zeroes of test endpoint structs
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2026-06-24 15:51:33 +02:00
Ronald Cron
c494497256 Fix typos
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2026-06-24 15:51:33 +02:00
Ronald Cron
2de65b79a3 test_suite_ssl: Test EndOfEarlyData on record boundary enforcement
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2026-06-24 15:51:33 +02:00
Ronald Cron
cbef7256ce test_suite_ssl: Test client Finished on record boundary enforcement
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2026-06-24 15:51:33 +02:00
Ronald Cron
53ac018b24 test_suite_ssl: Test server Finished on record boundary enforcement
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2026-06-24 15:51:33 +02:00
Ronald Cron
93eb43ed4f test_suite_ssl: Test ServerHello on record boundary enforcement
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2026-06-24 15:51:33 +02:00
Ronald Cron
c8fefcde05 test_suite_ssl: Test ClientHello on record boundary check
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2026-06-24 15:51:33 +02:00
Ronald Cron
3861588b47 tls13: Add record boundary checks
RFC 8446 (TLS 1.3 specification), Section 5.1, states:

Handshake messages MAY be coalesced into a single TLSPlaintext record
or fragmented across several records, provided that:
    ...
    -Handshake messages MUST NOT span key changes. Implementations
    MUST verify that all messages immediately preceding a key change
    align with a record boundary; if not, then they MUST terminate the
    connection with an "unexpected_message" alert. Because the
    ClientHello, EndOfEarlyData, ServerHello, Finished, and KeyUpdate
    messages can immediately precede a key change, implementations
    MUST send these messages in alignment with a record boundary.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2026-06-24 15:51:33 +02:00
Ronald Cron
b340e27847 test_suite_ssl: Add early data drop tests
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2026-06-24 15:51:30 +02:00
Valerio Setti
4f92a63e4a tests: ssl_helpers: run ssl_context reset check only when the SSL context is setup
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-06-24 15:37:00 +02:00
Valerio Setti
4c8a9b7a5e tests: generate_ssl_session_reset_check: remove trailing whitespace
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-06-24 14:30:59 +02:00
Valerio Setti
dce45a7cfe tests: generate_ssl_session_reset_check: pacify pylint
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-06-24 14:30:59 +02:00
Valerio Setti
508e9b1ca4 tests: generate_ssl_session_reset_check: order rules as fields in the struct
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-06-24 14:30:59 +02:00
Valerio Setti
d70169b85c tests: ssl_helpers: fix documentation of mbedtls_test_ssl_check_context_after_session_reset
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-06-24 14:30:59 +02:00
Valerio Setti
365544616d tests: ssl_context_reset_verifier: add missing semicolon in generated file
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-06-24 14:30:59 +02:00
Valerio Setti
b55e820fd1 tests: generate_ssl_session_reset_check: add missing semicolon in generated file
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-06-24 14:30:59 +02:00
Valerio Setti
fbd49c0c4e 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-06-24 14:30:59 +02:00
Valerio Setti
a4dbd999c0 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-06-24 14:30:59 +02:00
Valerio Setti
8294a8fd67 tests: scripts: add generate_ssl_session_reset_check.py
Togethere with the framework counterpart ('ssl_session_reset_check.py')
this script is used to automatically generate the function
'mbedtls_test_ssl_check_context_after_session_reset()'.
The goal of this function is to verify that 'mbedtls_ssl_session_reset()'
properly handled (reset or keep) all the fields of the
'mbedtls_ssl_context' structure.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-06-24 14:30:59 +02:00
Valerio Setti
0a48608651 tests: ssl: split ssl_helpers between public and internal functions
Move functions in "ssl_helpers.h" that depend on internal headers to
"ssl_helpers_internal.h". This allows to include "ssl_helpers.h" also
in programs (which do not have access to internal headers).

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-06-24 14:30:59 +02:00
Ben Taylor
c438b0b9a9 Correct error handling in mbedtls_ssl_reset_checksum
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-24 09:33:33 +01:00
Ben Taylor
82bba7ef61 Fix error codes for tls_transcript_error_propagation
Co-authored-by: Ronald Cron <ronald.cron@arm.com>
Signed-off-by: Ben Taylor <32939606+bjwtaylor@users.noreply.github.com>
2026-06-24 09:33:33 +01:00
Ben Taylor
e98a0a84c3 Improve tls_transcript_error_propagation testing to check for error codes
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-24 09:33:33 +01:00
Ben Taylor
414d284f4a Update regression test
Co-authored-by: Ronald Cron <ronald.cron@arm.com>
Signed-off-by: Ben Taylor <32939606+bjwtaylor@users.noreply.github.com>
2026-06-24 09:33:33 +01:00
Ben Taylor
dc555d19ec remove trailing whitespace
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-24 09:33:33 +01:00
Ben Taylor
fc2f108dfb Update dependencies for skipped test
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-24 09:33:33 +01:00
Ben Taylor
14b2bdc8ce fix code style
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-24 09:33:33 +01:00
Ben Taylor
629df9f5fb Improve testing
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-24 09:33:33 +01:00