31713 Commits

Author SHA1 Message Date
Gilles Peskine
55151d3da6 Fix Doxygen misuse
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-02-17 23:09:00 +01:00
Gilles Peskine
cb72cd2ec3 Don't reset badmac_seen on a DTLS client reconnect
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-02-17 16:36:36 +01:00
Gilles Peskine
b710599e4a Merge in_hsfraglen with badmac_seen_or_in_hsfraglen
In the `mbedtls_ssl_context` structure, merge the field `in_hsfraglen` into
`badmac_seen_or_in_hsfraglen`. This restores the ABI of `libmbedtls` as it
was in Mbed TLS 3.6.0 through 3.6.2.

The field `badmac_seen_or_in_hsfraglen` (formerly `badmac_seen`) was only
used for DTLS (despite being present in non-DTLS builds), and the field
`in_hsfraglen` was only used in non-DTLS TLS. Therefore the two values can
be stored in the same field.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-02-17 16:28:51 +01:00
Gilles Peskine
ebdd405f68 Change the type of in_hsfraglen to unsigned
In the `mbedtls_ssl_context` structure, change the type of `in_hsfraglen`
from `size_t` to `unsigned`. This is in preparation for merging
`in_hsfraglen` into `badmac_seen_or_in_hsfraglen`, which has the type
`unsigned` and cannot change since we do not want to change the ABI.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-02-17 16:26:27 +01:00
Gilles Peskine
f6a676d93f Rename badmac_seen to badmac_seen_or_in_hsfraglen
Prepare to unify two fields of the `mbedtls_ssl_context` structure:
`badmac_seen` (always present but only used in DTLS) and
`in_hsfraglen` (always present but only used in non-DTLS TLS).

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-02-17 16:10:14 +01:00
Gilles Peskine
69f8f45e6f Minor readability improvement
No behavior change.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-02-17 16:08:59 +01:00
Deomid rojer Ryabkov
bbe8745d19 Remove in_hshdr
The first fragment of a fragmented handshake message always starts at the beginning of the buffer so there's no need to store it.

Signed-off-by: Deomid rojer Ryabkov <rojer@rojer.me>
2025-02-17 15:59:55 +01:00
Deomid rojer Ryabkov
85ec2b3632 Add a safety check for in_hsfraglen
Signed-off-by: Deomid rojer Ryabkov <rojer@rojer.me>
2025-02-17 15:59:04 +01:00
Deomid rojer Ryabkov
5c853ea2c5 Allow fragments less HS msg header size (4 bytes)
Except the first

Signed-off-by: Deomid rojer Ryabkov <rojer@rojer.me>
2025-02-17 15:59:04 +01:00
Deomid rojer Ryabkov
96e2290e3d Remove mbedtls_ssl_reset_in_out_pointers
Signed-off-by: Deomid rojer Ryabkov <rojer@rojer.me>
2025-02-17 15:59:04 +01:00
Deomid rojer Ryabkov
1f4088ceda Review comments
Signed-off-by: Deomid rojer Ryabkov <rojer@rojer.me>
2025-02-17 15:59:04 +01:00
Deomid Ryabkov
db2da526ff Update ChangeLog.d/tls-hs-defrag-in.txt
Co-authored-by: minosgalanakis <30719586+minosgalanakis@users.noreply.github.com>
Signed-off-by: Deomid Ryabkov <rojer@rojer.me>
2025-02-17 15:59:04 +01:00
Deomid rojer Ryabkov
3fc5a4dc86 Defragment incoming TLS handshake messages
Signed-off-by: Deomid rojer Ryabkov <rojer@rojer.me>
2025-02-17 15:59:04 +01:00
Ronald Cron
c811fb79ad
Merge pull request #9941 from valeriosetti/issue94-3.6
[Backport 3.6] Move test_psa_*.py scripts to the framework
2025-02-05 13:55:44 +00:00
Valerio Setti
411f7dc167 framework: update reference
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2025-02-05 12:09:13 +01:00
Valerio Setti
aa7bd59dbe components-compliance.sh: update references to test_psa_compliance.py
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2025-02-05 12:07:25 +01:00
Valerio Setti
d673acf89e components-configuration.sh: update references to test_psa_constant_names.py
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2025-02-05 12:07:25 +01:00
Valerio Setti
7297e8d440 Move files out of Mbed TLS
The following files are moved to the framework repo (deleted here):

