From c113b42fc19983b12ac0392612a1e41e587a7b38 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Wed, 10 Apr 2024 16:27:19 +0200 Subject: [PATCH] hack_dependencies_not_implemented: Also read inferred PSA_WANT symbols To determine PSA mechanisms that are not implemented, also read PSA_WANT symbols that cannot (or are not intended to) be configured independently, and thus are not listed in psa/crypto_config.h. Find those symbols in the config adjustment header mbedtls/config_psa.h. No impact on generated files yet, because hack_dependencies_not_implemented is currently only used on key types that have explicit dependencies. This will allow using hack_dependencies_not_implemented in other places, for example to handle algorithm variants like PSA_WANT_ALG_ECDSA_ANY which is inferred from PSA_WANT_ALG_ECDSA. Signed-off-by: Gilles Peskine --- scripts/mbedtls_dev/psa_information.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/mbedtls_dev/psa_information.py b/scripts/mbedtls_dev/psa_information.py index 5f62606457..4ec0695c82 100644 --- a/scripts/mbedtls_dev/psa_information.py +++ b/scripts/mbedtls_dev/psa_information.py @@ -70,6 +70,8 @@ def hack_dependencies_not_implemented(dependencies: List[str]) -> None: if _implemented_dependencies is None: _implemented_dependencies = \ read_implemented_dependencies('include/psa/crypto_config.h') + _implemented_dependencies = _implemented_dependencies.union( + read_implemented_dependencies('include/mbedtls/config_psa.h')) for dep in dependencies: dep = dep.lstrip('!') if dep.startswith('PSA_WANT') and dep not in _implemented_dependencies: