From 323ad1c416d108bb6f101383b2c7cdc8ab07ec9c Mon Sep 17 00:00:00 2001 From: Valerio Setti Date: Fri, 26 May 2023 17:47:55 +0200 Subject: [PATCH] psa: fixing psa_crypto_generate_key.generated This is a temporary fix for not excluding tests which depend on MBEDTLS_PSA_WANT_KEY_TYPE_[RSA/ECC]_KEY_PAIR_LEGACY. This fix can be reverted as soon as those _LEGACY symbols will be removed from the code. Signed-off-by: Valerio Setti --- tests/scripts/generate_psa_tests.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/scripts/generate_psa_tests.py b/tests/scripts/generate_psa_tests.py index b15a7eb98..52f8edaec 100755 --- a/tests/scripts/generate_psa_tests.py +++ b/tests/scripts/generate_psa_tests.py @@ -113,12 +113,19 @@ def read_implemented_dependencies(filename: str) -> FrozenSet[str]: for line in open(filename) for symbol in re.findall(r'\bPSA_WANT_\w+\b', line)) _implemented_dependencies = None #type: Optional[FrozenSet[str]] #pylint: disable=invalid-name +# This is a temporary fix for the KEY_PAIR_LEGACY symbols since they are not +# defined in "crypto_config.h". This fix can be removed as soon as these _LEGACY +# symbols will be removed from the code. +_LEGACY_KEY_PAIR = ['MBEDTLS_PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_LEGACY', + 'MBEDTLS_PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_LEGACY'] def hack_dependencies_not_implemented(dependencies: List[str]) -> None: global _implemented_dependencies #pylint: disable=global-statement,invalid-name if _implemented_dependencies is None: _implemented_dependencies = \ read_implemented_dependencies('include/psa/crypto_config.h') - if not all((dep.lstrip('!') in _implemented_dependencies or 'PSA_WANT' not in dep) + if not all((dep.lstrip('!') in _implemented_dependencies or + 'PSA_WANT' not in dep or + dep.lstrip('!') in _LEGACY_KEY_PAIR) for dep in dependencies): dependencies.append('DEPENDENCY_NOT_IMPLEMENTED_YET')