Skip to content

Update abi_check.py to support standalone tf-psa-crypto#229

Merged
bensze01 merged 1137 commits into
Mbed-TLS:mainfrom
bensze01:abicheck-port
Dec 22, 2025
Merged

Update abi_check.py to support standalone tf-psa-crypto#229
bensze01 merged 1137 commits into
Mbed-TLS:mainfrom
bensze01:abicheck-port

Conversation

@bensze01

@bensze01 bensze01 commented Oct 22, 2025

Copy link
Copy Markdown
Contributor

Description

Move abi_check.py to the framework, and update it to support a standalone tf-psa-crypto

PR checklist

amtkarm1 and others added 30 commits August 12, 2025 13:50
Signed-off-by: Anton Matkin <anton.matkin@arm.com>
Signed-off-by: Anton Matkin <anton.matkin@arm.com>
Signed-off-by: Anton Matkin <anton.matkin@arm.com>
Signed-off-by: Anton Matkin <anton.matkin@arm.com>
… now disallowed, changed to concrete jpake algorithm (with SHA256 hash)

Signed-off-by: Anton Matkin <anton.matkin@arm.com>
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
…thout_heap

Enable p192[k|r]1 curves which are disabled by default in tf-psa-crypto.
This is required to get the proper test coverage otherwise there are
tests in 'test_suite_psa_crypto_op_fail' that would never be executed.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
Move the PAKE hash algorithm parameter into the alg id
tests: configuration-crypto: enable p192 curves in test_psa_crypto_without_heap
Return a const char* instead of taking a char* as an argument.

This aligns us with the interface used in TF PSA Crypto.

Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
Previously these tests used values that will become PSA aliases,
and so the tests will fail once they're changed.

Signed-off-by: Felix Conway <felix.conway@arm.com>
Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
Signed-off-by: Felix Conway <felix.conway@arm.com>
Signed-off-by: Felix Conway <felix.conway@arm.com>
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
Signed-off-by: Felix Conway <felix.conway@arm.com>
Signed-off-by: Felix Conway <felix.conway@arm.com>
Add more detail around how generation of configuration-independent files
chooses a C compiler. Mention that setting HOSTCC or CC is recommended
where there are multiple toolchains.

Mention that the fallback location is the cc executable, which may help
users troubleshooting when the file generation picks up the wrong
toolchain (as in Mbed-TLS/mbedtls#10360).

Signed-off-by: David Horstmann <david.horstmann@arm.com>
…PTO_RNG_HASH

Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
…tion-cc

Clarify use of `CC` and friends for file generation
Remove all references to MBEDTLS_ECDSA_DETERMINISTIC from
components-configuration-crypto.sh. Replace them with
PSA_WANT_ALG_DETERMINISTIC_ECDSA.

This is safe because:
* MBEDTLS_ECDSA_DETERMINISTIC is only ever unset in components in order
  to avoid errors from disabling its dependency MBEDTLS_HMAC_DRBG_C.
* MBEDTLS_ECDSA_DETERMINISTIC is only ever defined in
  config_adjust_legacy_from_psa.h, and only if
  PSA_WANT_ALG_DETERMINISTIC_ECDSA is defined.

Therefore PSA_WANT_ALG_DETERMINISTIC_ECDSA's dependencies are a superset
of MBEDTLS_ECDSA_DETERMINISTIC's dependencies and must include
MBEDTLS_HMAC_DRBG_C, so disabling PSA_WANT_ALG_DETERMINISTIC_ECDSA is a
sufficient substitute for disabling MBEDTLS_ECDSA_DETERMINISTIC.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
…ent directory CMakeLists.txt file

Signed-off-by: Felix Conway <felix.conway@arm.com>
Signed-off-by: Anton Matkin <anton.matkin@arm.com>
…ograms

Signed-off-by: Anton Matkin <anton.matkin@arm.com>
Signed-off-by: Felix Conway <felix.conway@arm.com>
Signed-off-by: Felix Conway <felix.conway@arm.com>
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
…o_rng_hash

crypto_config: Introduce MBEDTLS_PSA_CRYPTO_RNG_HASH (2/4)
Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
Argparse generally uses a return code of 2 for these situations.

Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
The same library may be present in the same build tree, eg.
libtfpsacrypto.so, which gets copied from the tf-psa-crypto/core/ to
library/ during an Mbed TLS build.

Make sure that the duplicated libraries are byte-for-byte identical,
otherwise abort the test.

Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
No functional changes.

Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
The only value that depended on us being in the project root was repo_path.

Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
The actual scripts will continue to live in the individual repositories.

Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
The default formatter coalesces all whitespace and reflows the text.

Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
Use `find` to sort scripts/abi_check.py into a separate invocation of pylint.

Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
@gilles-peskine-arm

Copy link
Copy Markdown
Contributor

@minosgalanakis This moves the file abi_check.py from mbedtls to mbedtls-framework, with its history. So it's pulling in the history of mbedtls (which was already mostly there from previous similar moves).

To review, check the following:

@bensze01

Copy link
Copy Markdown
Contributor Author

2 more things that might be good to check:

@gilles-peskine-arm gilles-peskine-arm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM at 12fe6e3 except for reporting pylint errors.

Comment thread scripts/check-python-files.sh
@gilles-peskine-arm gilles-peskine-arm added needs-work and removed needs-review Every commit must be reviewed by at least two team members. needs-ci Needs to pass CI tests needs-reviewer This PR needs someone to pick it up for review labels Dec 19, 2025

@gilles-peskine-arm gilles-peskine-arm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM at 12fe6e3

@minosgalanakis minosgalanakis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@github-project-automation github-project-automation Bot moved this from In Development to Has Approval in Roadmap pull requests (new board) Dec 22, 2025
@bensze01 bensze01 merged commit 7e8ddd4 into Mbed-TLS:main Dec 22, 2025
2 checks passed
@github-project-automation github-project-automation Bot moved this from Has Approval to Done in Roadmap pull requests (new board) Dec 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request priority-high High priority - will be reviewed soon

Development

Successfully merging this pull request may close these issues.

10 participants