mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-03-13 04:13:45 +00:00
Don't pass the section name to adapters
We have finished removing the reliance of named configuration on section names. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
parent
36571d6d8a
commit
00b9144608
@ -1 +1 @@
|
||||
Subproject commit 745122dc172a77897df15d9e61fcb8d2dd51230b
|
||||
Subproject commit 2f639b6bf4bcf57c4b1b0afb23ccb657607428bc
|
@ -38,7 +38,7 @@ def is_boolean_setting(name, value):
|
||||
return True
|
||||
return False
|
||||
|
||||
def realfull_adapter(_name, _value, _active, _section):
|
||||
def realfull_adapter(_name, _value, _active):
|
||||
"""Activate all symbols.
|
||||
|
||||
This is intended for building the documentation, including the
|
||||
@ -145,7 +145,7 @@ def include_in_full(name):
|
||||
return is_seamless_alt(name)
|
||||
return True
|
||||
|
||||
def full_adapter(name, value, active, _section):
|
||||
def full_adapter(name, value, active):
|
||||
"""Config adapter for "full"."""
|
||||
if not is_boolean_setting(name, value):
|
||||
return active
|
||||
@ -183,7 +183,7 @@ def keep_in_baremetal(name):
|
||||
return False
|
||||
return True
|
||||
|
||||
def baremetal_adapter(name, value, active, _section):
|
||||
def baremetal_adapter(name, value, active):
|
||||
"""Config adapter for "baremetal"."""
|
||||
if not is_boolean_setting(name, value):
|
||||
return active
|
||||
@ -202,10 +202,10 @@ EXCLUDE_FOR_SIZE = frozenset([
|
||||
'MBEDTLS_TEST_HOOKS', # only useful with the hosted test framework, increases code size
|
||||
])
|
||||
|
||||
def baremetal_size_adapter(name, value, active, section):
|
||||
def baremetal_size_adapter(name, value, active):
|
||||
if name in EXCLUDE_FOR_SIZE:
|
||||
return False
|
||||
return baremetal_adapter(name, value, active, section)
|
||||
return baremetal_adapter(name, value, active)
|
||||
|
||||
def include_in_crypto(name):
|
||||
"""Rules for symbols in a crypto configuration."""
|
||||
@ -226,15 +226,15 @@ def include_in_crypto(name):
|
||||
def crypto_adapter(adapter):
|
||||
"""Modify an adapter to disable non-crypto symbols.
|
||||
|
||||
``crypto_adapter(adapter)(name, value, active, section)`` is like
|
||||
``adapter(name, value, active, section)``, but unsets all X.509 and TLS symbols.
|
||||
``crypto_adapter(adapter)(name, value, active)`` is like
|
||||
``adapter(name, value, active)``, but unsets all X.509 and TLS symbols.
|
||||
"""
|
||||
def continuation(name, value, active, section):
|
||||
def continuation(name, value, active):
|
||||
if not include_in_crypto(name):
|
||||
return False
|
||||
if adapter is None:
|
||||
return active
|
||||
return adapter(name, value, active, section)
|
||||
return adapter(name, value, active)
|
||||
return continuation
|
||||
|
||||
DEPRECATED = frozenset([
|
||||
@ -244,34 +244,34 @@ DEPRECATED = frozenset([
|
||||
def no_deprecated_adapter(adapter):
|
||||
"""Modify an adapter to disable deprecated symbols.
|
||||
|
||||
``no_deprecated_adapter(adapter)(name, value, active, section)`` is like
|
||||
``adapter(name, value, active, section)``, but unsets all deprecated symbols
|
||||
``no_deprecated_adapter(adapter)(name, value, active)`` is like
|
||||
``adapter(name, value, active)``, but unsets all deprecated symbols
|
||||
and sets ``MBEDTLS_DEPRECATED_REMOVED``.
|
||||
"""
|
||||
def continuation(name, value, active, section):
|
||||
def continuation(name, value, active):
|
||||
if name == 'MBEDTLS_DEPRECATED_REMOVED':
|
||||
return True
|
||||
if name in DEPRECATED:
|
||||
return False
|
||||
if adapter is None:
|
||||
return active
|
||||
return adapter(name, value, active, section)
|
||||
return adapter(name, value, active)
|
||||
return continuation
|
||||
|
||||
def no_platform_adapter(adapter):
|
||||
"""Modify an adapter to disable platform symbols.
|
||||
|
||||
``no_platform_adapter(adapter)(name, value, active, section)`` is like
|
||||
``adapter(name, value, active, section)``, but unsets all platform symbols other
|
||||
``no_platform_adapter(adapter)(name, value, active)`` is like
|
||||
``adapter(name, value, active)``, but unsets all platform symbols other
|
||||
``than MBEDTLS_PLATFORM_C.
|
||||
"""
|
||||
def continuation(name, value, active, section):
|
||||
def continuation(name, value, active):
|
||||
# Allow MBEDTLS_PLATFORM_C but remove all other platform symbols.
|
||||
if name.startswith('MBEDTLS_PLATFORM_') and name != 'MBEDTLS_PLATFORM_C':
|
||||
return False
|
||||
if adapter is None:
|
||||
return active
|
||||
return adapter(name, value, active, section)
|
||||
return adapter(name, value, active)
|
||||
return continuation
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user