From 64f790f6620dc0312400c587c5750c50b6e9a16d Mon Sep 17 00:00:00 2001 From: Valerio Setti Date: Fri, 26 May 2023 13:50:20 +0200 Subject: [PATCH] test: fix python script for PSA test generation This is a temporary fix for replacing PSA_WANT_KEY_TYPE_[RSA/ECC]_KEY_PAIR with the temporary symbols MBEDTLS_PSA_WANT_KEY_TYPE_[RSA/ECC]_KEY_PAIR_LEGACY. Once new PSA_WANT_KEY_TYPE_[RSA/ECC]_KEY_PAIR_yyy will be used both in library's code and tests, then this fix will be removed. Signed-off-by: Valerio Setti --- tests/scripts/generate_psa_tests.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/scripts/generate_psa_tests.py b/tests/scripts/generate_psa_tests.py index 214ce838c2..b15a7eb989 100755 --- a/tests/scripts/generate_psa_tests.py +++ b/tests/scripts/generate_psa_tests.py @@ -35,6 +35,14 @@ from mbedtls_dev import test_data_generation def psa_want_symbol(name: str) -> str: """Return the PSA_WANT_xxx symbol associated with a PSA crypto feature.""" + # PSA_WANT_KEY_TYPE_[RSA/ECC]_KEY_PAIR symbols are deprecated and they should + # be replaced soon with newer PSA_WANT_KEY_TYPE_[RSA/ECC]_KEY_PAIR_yyy in + # library's code and tests. Until this happen though, they have been + # renamed to temporary internal symbols + # MBEDTLS_PSA_WANT_KEY_TYPE_[RSA/ECC]_KEY_PAIR_LEGACY so this is what must + # be used in tests' dependencies. + if name.endswith('RSA_KEY_PAIR') or name.endswith('ECC_KEY_PAIR'): + return 'MBEDTLS_' + name[:4] + 'WANT_' + name[4:] + '_LEGACY' if name.startswith('PSA_'): return name[:4] + 'WANT_' + name[4:] else: