Commit Graph

12753 Commits

Author SHA1 Message Date
Valerio Setti
2a72766d75 Merge pull request #10570 from valeriosetti/issue10349
mbedtls 4.x does not expose mbedtls_ecp_curve_list()
2026-02-03 11:01:11 +00:00
Valerio Setti
c3f585b8ee tests: ssl: fix typo in comment in test_mbedtls_ssl_get_supported_group_list
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2026-01-30 22:02:08 +01:00
Gilles Peskine
068ef9cbe0 Merge pull request #10511 from minosgalanakis/rework/move-psasim
Rework/move psasim
2026-01-28 18:05:59 +00:00
David Horstmann
d0bff58379 Merge pull request #10514 from ng-gsmk/development
mbedtls_ssl_get_alert(): getter for fatal alerts
2026-01-28 16:49:09 +00:00
Valerio Setti
476a2edea7 library: extend mbedtls_ssl_iana_tls_group_info_t structure
Add new field that tells if the corresponding group is supported or not
in the current build.

Test function "test_mbedtls_ssl_get_supported_group_list" is extended
to verify this new feature.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2026-01-28 10:52:07 +01:00
Minos Galanakis
1c2b690389 Test Makefiles: Updated location of psasim
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-01-27 12:07:05 +00:00
Minos Galanakis
097e57874f Moved tests/psa-client-server to framework.
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-01-27 12:07:05 +00:00
Valerio Setti
d658f3d41e tests: ssl: skip testing of MBEDTLS_SSL_IANA_TLS_GROUP_NONE
This is already indirectly checked in 'test_mbedtls_tls_id_group_name_table'
because it's the last item of the list.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2026-01-27 12:26:21 +01:00
Valerio Setti
bb4f584876 tests: ssl: improve test_mbedtls_tls_id_group_name_table()
Check provided group_name also against the value returned from
mbedtls_ssl_get_curve_name_from_tls_id().

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2026-01-27 00:44:56 +01:00
Valerio Setti
fb317afa9f library: ssl: rework macro to define known TLS ID <-> group name list
- let the macro be an initializer for the array of known TLS IDs, not
  a variable declarator;
- last item's group name is NULL, not an empty string
- change then name of the macro from MBEDTLS_TLS_ID_GROUP_NAME_TABLE to
  MBEDTLS_SSL_IANA_TLS_GROUPS_INFO
- define a new public structure "mbedtls_ssl_iana_tls_group_info_t" to
  hold each element of the table and that can be used the go over the
  list from user code.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2026-01-27 00:36:17 +01:00
Nico Geyso
4f83ebedd1 Fix outstanding code review issues
- adjust function name to mbedtls_ssl_get_fatal_alert
- fix missing property name changes for  mbedtls_ssl_context