tests/scripts/test_psa_compliance.py
tests/scripts/test_psa_constant_names.py

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2025-02-05 12:07:25 +01:00
Ronald Cron
204588678e
Merge pull request #9937 from valeriosetti/issue9688-backport
[Backport 3.6] Migrate DHE test cases to ECDHE
2025-01-29 09:59:11 +00:00
Valerio Setti
1a0ee063e2 test_suite_ssl: update description for conf_curve and conf_gruop tests
These tests are about EC curves/groups, not DH ones, so the description
should be updated accordingly.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2025-01-28 11:42:15 +01:00
Valerio Setti
e94ab3cbdf test_suite_ssl: add ECDHE-RSA case for handshake_fragmentation()
This is the backport of commit b8ef2a4455 from the "development" branch
which adapts handshake_fragmentation() to use ECDHE-RSA instead of
DHE-RSA. However, since DHE-RSA is not removed in the mbedtls-3.6 branch,
here tests are added instead of replaced.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2025-01-28 11:42:14 +01:00
Valerio Setti
4f2a74d275 test_suite_ssl: add new ECDHE-RSA tests
PR #9916 adapt some DHE-RSA tests to use ECDHE-RSA instead. However,
since DHE-RSA is not deprecated in mbedtls-3.6 branch, this commit adds
these new tests alongside DHE-RSA ones intead of replacing them in order
to increase test coverage.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2025-01-27 17:40:15 +01:00
Manuel Pégourié-Gonnard
b6fff90ed1
Merge pull request #9907 from mpg/conf-curves-3.6
[3.6 backport]: mbedtls_conf_curves()
2025-01-27 08:21:30 +00:00
Janos Follath
79d5ea234c
Merge pull request #9495 from minosgalanakis/doc/add_mbedtls_ecp_check_privkey_comment_bp36
[Backport 3.6] Refactored a minor check in ecp check privkey
2025-01-24 09:44:39 +00:00
minosgalanakis
484776547c Update tf-psa-crypto/drivers/builtin/src/ecp.c
Co-authored-by: Gilles Peskine <gilles.peskine@arm.com>
Signed-off-by: minosgalanakis <30719586+minosgalanakis@users.noreply.github.com>
2025-01-23 15:31:35 +00:00
Manuel Pégourié-Gonnard
ea18c7e1e5 Fix incorrect test function
We should not manually set the TLS version, the tests are supposed to
pass in 1.3-only builds as well. Instead do the normal thing of setting
defaults. This doesn't interfere with the rest of the testing, so I'm
not sure why we were not doing it.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2025-01-22 10:31:43 +01:00
Manuel Pégourié-Gonnard
632667e394 Remove useless dependency from test function
This dependency was never right in the first place.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2025-01-22 10:31:19 +01:00
Gilles Peskine
18e4b3f08b
Merge pull request #9857 from gilles-peskine-arm/psa-storage-test-cases-never-supported-negative-3.6
Backport 3.6: Switch generate_psa_test.py to automatic dependencies for negative test cases
2025-01-20 18:44:52 +00:00
Gilles Peskine
a6c1f56a36 Add ignore list entries for ECDH/FFDH algorithm without key type
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-01-20 15:55:56 +01:00
Gilles Peskine
a2a0c394dd Remove test coverage exceptions that are no longer needed
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-01-20 15:55:56 +01:00
Gilles Peskine
8e07e27d9b Update framework
Catch up with https://github.com/Mbed-TLS/mbedtls-framework/pull/104 =
"Switch generate_psa_test.py to automatic dependencies for negative test cases"

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-01-20 15:55:54 +01:00
Ronald Cron
c1b1aa3148
Merge pull request #9903 from Harry-Ramsey/independent-check-files-3.6
[Backport 3.6] Independent check files
2025-01-15 16:43:34 +00:00
Harry Ramsey
61a1281503 Update framework pointer
This commit updates the framework pointer to include updated
check_files.py.

Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
2025-01-15 14:23:12 +00:00
David Horstmann
680d5bbb68
Merge pull request #9890 from gilles-peskine-arm/psa-storage-test-cases-never-supported-negative-preamble-3.6
PSA interruptible sign/verify: detect invalid curve family in start
2025-01-15 11:01:40 +00:00
Manuel Pégourié-Gonnard
19f17e402a Stop recommended deprecated function in migration guide
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2025-01-14 12:36:50 +01:00
Ronald Cron
d975184ef5
Merge pull request #9902 from ronald-cron-arm/crypto-config-default-path-3.6
Simplify crypto config default path setting
2025-01-14 11:27:14 +00:00
Ronald Cron
6f834e947f
Merge pull request #9889 from valeriosetti/issue101-3.6
[Backport 3.6] Move pkgconfig.sh to the framework
2025-01-14 10:30:40 +00:00
Ronald Cron
b248b50c2d config.py: Simplify crypto config default path setting
In 3.6, it can be only include/psa/crypto_config.h

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2025-01-14 10:24:53 +01:00
Valerio Setti
03b42ad028 framework: update reference
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2025-01-14 09:48:18 +01:00
Valerio Setti
bb71bb568b components-build-system.sh: align component_test_cmake_as_package
Align component_test_cmake_as_package to the "development" branch
version.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2025-01-14 09:48:05 +01:00
Valerio Setti
167b329e03 Move files out of Mbed TLS
The following files are moved to the framework repo (deleted here):

