Commit Graph

32469 Commits

Author SHA1 Message Date
Ronald Cron
f44b6545fe ssl-opt.sh: Add tests with CH fragmented with DTLS in default config
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2026-02-24 15:30:00 +01:00
Ronald Cron
f20d48f719 ssl-opt.sh: Add interop test of DTLS defragmentation on server side
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2026-02-24 15:30:00 +01:00
Ronald Cron
09546ee120 ssl_msg.c: Remove some now unnecessary code
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2026-02-24 15:30:00 +01:00
Ronald Cron
2086b20f28 ssl_tls12_server.c: parse_client_hello: Remove remaining record level code
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2026-02-24 15:30:00 +01:00
Ronald Cron
6a9fc0ce77 ssl_tls12_server.c: Move ClientHello record sequence_number init
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2026-02-24 15:30:00 +01:00
Ronald Cron
5a744e8d34 ssl_tls12_server.c: Move ClientHello message_seq adjustment
Move ClientHello message_seq adjustment to the record layer.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2026-02-24 15:30:00 +01:00
Ronald Cron
06abef2307 ssl_tls12_server.c: Use mbedtls_ssl_read_record() only to read the ClientHello
In ssl_tls12_server.c:ssl_parse_client_hello(), remove
the code that directly reads the received data to read
the record expected to contain the ClientHello message.

The function already supported handling a ClientHello
read via mbedtls_ssl_read_record() in the following
cases:
- when the ClientHello was read as a post-handshake
  message (renegotiation).
- when the ClientHello was read by
  ssl_tls13_process_client_hello() during TLS 1.3 or
  TLS 1.2 version negotiation.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2026-02-24 15:30:00 +01:00
Ronald Cron
17acd871c1 ssl_tls12_server.c: Document replay check and update in ssl_parse_client_hello()
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2026-02-24 15:30:00 +01:00
Ronald Cron
0a8c35d273 ssl_server2.c: DTLS: Attempt to read the response to the close notification
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2026-02-24 15:30:00 +01:00
Ronald Cron
faa9d95638 ssl-opt.sh: Relax deps of handshake defrag tests
Relax the dependencies of the tests about handshake
message defragmentation/reassembly on server side.

TLS 1.3 does not need to be enable anymore for this
to work for TLS 1.2 handshake messages.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2026-02-24 15:30:00 +01:00
Ronald Cron
4a8d476568 ssl_tls.c: Allow client hello fragmentation
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2026-02-24 15:30:00 +01:00
Bence Szépkúti
34fcd9ae4f Merge pull request #10603 from ronald-cron-arm/dtls-client-hello-defragmentation-prep-3.6
Backport 3.6: Some preparatory work for DTLS client hello defragmentation
2026-02-22 23:30:44 +00:00
Ronald Cron
d8b97c6a28 ssl-opt.sh: Revert leftover debug level increase
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2026-02-18 14:41:57 +01:00
Ronald Cron
3b6bd65334 ssl_msg.c: Improve handshake message fragmenting message
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2026-02-18 14:41:57 +01:00
Ronald Cron
8e68a06bdf ssl-opt.sh: Improve DTLS proxy 3d tests
Improve DTLS proxy 3d tests with OpenSSL and
GnuTLS servers. Have a better control of which
message is fragmented and verify it is the
case.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2026-02-18 14:41:57 +01:00
Ronald Cron
98b3ef2e43 ssl-opt.sh: Improve DTLS reassembly tests
Improve DTLS reassembly tests with OpenSSL
and GnuTLS server. Check that some messages
have been reassembled.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2026-02-18 14:41:56 +01:00
Ronald Cron
87871ddf30 ssl-opt.sh: Remove DTLS reassembly redundant test
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2026-02-18 14:41:56 +01:00
Ronald Cron
0b4cb31fb6 ssl-opt.sh: Remove CH reassembly unsupported test
We are about to have full support for TLS 1.2
CH reassembly on server side. The equivalent
positive test would be a duplicate of one of
the tests generated by generate_tls_handshake_tests.py.
Thus just removing the negative test.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2026-02-18 14:41:56 +01:00
Ronald Cron
a02505a7be ssl_msg.c: Improve HS message reassembly completed message
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2026-02-18 14:41:56 +01:00
Ronald Cron
c065fdd4d4 ssl_tls.c: Rename and expand ssl_tls13_get_hs_msg_name
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2026-02-18 14:41:56 +01:00
Manuel Pégourié-Gonnard
fbfd13e22b Merge pull request #10597 from valeriosetti/fix-tls12-sha-guards-backport
[backport] library: check_config: fix required hash algorithms for TLS 1.2
2026-02-18 08:23:38 +00:00
David Horstmann
94594b96bd Merge pull request #10602 from davidhorstmann-arm/fix-missing-type-conversion-tls-exporter-3.6
[Backport 3.6] Fix missing type conversion in the TLS-Exporter
2026-02-17 18:31:05 +00:00
Ronald Cron
9d96a23fa2 ssl_server2.c: Flush stdout to improve logs timeliness
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2026-02-17 10:10:34 +01:00
Ronald Cron
373e08939f Add branch specific generate_tls_handshake_tests.py file
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2026-02-17 10:10:34 +01:00
Ronald Cron
381b296956 Update framework pointer
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2026-02-17 10:07:42 +01:00
David Horstmann
85426311e3 Fix missing type conversion in the TLS-Exporter
In the TLS-Exporter for TLS 1.3 we mistakenly call PSA_HASH_LENGTH() on
an mbedtls_md_type_t when it should be called on a psa_algorithm_t.

Fortunately, these two types have almost the same values, since we have
previously aligned them to make conversion more efficient. As a result,
PSA_HASH_LENGTH() produces exactly the same value when called on an
mbedtls_md_type_t as with the equivalent psa_algorithm_t.