Signed-off-by: Nico Geyso <ng@gsmk.de>
2026-01-26 13:15:07 +01:00
Valerio Setti
c87adb64f2 tests: ssl: add test for TLS-ID <-> curve-name table
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2026-01-26 11:09:20 +01:00
Valerio Setti
2aecd2cd5f library|tests: ssl: remove secp256k1 from default groups
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2026-01-22 17:13:44 +01:00
Valerio Setti
8686ad1a9e tests: ssl: add testing for mbedtls_ssl_get_supported_group_list()
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2026-01-22 10:33:44 +01:00
Manuel Pégourié-Gonnard
499e3d13f7 Fix more paths for "not grep"
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2026-01-22 10:23:03 +01:00
Valerio Setti
4e2584d681 tests: scripts: remove set_psa_test_dependencies.py
This script was used in the past, but it has since been replaced with
other scripts and nowadays it's no more used anywhere.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2026-01-14 13:34:32 +01:00
Ronald Cron
6370f1c59c Merge pull request #10507 from minosgalanakis/rework/component-configuration-crypto-cmake
Migrate configuration-crypto components to cmake
2026-01-14 07:33:06 +00:00
Valerio Setti
69e117fee0 Merge pull request #10562 from mpg/fix-not-grep
all.sh: fix file paths for "not grep"
2026-01-13 22:08:18 +00:00
Manuel Pégourié-Gonnard
21fa4896b1 all.sh: fix file paths for "not grep"
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2026-01-13 11:24:14 +01:00
Valerio Setti
1919ee4bb4 Merge pull request #10533 from bjwtaylor/remove-pk_get_name
Replace mbedtls_pk_get_name with pk_key_type_to_string
2026-01-13 10:11:51 +00:00
Minos Galanakis
2ad6e5ba6c component-configuration-crypto: Adjusted test_crypto_full_md_light_only
Adjusted component to utilise the CMAKE_BUILTIN_BUILD_DIR

Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-01-12 16:30:33 +00:00
Minos Galanakis
0c297de53c component-configuration-crypto: Changed cleanup order.
Adjusted helper_block_cipher_no_decrypt_build_test to
cleanup the directory after all the tests have been
executed.

Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-01-12 16:30:33 +00:00
Minos Galanakis
67a9123b23 component-configuration-crypto: Changed location of psa-alt-header
build_psa_alt_headers will now generate the headers at
./tests/include/alt-dummy instead of
./framework/tests/include/alt-extra.

Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-01-12 16:30:33 +00:00
Minos Galanakis
69545a87af component-configuration-crypto: Added consistent cmake commands.
Update the previously modified component to use
consistent syntax:
* make -> cmake --build .
* make test -> ctest

Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-01-12 16:30:33 +00:00
Minos Galanakis
8cdccdecd2 component-configuration-crypto: Migrated build_psa_alt_headers
The original make -C tests, contains a perl inliner
to generate the alt-headers. Replicated that logic in
sed regex.

Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-01-12 16:30:33 +00:00
Minos Galanakis
486b6c8252 components-configuration-crypto: Migrated components with custom LDFLAGS to cmake
Certain testing components require building with a specific subset of LDFLAGS,
such as `-O1`. This patch moves them to the default cmake invokation of `cmake .`
which is the equivalent of `cmake -D CMAKE_BUILD_TYPE:String=None .`

Also remove flags such as `-Werror` which are present in all configs.

Improve compilation flag granularity by disabling CMAKE_BUILD_TYPE defaults
and asserting test-specific flags manually.

Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-01-12 16:30:33 +00:00
Minos Galanakis
1fcca1f255 component-configuration-crypto: Migrated component_test_crypto_full_md_light_only to cmake
Use compilation directory for object discovery in out-of-source CMake builds.

Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-01-12 16:30:33 +00:00
Minos Galanakis
5e99591870 components-configuration-crypto: Migrated include dir dependant Release components to cmake
Moved the following components to CMAKE_BUILD_TYPE:String=Release
and adjusted  the include paths for cmake:
* component_build_psa_crypto_spm
* component_test_tfm_config_no_p256m

Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-01-12 16:30:33 +00:00
Minos Galanakis
6db68f929b components-configuration-crypto: Migrated straightforwad Release components to cmake
- By default all unspecified build-type components should be release
- CMAKE_BUILD_TYPE:String=Release enables the following
  CFLAGS: "-O2 -Werror -Wall -Wextra"

Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-01-12 16:30:33 +00:00
Minos Galanakis
279c016d87 components-configuration-crypto: Migrated test_tfm_config_p256m_driver_accel_ec to cmake
Compilation flags, and spe include directories have been adjusted

Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-01-12 16:30:33 +00:00
Minos Galanakis
3baeee8647 components-configuration-crypto: Migrated test_full_static_keystore to cmake
Optimization for size (-Os) is required.

Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-01-12 16:30:33 +00:00
Minos Galanakis
d1307a1d40 components-configuration-crypto: Migrated simple ASAN components.
Migrate all straightfoward components from using $ASAN_CFLAGS
to CMAKE_BUILD_TYPE:String=Asan

Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-01-12 16:30:33 +00:00
Valerio Setti
c58c20d4fa tests: scripts: fix grep paths in test_tfm_config_p256m_driver_accel_ec
Paths for "not grep" should have been updated when the build system
switched from Makefile to CMake.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2026-01-12 13:29:14 +01:00
Ben Taylor
f77d749127 Further updates to ssl-opt tests as wrapped keys now expose the underlying type
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-01-12 08:19:07 +00:00
Ben Taylor
98e958c91e Update ssl-opt tests as wrapped keys now expose the underlying type
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-01-12 08:19:07 +00:00
Ben Taylor
81deeb8a5a Update ssl-opt to remove Opaque key types
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-01-12 08:19:07 +00:00
Valerio Setti
5aba22b3df tests: scripts: configuration-crypto: fix paths for "not grep"
A switch has recently been made from make to cmake to build these tests
but paths for "not grep" were not properly updated.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2026-01-09 22:52:45 +01:00
Valerio Setti
f7173e4389 Merge pull request #10517 from valeriosetti/issue10460
Remove use of pk_debug()
2026-01-09 15:22:13 +00:00
Valerio Setti
fdccbbb91f tests: scripts: configuration-crypto: fix paths after switch to CMake
Switching to CMake build caused some failures due to the fact that:

