32430 Commits

Author SHA1 Message Date
Minos Galanakis
41325bca41 prepare_release.sh: Added psed helper function
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2025-10-30 09:28:20 +00:00
Gilles Peskine
0e59579358 Test with bad data in storage: support existing built-in or volatile key
When testing what happens with when accessing a key ID in the built-in or
volatile range and a file exists in storage, we were skipping the test case
when the key existed. When the volatile or built-in key exists, the
expectations on the test case are wrong, but the test case is still useful:
we should ensure that the existence of the file doesn't somehow prevent
access to the built-in or volatile key. So, instead of skipping, change the
test assertions on the fly to ensure that we are accessing the existing key.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-10-29 23:10:00 +01:00
Valerio Setti
e2b0e94592 tests: suite_psa_crypto_persistent: fix formatting
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2025-10-29 23:10:00 +01:00
Gilles Peskine
32dbf968c8 Test with bad data in storage: key IDs
Test what happens when the application tries to access a key and the storage
contains something invalid: either a corrupted file, or a key ID that's
outside the standard range for persistent keys.

Coverage of APIs in this commit:

* `psa_get_key_attributes()` (generally as a proxy for any key access);
* `psa_export_key()` (minor, but does provide some coverage of what happens
  if only the key material is corrupted);
* `psa_destroy_key()`, which hopefully should work even for a corrupted file.

Coverage of key IDs in this commit:

* Key IDs in various ranges: user (i.e. the normal range for persistent
  keys), builtin, volatile, reserved file ID, none of the above.
* Includes coverage for nonzero owner ID.

No coverage of corrupted files in this commit.

Assert the behavior that I think is the right thing. Subsequent commits will
reconcile the library behavior with the code as needed.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-10-29 23:09:59 +01:00
Gilles Peskine
3e5d0c1202 Test key identifier ranges
Add some assertions on the various ranges of key identifiers to ensure that
they're disjoint and they comply with documented guarantees.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-10-29 23:07:11 +01:00
minosgalanakis
2cd2fae204
Merge pull request #10470 from Begasus/mbedtls-3.6
Use GNUInstallDirs CMAKE_INSTALL_INCLUDEDIR path for headers installation
2025-10-29 15:21:38 +00:00
Jan Wille
8d59423fe5 format: apply suggestions (add spaces)
Signed-off-by: Jan Wille <jan.wille@siemens.com>
2025-10-29 15:50:57 +01:00
Jan Spannberger
73d5398f02 add cast to fix IAR compiler errors
IAR throws a warning "mixed ENUM with other type"

backport of a5384bdf09