tests/scripts/pkgconfig.sh

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2025-01-14 09:48:05 +01:00
Ronald Cron
b0f5f6aa3b
Merge pull request #9864 from valeriosetti/issue86-3.6
[Backport 3.6] Move most of min_requirements.py to the framework
2025-01-13 17:27:39 +00:00
Valerio Setti
f8aae43282 framework: update reference
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2025-01-13 13:18:48 +01:00
Valerio Setti
3d82c25047 scripts: add new min_requirements.py script
This call into the "old" script that has been moved to the framework
repository. The *.requirements.txt files are kept on this repo though.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2025-01-13 13:18:36 +01:00
Valerio Setti
daee50c522 Move files out of Mbed TLS
The following files are moved to the framework repo (deleted here):

scripts/min_requirements.py

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2025-01-13 13:18:36 +01:00
Ronald Cron
f8eba54cf1
Merge pull request #9854 from valeriosetti/issue73-3.6
[Backport 3.6] Move tests/scripts/check_names.py to the framework
2025-01-09 18:03:49 +00:00
Gilles Peskine
abf9f1aaa5 PSA interruptible sign/verify: detect invalid curve family in start
Detect attempts to do ECDSA with a Montgomery curve in psa_sign_hash_start()
and psa_verify_hash_start(), whereas before start() would succeed and
complete() would fail. This avoids an inconsistency between psa_sign_hash()
and psa_sign_hash_start() that would be annoying to handle in
test_suite_psa_crypto_op_fail.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-01-09 18:42:14 +01:00
Valerio Setti
b1f39e8314 framework: update reference
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2025-01-09 17:05:43 +01:00
Valerio Setti
87f988545a component-basic-checks: fix paths of files moved to framework
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2025-01-09 17:05:21 +01:00
Valerio Setti
7892bcc18b Move files out of Mbed TLS
The following files are moved to the framework repo (deleted here):

tests/scripts/check_names.py

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2025-01-09 17:05:21 +01:00