Skip to content

Commit 08bdf6b

Browse files
Merge pull request #183 from ronald-cron-arm/remove-legacy-crypto-options-preparation-1
Remove legacy crypto options preparation-1
2 parents d5d1629 + c67df9a commit 08bdf6b

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

scripts/all-helpers.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,9 @@ helper_psasim_config() {
149149
scripts/config.py unset MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED
150150
scripts/config.py unset MBEDTLS_ECP_RESTARTABLE
151151
scripts/config.py unset MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER
152+
153+
scripts/config.py unset-all MBEDTLS_SHA256_USE_.*_CRYPTO_
154+
scripts/config.py unset-all MBEDTLS_SHA512_USE_.*_CRYPTO_
152155
else
153156
scripts/config.py crypto_full
154157
scripts/config.py unset MBEDTLS_PSA_CRYPTO_BUILTIN_KEYS

scripts/check_names.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -812,9 +812,6 @@ def parse_symbols(self):
812812

813813
# Perform object file analysis using nm
814814
symbols = self.parse_symbols_from_nm([
815-
build_dir + "/drivers/builtin/libbuiltin.a",
816-
build_dir + "/drivers/p256-m/libp256m.a",
817-
build_dir + "/drivers/everest/libeverest.a",
818815
build_dir + "/core/libtfpsacrypto.a"
819816
])
820817

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)