- binary objects in tf-psa-crypto are not in the same location as before;
- header files from "<mbedtls-root>/include" are no more included when
  building tf-psa-crypto ojects.

This commit fixes both problems.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2026-01-08 17:53:56 +01:00
Ronald Cron
193401cce1 Merge pull request #10544 from gilles-peskine-arm/move-crypto-makefiles
Let crypto own its part of the makefiles
2026-01-08 16:02:56 +00:00
Gilles Peskine
4ffb299208 Remove local copies of makefile helpers
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-01-08 14:57:50 +01:00
Gilles Peskine
e23b6e4dc8 Use the crypto makefile helpers in tf-psa-crypto
Now that the crypto files have been moved to the crypto repository, consume
them there.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-01-08 14:57:50 +01:00
Valerio Setti
059aac8680 tests: scripts: build with cmake in all components using Asan
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2026-01-08 14:33:30 +01:00
Valerio Setti
0294b11967 Merge pull request #10556 from gilles-peskine-arm/sha3-cleanup-202512-prep2
SHA3 cleanup prep: Adapt to the split of test_suite_shax
2026-01-08 12:18:28 +00:00
Valerio Setti
4d62c59a56 tests: scripts: add new component to test with only pkwrite disabled
This is similar to the already existing "component_full_no_pkparse_pkwrite".
The biggest difference is that this new component starts from "full" config
instead of "crypto_full" because we want to test also some TLS modules,
in particular "test_suite_debug" where the new function
"mbedtls_pk_write_pubkey_psa" has been introduced.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2026-01-08 10:32:57 +01:00
Valerio Setti
ebbaca0a99 library: debug: adjust guards for "mbedtls_debug_print_crt"
Keep MBEDTLS_PK_WRITE_C as guard only for "debug_print_pk" but let
"mbedtls_debug_print_crt" to work also when MBEDTLS_PK_WRITE_C is disabled.
In this case the only public key won't be printed, but the rest of the
certificate will be.

This commit also updates test coverage by duplicating test cases: now there
will be one case for when MBEDTLS_PK_WRITE_C is enabled and another one
for !MBEDTLS_PK_WRITE_C.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2026-01-08 10:32:57 +01:00
Valerio Setti
af62bae5c1 library: debug: add PK_WRITE_C guard to mbedtls_debug_print_crt()
In tf-psa-crypto "mbedtls_pk_write_pubkey_psa()" is only available when
MBEDTLS_PK_WRITE_C is defined. Therefore we need to add this guard also
in mbedtls to "debug_print_pk" (and indirectly to
"mbedtls_debug_print_crt") and the corresponding tests using it.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2026-01-08 10:32:57 +01:00
Valerio Setti
3c419c1ca3 tests: scripts: adjust CRT dump test data
Adjust dumping format of public keys following recent updates to
mbedtls_debug_print_crt() and debug_print_pk()

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2026-01-08 10:32:57 +01:00
Valerio Setti
10eaf68acd library: debug: remove mbedtls_debug_print_mpi()
This function is no more used anywhere and can be safely removed.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2026-01-08 10:32:57 +01:00
Gilles Peskine
68b0ad1512 Adapt to the split of test_suite_shax
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-01-07 16:19:48 +01:00