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 <valerio.setti@nordicsemi.no>
This commit is contained in:
Valerio Setti 2023-05-26 13:50:20 +02:00
parent ff7f861761
commit 64f790f662

View file

@ -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: