35109 Commits

Author SHA1 Message Date
Gilles Peskine ab1a43e781 check_names: Use the same Python executable instead of python3
Fix build failure in environments where `python3` doesn't exist or is too
old.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-01-19 12:34:34 +01:00
Valerio Setti 069cfbd43c Merge pull request #10564 from valeriosetti/issue10380-mbedtls
Remove unused script `set_psa_test_dependencies.py`
2026-01-16 15:11:14 +00:00
Gilles Peskine 18525876aa check_names: allow pqcp driver to configure mldsa-native
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-01-15 19:31:32 +01:00
Gilles Peskine 0c94e7d164 check_names: Allow mldsa-native symbols to be undeclared
The mldsa-native and mlkem-native headers use preprocessor tricks to
construct identifiers. We can't recognize those. So f a symbol found in the
binary is in the expected sub-namespace for those parts of the library,
allow it to be undeclared.

Make the exception general enough for mldsa-native (needed now) and
mlkem-native (needed soon).

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-01-15 19:31:27 +01:00
Gilles Peskine dd06b4989f check_names: tighten the pattern for internal macros
The pattern for internal macros was weird, in part, because of the unusual
short names we use in bignum code. Make the pattern stricter, but add an
exception mechanism. Declare an exception for those bignum names, but
allow them only in bignum code.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-01-15 19:23:27 +01:00
Gilles Peskine 21007fc2bc check_names: use set, not list, when only testing membership
It's both clearer and faster.

No semantic change.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-01-15 18:09:14 +01:00
Gilles Peskine 2f01eca203 check_names: add type annotations
I needed that to understand how the data is represented (str vs Match, list
vs set vs tuple, ...).

No semantic change.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-01-15 18:09:08 +01:00
Gilles Peskine 8caa0e42ab check_names: Use dedicated class for parse results
Use a typed namespace instead of a dictionary with heterogenously typed values.

No semantic change.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-01-15 18:08:56 +01:00
Gilles Peskine 8b6217bba8 check_names: don't build what we don't need
We only look at symbols in the library, so don't bother building tests.

No semantic change.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-01-15 18:08:46 +01:00
Valerio Setti b392da5c46 Merge pull request #257 from valeriosetti/issue598-framework
[framework] tests: pk: add a common function to create a PSA key out of predefined keys
2026-01-15 16:55:35 +01:00
Gilles Peskine d49372176f Merge pull request #10551 from bjwtaylor/remove-drbg-modules
Remove use of DRBG modules from sample programs
2026-01-15 12:14:24 +00:00
Valerio Setti c32c5064c0 tests: pk_helpers: fix code style
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-01-15 10:11:37 +01:00
Ben Taylor fe3f378eec Restore mbedtls_memory_buffer_alloc_free_and_self_test, as it is still required
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-01-15 08:38:06 +00:00
Ben Taylor 4569547e59 Add fixes for defines in selftest
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-01-15 07:56:29 +00:00
Valerio Setti 73c4f2e5d6 tests: pk_helpers: improve documentation of pk_context_populate_method_t
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-01-14 23:33:50 +01:00
Valerio Setti 4eebe42a11 tests: pk_helpers: optimize failure reporting in mbedtls_pk_helpers_populate_context
Keep TEST_EQUAL() on the function that might fail so that if a failure
happen the message will report the actual function that failed.

Documentation of the helper function is also updated.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-01-14 23:09:35 +01:00
Ben Taylor 842d2d948c Re-add mbedtls_entropy_self_test_wrapper
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-01-14 13:18:33 +00:00
Ben Taylor b300692011 Remove some headers from ssl_test_lib.h, as they are no longer required
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-01-14 13:09:15 +00:00
Ben Taylor dcf7670825 Add further rng removals highlighted by the ci
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-01-14 13:01:23 +00:00
Ben Taylor 7d71244dc3 Remove rng_context_t, as it is no longer useful
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-01-14 13:01:23 +00:00
Ben Taylor 767a3655e5 Remove f_rng p_rng, as these are no longer used
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-01-14 13:01:23 +00:00
Ben Taylor b6cccdf8b5 Replace mbedtls_psa_get_random
Replace mbedtls_psa_get_random with psa_generate_random, as this is a backwards
compatibility layer that is now longer required

Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-01-14 13:01:23 +00:00
Ben Taylor 552f31410c Re-add the HMAC_DRBG and CTR_DRBG are cryptographic modules as they are still required
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-01-14 13:01:22 +00:00
Ben Taylor 79002cc990 Remove rng_get from sample programs, as it is no longer required
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-01-14 13:01:22 +00:00
Ben Taylor 99ec289535 Remove duplicated reproducable
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-01-14 13:01:22 +00:00
Ben Taylor eace7ca23f Remove double initialisation of psa
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-01-14 13:01:22 +00:00
Ben Taylor fe978ac1f3 Remove Deprecated Items From Sample Programs
Remove the drbg module and entropy functions from the sample programs as these are
now handled by their PSA equivalents

Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-01-14 13:01:22 +00: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
Valerio Setti 2d7c5cb574 tests: pk_helpers: fix outer guard in functions implementation
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-01-14 12:54:37 +01:00
Valerio Setti 43e4dc061d tests: pk_helpers: update documentation
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-01-14 12:54:10 +01:00
Valerio Setti 2b3cc12c01 tests: pk_helpers: let all helper function return an error code
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-01-14 12:53:25 +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 fef622c2d0 Merge pull request #10559 from valeriosetti/fix-not-grep
tests: scripts: configuration-crypto: fix paths for "not grep"
2026-01-12 14:48:35 +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
Gilles Peskine fceee93024 Add drivers/pqcp/include to C include paths
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-01-12 13:26:25 +01:00