summaryrefslogtreecommitdiffstats
path: root/src/config.c
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2014-05-28 05:53:26 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2014-05-29 01:30:07 +0200
commitefcafca969d2e789cdf106609b04a86ef9b53a3d (patch)
tree001ca30403dea064b4d30bb521d8eb8de91f10a3 /src/config.c
parentd5da100c55d80391d2e941a41c0e0dccf2a6e33e (diff)
downloadfastd-efcafca969d2e789cdf106609b04a86ef9b53a3d.tar
fastd-efcafca969d2e789cdf106609b04a86ef9b53a3d.zip
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.
Diffstat (limited to 'src/config.c')
-rw-r--r--src/config.c10
1 files changed, 2 insertions, 8 deletions
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);