Signed-off-by: Jan Spannberger <jan.spannberger@siemens.com>
2025-10-28 15:14:30 +01:00
Valerio Setti
2a9a272bdb changelog: prevent loading peristent keys if the key ID is in the volatile range
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2025-10-27 11:16:36 +01:00
Valerio Setti
1b93588d93 psa_crypto_slot_management: check key ID range when loading a persistent key
Do not try to load a persistent key whose key ID is in the volatile range.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2025-10-27 11:12:07 +01:00
Ben Taylor
82d2fb8720 Update lcov.sh paths in make files
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2025-10-24 12:03:59 +01:00
Ben Taylor
6d4abb4377 Remove lcov.sh as this will be moved to the framework
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2025-10-24 12:03:59 +01:00
Ben Taylor
567aadbd63 Update framework module
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2025-10-24 12:03:59 +01:00
Luc Schrijvers
7a399a6ed6 Add library/CMakeList.txt to the changes
Signed-off-by: Luc Schrijvers <begasus@gmail.com>
2025-10-24 13:00:40 +02:00
Schrijvers Luc
9644a688f3
Update ChangeLog.d/gnuinstalldirs_include.txt
Co-authored-by: Ronald Cron <ronald.cron@arm.com>
Signed-off-by: Schrijvers Luc <begasus@gmail.com>
2025-10-24 10:59:27 +02:00
Luc Schrijvers
08d88fcf72 add changelog change
Signed-off-by: Luc Schrijvers <begasus@gmail.com>
2025-10-24 09:32:02 +02:00
Janos Follath
94700198fb Remove dead code
Signed-off-by: Janos Follath <janos.follath@arm.com>
2025-10-23 14:43:52 +01:00
Luc Schrijvers
b044efeb61 Use GNUInstallDirs CMAKE_INSTALL_INCLUDEDDIR path for headers installation
Signed-off-by: Luc Schrijvers <begasus@gmail.com>
2025-10-23 11:37:58 +02:00
Gilles Peskine
d80b9ff511
Merge pull request #10466 from minosgalanakis/bugfix/reset_gitignore_files
Revert "Added generated files"
2025-10-22 11:09:40 +00:00
Minos Galanakis
ddffba970b Revert "Added generated files"
This reverts commit 335197e60cb78d330dc63479a685359578813192.

Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2025-10-22 10:51:01 +01:00
Gilles Peskine
6dacfdc59e
Merge pull request #10447 from valeriosetti/static-key-store-fix-size
[3.6] psa: improve buffer size computation for static key slots
2025-10-20 13:42:04 +00:00
Valerio Setti
a8ff9f76e9 changelog: add note about MBEDTLS_PSA_STATIC_KEY_SLOT_BUFFER_SIZE improvements
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2025-10-16 16:47:01 +02:00
Valerio Setti
5306324015 psa: crypto_extra: update documentation of MBEDTLS_PSA_STATIC_KEY_SLOT_BUFFER_SIZE
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2025-10-16 16:36:50 +02:00
Minos Galanakis
5a3d0214b3 Merge tag 'mbedtls-3.6.5' into mbedtls-3.6.5_mergeback
Mbed TLS 3.6.5

Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2025-10-15 18:41:13 +01:00
Valerio Setti
45574797e7 psa: crypto_extra: improve buffer size computation for static key slots
Take also MAC's key types into account when computing the size of the
buffer to store key material in static key slot configuration.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2025-10-15 16:22:39 +02:00
Janos Follath
be0cef43ea Add ASan to test_sw_inet_pton
Signed-off-by: Janos Follath <janos.follath@arm.com>
2025-10-13 14:11:26 +01:00
minosgalanakis
e185d7fd85
Merge pull request #1428 from Mbed-TLS/mbedtls-3.6.5rc0-pr
Mbedtls 3.6.5RC
v3.6.5 mbedtls-3.6.5
2025-10-13 08:39:14 +01:00
Minos Galanakis
b1db32061c Update BRANCHES.md
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2025-10-10 18:04:55 +01:00
Minos Galanakis
335197e60c Added generated files
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2025-10-10 18:04:55 +01:00
Minos Galanakis
2e1245171c Updated framework pointer
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2025-10-10 18:04:55 +01:00
Minos Galanakis
ad63800090 Version bump for mbedtls-3.5.6
./scripts/bump_version.sh --version 3.6.5

Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2025-10-10 18:04:55 +01:00
Minos Galanakis
369ea7a041 Assemble ChangeLog
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2025-10-10 18:04:55 +01:00
Gilles Peskine
0c4a951b37 Be more precise about the user/peer ID limitation
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
(cherry picked from commit 84a9b26b88c81ec5abc3f7e156acdbcca2664f08)
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2025-10-10 18:04:55 +01:00
Gilles Peskine
7e81fe32d0 Add storage format test case for JPAKE
The storage test generator doesn't support JPAKE at this time. So write a
test case manually.

The key is not exercised, since `psa_exercise_key()` doesn't support PAKE at
this time. But at least we can use this test case to ensure that we know how
the key is represented in storage.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
(cherry picked from commit 98a4029d5169e8f18f3a0c2864794000c9641876)
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2025-10-10 18:04:55 +01:00
Gilles Peskine
90eac7fc7a Document JPAKE limitations
Document limitations on the user ID, peer ID, primitive (elliptic curve) and
hash for `PSA_ALG_JPAKE`.

