Skip to content

Commit c67df9a

Browse files
Adapt generate_config_tests.py
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
1 parent edf1c7e commit c67df9a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

scripts/generate_config_tests.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,13 @@ def single_setting_case(setting: config_common.Setting, when_on: bool,
6868
if build_tree.is_mbedtls_3_6():
6969
SIMPLE_DEPENDENCIES['MBEDTLS_NO_PLATFORM_ENTROPY'] = 'MBEDTLS_ENTROPY_C'
7070

71+
BUILTIN_MODULE_ENABLEMENT_MACROS = [
72+
'MBEDTLS_AES_C', 'MBEDTLS_CAMELLIA_C', 'MBEDTLS_CIPHER_C', 'MBEDTLS_GCM_C',
73+
'MBEDTLS_ECDH_C', 'MBEDTLS_ECDSA_C', 'MBEDTLS_ECP_C',
74+
'MBEDTLS_RSA_C',
75+
'MBEDTLS_SHA256_C', 'MBEDTLS_SHA512_C',
76+
]
77+
7178
def dependencies_of_setting(cfg: config_common.Config,
7279
setting: config_common.Setting) -> Optional[str]:
7380
"""Return dependencies without which a setting is not meaningful.
@@ -113,6 +120,11 @@ def dependencies_of_setting(cfg: config_common.Config,
113120
super_name = name[:pos.start()] + '_C'
114121
if cfg.known(super_name):
115122
return super_name
123+
# If super_name refers to a macro that still enables a
124+
# cryptographic module, but is no longer exposed as a configuration
125+
# option in 4.0/1.0, return it as a dependency.
126+
if super_name in BUILTIN_MODULE_ENABLEMENT_MACROS:
127+
return super_name
116128
if name.startswith('PSA_WANT_'):
117129
deps = 'MBEDTLS_PSA_CRYPTO_CLIENT'
118130
m = PSA_WANT_KEY_TYPE_KEY_PAIR_RE.match(name)

0 commit comments

Comments
 (0)