mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-30 22:43:08 +03:00
@ -522,7 +522,7 @@ class ConfigFile(metaclass=ABCMeta):
|
|||||||
with open(filename, 'w', encoding='utf-8') as output:
|
with open(filename, 'w', encoding='utf-8') as output:
|
||||||
self.write_to_stream(settings, output)
|
self.write_to_stream(settings, output)
|
||||||
|
|
||||||
class MbedtlsConfigFile(ConfigFile):
|
class MbedTLSConfigFile(ConfigFile):
|
||||||
"""Representation of an MbedTLS configuration file."""
|
"""Representation of an MbedTLS configuration file."""
|
||||||
|
|
||||||
_path_in_tree = 'include/mbedtls/mbedtls_config.h'
|
_path_in_tree = 'include/mbedtls/mbedtls_config.h'
|
||||||
@ -551,7 +551,7 @@ class CryptoConfigFile(ConfigFile):
|
|||||||
def __init__(self, filename=None):
|
def __init__(self, filename=None):
|
||||||
super().__init__(self.default_path, 'Crypto', filename)
|
super().__init__(self.default_path, 'Crypto', filename)
|
||||||
|
|
||||||
class MbedtlsConfig(Config):
|
class MbedTLSConfig(Config):
|
||||||
"""Representation of the Mbed TLS configuration.
|
"""Representation of the Mbed TLS configuration.
|
||||||
|
|
||||||
See the documentation of the `Config` class for methods to query
|
See the documentation of the `Config` class for methods to query
|
||||||
@ -560,7 +560,7 @@ class MbedtlsConfig(Config):
|
|||||||
def __init__(self, filename=None):
|
def __init__(self, filename=None):
|
||||||
"""Read the Mbed TLS configuration file."""
|
"""Read the Mbed TLS configuration file."""
|
||||||
super().__init__()
|
super().__init__()
|
||||||
self.configfile = MbedtlsConfigFile(filename)
|
self.configfile = MbedTLSConfigFile(filename)
|
||||||
self.settings.update({name: Setting(active, name, value, section)
|
self.settings.update({name: Setting(active, name, value, section)
|
||||||
for (active, name, value, section)
|
for (active, name, value, section)
|
||||||
in self.configfile.parse_file()})
|
in self.configfile.parse_file()})
|
||||||
@ -629,7 +629,7 @@ class MultiConfig(Config):
|
|||||||
|
|
||||||
def __init__(self, mbedtls_filename=None, crypto__filename=None):
|
def __init__(self, mbedtls_filename=None, crypto__filename=None):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
self.mbedtls_configfile = MbedtlsConfigFile(mbedtls_filename)
|
self.mbedtls_configfile = MbedTLSConfigFile(mbedtls_filename)
|
||||||
self.crypto_configfile = CryptoConfigFile(crypto__filename)
|
self.crypto_configfile = CryptoConfigFile(crypto__filename)
|
||||||
self.settings.update({name: Setting(active, name, value, section, configfile)
|
self.settings.update({name: Setting(active, name, value, section, configfile)
|
||||||
for configfile in [self.mbedtls_configfile, self.crypto_configfile]
|
for configfile in [self.mbedtls_configfile, self.crypto_configfile]
|
||||||
@ -737,7 +737,7 @@ if __name__ == '__main__':
|
|||||||
parser.add_argument('--file', '-f',
|
parser.add_argument('--file', '-f',
|
||||||
help="""File to read (and modify if requested).
|
help="""File to read (and modify if requested).
|
||||||
Default: {}.
|
Default: {}.
|
||||||
""".format(MbedtlsConfigFile.default_path))
|
""".format(MbedTLSConfigFile.default_path))
|
||||||
parser.add_argument('--cryptofile', '-c',
|
parser.add_argument('--cryptofile', '-c',
|
||||||
help="""Crypto file to read (and modify if requested).
|
help="""Crypto file to read (and modify if requested).
|
||||||
Default: {}.
|
Default: {}.
|
||||||
|
@ -541,7 +541,7 @@ def main():
|
|||||||
default=True)
|
default=True)
|
||||||
options = parser.parse_args()
|
options = parser.parse_args()
|
||||||
os.chdir(options.directory)
|
os.chdir(options.directory)
|
||||||
conf = config.MbedtlsConfig(options.config)
|
conf = config.MbedTLSConfig(options.config)
|
||||||
domain_data = DomainData(options, conf)
|
domain_data = DomainData(options, conf)
|
||||||
|
|
||||||
if options.tasks is True:
|
if options.tasks is True:
|
||||||
|
Reference in New Issue
Block a user