New config: full_non_deprecated

Enable everything that can be tested together and isn't deprecated.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
Gilles Peskine 2020-04-12 14:17:16 +02:00
parent 90581ee629
commit be1d609c19

View file

@ -296,6 +296,28 @@ def crypto_adapter(adapter):
return adapter(name, active, section) return adapter(name, active, section)
return continuation return continuation
DEPRECATED = frozenset([
'MBEDTLS_SSL_PROTO_SSL3',
'MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO',
])
def non_deprecated_adapter(adapter):
"""Modify an adapter to disable deprecated symbols.
``non_deprecated_adapter(adapter)(name, active, section)`` is like
``adapter(name, active, section)``, but unsets all deprecated symbols
and sets ``MBEDTLS_DEPRECATED_REMOVED``.
"""
def continuation(name, active, section):
if name == 'MBEDTLS_DEPRECATED_REMOVED':
return True
if name in DEPRECATED:
return False
if adapter is None:
return active
return adapter(name, active, section)
return continuation
class ConfigFile(Config): class ConfigFile(Config):
"""Representation of the Mbed TLS configuration read for a file. """Representation of the Mbed TLS configuration read for a file.
@ -457,6 +479,10 @@ if __name__ == '__main__':
Exclude alternative implementations and platform support Exclude alternative implementations and platform support
options, as well as some options that are awkward to test. options, as well as some options that are awkward to test.
""") """)
add_adapter('full_non_deprecated', non_deprecated_adapter(full_adapter),
"""Uncomment most non-deprecated features.
Like "full", but without deprecated features.
""")
add_adapter('realfull', realfull_adapter, add_adapter('realfull', realfull_adapter,
"""Uncomment all boolean #defines. """Uncomment all boolean #defines.
Suitable for generating documentation, but not for building.""") Suitable for generating documentation, but not for building.""")