Thanks to this happy coincidence, fix a largely cosmetic issue (rather
than a major functional bug).

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2026-02-16 17:07:30 +00:00
David Horstmann
b847040a1a Merge pull request #10594 from gilles-peskine-arm/bump-version-202602-3.6
Backport 3.6: Minor improvements to bump_version.sh
2026-02-16 16:50:12 +00:00
Valerio Setti
a372f1a5cb library: check_crypto_config: remove redundant check on hash algorithms for TLS 1.2
TLS-PRF uses either SHA-256 and SHA-384, so the removed paragraph was not
correct. The correct version is already available in "check_config.h".

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2026-02-12 22:09:06 +01:00
David Horstmann
48c3b179c5 Merge pull request #10589 from daverodgman/backport_gcc_bswap
[Backport 3.6] fix error in GCC bswap
2026-02-11 14:04:47 +00:00
David Horstmann
610f4997c2 Merge pull request #10565 from minosgalanakis/bugfix/fix-intrisic-aesce-clang-36
[3.6 Backport] Fixed clang arm intrinsics for older compiler versions
2026-02-11 11:58:55 +00:00
Valerio Setti
5334c1dd14 Merge pull request #10592 from mpg/pkwrite-large-stack-buffer
[3.6] PK write: avoid large stack buffer
2026-02-11 05:02:04 +00:00
Gilles Peskine
f41929496e Don't treat --help as an error
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-02-10 14:52:50 +01:00
Gilles Peskine
b47774c9a9 Remove unused variable
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-02-10 14:52:46 +01:00
Manuel Pégourié-Gonnard
6617ab467f pkwrite: tests: make helper more robust
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2026-02-10 11:34:00 +01:00
Manuel Pégourié-Gonnard
20118b65bd pkwrite: RSA: avoid large stack buffer
In the default build, it was 2363 bytes which is a lot to put on the
stack for constrained devices. Fortunately we already have a large
enough buffer at hand: the user-provided output buffer. Use it.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2026-02-10 11:34:00 +01:00
Manuel Pégourié-Gonnard
56503ba340 pkwrite: tests: test that DER writes at the end
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2026-02-10 11:24:05 +01:00
Manuel Pégourié-Gonnard
533a806405 pkwrite: test: factor common part into helper func
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2026-02-10 11:18:24 +01:00
Dave Rodgman
4f6c8ef2ac fix error in GCC bswap
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2026-02-06 10:10:42 +00:00
Valerio Setti
25b5fcdcd3 Merge pull request #10581 from valeriosetti/issue665-backport
[backport] Software GCM table calculation buggy with gcc -O3
2026-01-29 15:17:00 +00:00
David Horstmann
337218d667 Merge pull request #10165 from davidhorstmann-arm/fix-mingw-ansi-stdio-3.6
[3.6] Fix format specifiers for MinGW ANSI stdio
2026-01-28 16:42:07 +00:00
Valerio Setti
2b2f430fcd tests: scripts: adapt test_tf_psa_crypto_optimized_alignment to 3.6
Move from CMake to Make

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2026-01-28 00:18:09 +01:00
Valerio Setti
f79c548ad0 changelog: add changelog about fixing issue #665 in tf-psa-crypto
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2026-01-28 00:07:44 +01:00
Valerio Setti
32ef705024 library: alignment: add "may_alias" attribute to mbedtls_uintXX_unaligned_t structs
Tell the GCC compiler that pointers to types "mbedtls_uintXX_unaligned_t"
(where XX is 16, 32 or 64) might alias with other types. This helps at
high optimizations level (i.e. "-O3") so that the compiler does not mess
up with instruction reordering and memory accesses.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2026-01-28 00:07:44 +01:00
Valerio Setti
be0c788105 library: alignment.h: add internal symbol to disable optimizations on x86
MBEDTLS_ALIGNMENT_DISABLE_EFFICENT_UNALIGNED_ACCESS is used to forcedly
prevent MBEDTLS_EFFICIENT_UNALIGNED_ACCESS from being set. This prevents
optimizations from being used on x86 which is useful for testing
purposes.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2026-01-28 00:07:44 +01:00
Valerio Setti
10193b37e3 tests: scripts: add new component to test alignment with GCC O3 optizations
This is meant to test a bug found on:
- Little endian platforms other than x86 or ARM (these have specific
  optimizations available);
- GCC versions from 10 to 14.2 (below and above are fine);
- Optimization level "-O3" (lower levels are fine).

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2026-01-28 00:07:44 +01:00
Minos Galanakis
2f384c82a5 built-in drivers(aesce): Fixed clang arm intrinsics for verions < 7
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-01-26 11:06:58 +00:00
Gilles Peskine
0bc29f6441 Merge pull request #10542 from minosgalanakis/bugfix/fix-intrisic-header-armf-3.6
[Backport 3.6] Bugfix/fix intrisic header armf 3.6
2026-01-22 14:51:13 +00:00
Minos Galanakis
a35f5326f5 drivers sha256|512: Adjusted tf_psa_crypto_common.h inclusion
This patch adjusts the include order so that some ACLE
intrinsics macros are configured before
the inclusion of `neon.h`. This fixes issues with older
clang compilers but has no effect in modern versions.

Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-01-21 14:16:18 +00:00
David Horstmann
366e469c2b Merge pull request #10568 from yanesca/add_clarifications_3.6.x
[Backport 3.6] Add miscellaneous clarifications
2026-01-20 16:38:58 +00:00
Janos Follath
6c0a661b68 programs/README.md clarify security remark
Signed-off-by: Janos Follath <janos.follath@arm.com>
2026-01-20 13:47:05 +00:00