Commit Graph

40 Commits

Author SHA1 Message Date
Valerio Setti 9b92164c47 Merge pull request #280 from ronald-cron-arm/tf-psa-crypto-reorg-prep
Prepare for TF-PSA-Crypto repository reorganization
2026-03-07 14:07:50 +01:00
Ronald Cron 055618425f check_names.py: Add dispatch, extras, platform and utilities directories
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2026-02-23 08:17:50 +01:00
Gilles Peskine bd6dfd6d8a Fix check_names complaints about *_platform_requirements.h
Platform requirement headers are expected to define macro names
outside of our namespace.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-02-21 21:45:27 +01:00
Gilles Peskine b2eb76d575 Revert "Fix check_names complaints about *_platform_requirements.h"
This reverts commit 5452c7747b.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-02-21 21:45:20 +01:00
Gilles Peskine 5452c7747b Fix check_names complaints about *_platform_requirements.h
Platform requirement headers are expected to define macro names
outside of our namespace.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-02-19 17:18:03 +01:00
Gilles Peskine 390abf3b39 Fix compatibility with old CMake
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-01-19 12:36:38 +01:00
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
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
Gilles Peskine d6f03a4329 Document wildcard matching
The include and exclude lists use different library functions which have
different semantics for wildcards.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-11-19 19:52:05 +01:00
Gilles Peskine 16236cb8a2 Remove redundant entry in glob list
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-11-19 19:47:02 +01:00
Gilles Peskine 30bea3d767 Be more robust about exact paths
Don't insist so much on exact directory and file names. In particular, be
tolerant to new subdirectories of `include` directories.

The resulting list of files is almost the same, except that a few more
Everest files are getting parsed, which is harmless (and perhaps technically
a bug fix).

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-11-17 23:50:13 +01:00
Gilles Peskine 26adfccaaa Log which files get parsed
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-11-17 23:50:13 +01:00
Gilles Peskine fbb7e52304 Avoid splitting file names across lines in problem reports
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-11-17 23:50:13 +01:00
Ronald Cron b5a1095c25 Use cmake --build instead of make
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2025-09-10 16:36:09 +02:00
Ronald Cron c07d90a2ef Prepare check_names.py for the deprecation of Make
We now use CMake to build the Mbed TLS libraries
in both the development and 3.6 cases.
This change aligns with what is already done for
TF-PSA-Crypto.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2025-09-10 16:36:09 +02:00
Anton Matkin 6cb0bcb7d8 Added the private headers to the check_names.py script for the mbedtls main repository
Signed-off-by: Anton Matkin <anton.matkin@arm.com>
2025-08-29 09:29:01 +02:00
Anton Matkin 9a3b3e863d Fix check_names.py script, now accounts for newly moved headers too
Signed-off-by: Anton Matkin <anton.matkin@arm.com>
2025-07-22 09:34:18 +02:00
David Horstmann f3acf7a274 Require _crypto part in names
Previously we allowed tf_psa_xyz / TF_PSA_XYZ. Change to allow only
tf_psa_crypto_xyz / TF_PSA_CRYPTO_XYZ.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2025-07-16 16:16:08 +01:00
David Horstmann b0be9adb9a Allow the tf_psa prefix for functions
Allow functions to have the prefix 'tf_psa' in check_names.py. This is
needed for new functions added in TF-PSA-Crypto.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2025-07-16 15:08:58 +01:00
Ronald Cron aec8420780 check_names: Do not parse driver libraries
Do not parse driver libraries anymore.
They are currently empty while we are
doing the transition to one crypto
library and will be removed soon.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2025-07-09 10:01:09 +02:00
Ben Taylor 74cf30c4e1 Re-add paths needed for 3.6
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2025-05-23 14:31:49 +01:00
Ben Taylor 8ac97f5fe8 Restore old names as these are still required to support older versions
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2025-05-23 14:31:49 +01:00
Ben Taylor 249ea0e215 reverted last commit
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2025-05-23 14:31:49 +01:00
Ben Taylor 5dad3ab9e1 Remove references to everest headers
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2025-05-23 14:31:49 +01:00
Ben Taylor f63a240143 Update everest include paths in framework
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2025-05-23 14:31:49 +01:00
Felix Conway bf36088bd3 Adjust scripts to accommodate public header move
Signed-off-by: Felix Conway <felix.conway@arm.com>
2025-04-09 10:24:07 +01:00
Harry Ramsey e65f684879 Refactor TFPSACryptoCodeParser in check_names.py
This commit refactors TFPSACryptoCodeParser to throw exceptions for
usage in MbedTLS 3.6 as it is not compatible. This commit also removes
comments not related to building TF-PSA-Crypto.

Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
2025-01-30 14:56:33 +00:00
Harry Ramsey eaaf91ecd9 Refactor MBEDTLSCodeParer in check_names.py
This commit refactors MBEDTLSCodeParser to contain code necessary for
obtaining the required parse results from TF-PSA-Crypto.

Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
2025-01-30 14:51:28 +00:00
Harry Ramsey b54f3279b7 Improve documentation of check_names.py
This commit improves the documentation of check_names.py specifically
for the new class MBEDTLSCodeParser and TFPSACryptoCodeParser.

Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
2025-01-30 14:51:28 +00:00
Harry Ramsey a58d44adbe Remove psa include for Mbed TLS Code Parser
This commit removes unncessary TF-PSA-crypto includes for the Mbed TLS
code parser class.

Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
2025-01-30 14:51:28 +00:00
Harry Ramsey f1367be905 Fix pylint errors
This commit fixes numerous pylint errors where possible. For simplicty,
it is easier to keep the many arguments instead of refactoring into an
object.

Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
2025-01-30 14:51:25 +00:00
Harry Ramsey 9c5b278942 Enable independent TF-PSA-Crypto name checks
This commit separates CodeParser into three classes. CodeParser a base
class containing methods for parsing .c and .h files as well as
retrieving symbols from compiled libraries.

As well as two subclasses of CodeParser: TF-PSA-Crypto_CodeParser and
MBEDTLS_CodeParser, which are responsible for parsing the TF-PSA-Crypto
and Mbed TLS libraries.

Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
2025-01-24 14:29:55 +00:00
Valerio Setti 7e5b36d86c check_names.py: support both development and 3.6 branches
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-12-13 17:39:26 +01:00
Valerio Setti 19adbd258b Move files into the framework
The following files are added (imported) from the main Mbed TLS repo:

scripts/check_names.py

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-12-13 16:23:20 +01:00