From efcafca969d2e789cdf106609b04a86ef9b53a3d Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 28 May 2014 05:53:26 +0200 Subject: Simplify configuration of cipher and MAC implementations Let the cipher and MAC handlers just store the chosen implementations themselves instead of relying on the global configuration. --- src/config.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'src/config.c') diff --git a/src/config.c b/src/config.c index ab655e2..8be44bb 100644 --- a/src/config.c +++ b/src/config.c @@ -65,9 +65,6 @@ static void default_config(void) { conf.peer_group = calloc(1, sizeof(fastd_peer_group_t)); conf.peer_group->name = strdup("default"); conf.peer_group->max_connections = -1; - - conf.ciphers = fastd_cipher_config_alloc(); - conf.macs = fastd_mac_config_alloc(); } void fastd_config_protocol(const char *name) { @@ -91,12 +88,12 @@ void fastd_config_method(const char *name) { } void fastd_config_cipher(const char *name, const char *impl) { - if (!fastd_cipher_config(conf.ciphers, name, impl)) + if (!fastd_cipher_config(name, impl)) exit_error("config error: implementation `%s' is not supported for cipher `%s' (or cipher `%s' is not supported)", impl, name, name); } void fastd_config_mac(const char *name, const char *impl) { - if (!fastd_mac_config(conf.macs, name, impl)) + if (!fastd_mac_config(name, impl)) exit_error("config error: implementation `%s' is not supported for MAC `%s' (or MAC `%s' is not supported)", impl, name, name); } @@ -634,9 +631,6 @@ void fastd_config_release(void) { destroy_methods(); fastd_string_stack_free(conf.method_list); - fastd_mac_config_free(conf.macs); - fastd_cipher_config_free(conf.ciphers); - fastd_shell_command_unset(&conf.on_pre_up); fastd_shell_command_unset(&conf.on_up); fastd_shell_command_unset(&conf.on_down); -- cgit v1.2.3