https://github.com/Mbed-TLS/TF-PSA-Crypto/issues/502
https://github.com/Mbed-TLS/TF-PSA-Crypto/issues/503
https://github.com/Mbed-TLS/TF-PSA-Crypto/issues/504

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
(cherry picked from commit 8ca2a5bf9502431e29d7338a3516bde53b8aa23d)
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2025-10-10 18:04:55 +01:00
minosgalanakis
46dc477c22
Merge pull request #10444 from gilles-peskine-arm/jpake-persistent-key-compat-3.6.5
Backport 3.6: PSA JPAKE: add storage test case and document limitations
2025-10-10 14:45:23 +00:00
Gilles Peskine
84a9b26b88 Be more precise about the user/peer ID limitation
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-10-10 12:08:21 +02:00
Gilles Peskine
42ae2ac6ec
Merge pull request #10318 from keith-packard/gcc-14-3-array-bounds
Avoid invalid gcc 14.3 warning about array bounds in mbedtls_xor
2025-10-08 19:00:48 +00:00
Gilles Peskine
98a4029d51 Add storage format test case for JPAKE
The storage test generator doesn't support JPAKE at this time. So write a
test case manually.

The key is not exercised, since `psa_exercise_key()` doesn't support PAKE at
this time. But at least we can use this test case to ensure that we know how
the key is represented in storage.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-10-08 17:39:23 +02:00
Gilles Peskine
8ca2a5bf95 Document JPAKE limitations
Document limitations on the user ID, peer ID, primitive (elliptic curve) and
hash for `PSA_ALG_JPAKE`.

https://github.com/Mbed-TLS/TF-PSA-Crypto/issues/502
https://github.com/Mbed-TLS/TF-PSA-Crypto/issues/503
https://github.com/Mbed-TLS/TF-PSA-Crypto/issues/504

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-10-08 17:39:23 +02:00
Keith Packard
292b96c0a6 Avoid invalid gcc 14.3 warning about array bounds in mbedtls_xor
The combination of the multi-byte loop with the single byte loop
confuses GCC 14.3's array bounds checker. When the loop size is
constant, check to see if it is a multiple of the multi-byte size and
bail early. As this will be evaluated at compile time, there should be
no run-time cost.

This change uses the __builtin_constant_p compile-time operation. To
check if that is supported, the change uses the existing
MBEDTLS_HAS_BUILTIN macro. That macro was defined later in
library/common.h than is needed for this change, so it was moved up to
join some other macros that looked similar.

Signed-off-by: Keith Packard <keithp@keithp.com>
2025-10-02 11:09:29 -07:00
Janos Follath
db3e6ebebe Add malicious ip test for inet_pton
Signed-off-by: Janos Follath <janos.follath@arm.com>
2025-10-02 16:11:10 +01:00
Minos Galanakis
bafcf5bddf Merge remote-tracking branch 'restricted/mbedtls-3.6-restricted' into mbedtls-3.6.5rc0-pr
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2025-10-02 15:37:04 +01:00
Bence Szépkúti
299ce78166
Merge pull request #10417 from bensze01/abicheck-worktree-submodules-3.6
[3.6 backport] Use submodule work trees during ABI check
2025-09-30 09:41:11 +00:00
Manuel Pégourié-Gonnard
f2021e28c6
Merge pull request #10421 from gilles-peskine-arm/psa-transition-guide-20250630-3.6
Update PSA transition guide for 3.6.5
2025-09-30 09:21:13 +00:00
David Horstmann
3c5efcb61b
Merge pull request #10427 from bjwtaylor/time_t-backport
Backport 3.6: Replace cases of time_t with mbedtls_time_t
2025-09-29 19:35:11 +00:00
Ben Taylor
6e73b2f2fd Backport time_t type conversions
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2025-09-29 15:35:28 +01:00
Gilles Peskine
8701fddbc5 Remove sentence about 1.0 that should not have been backported
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-09-29 15:18:37 +02:00
Bence Szépkúti
616f9fde62 Fix comment too long for pylint
Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
2025-09-29 14:24:25 +02:00
Manuel Pégourié-Gonnard
02b7707b10
Merge pull request #10419 from mpg/fix-udp-proxy-3.6
[3.6] Fix includes in udp_proxy.c
2025-09-29 10:48:02 +00:00