diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2014-04-20 04:36:34 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2014-04-20 04:36:34 +0200 |
commit | b9c8603931203f5d94091f7a05a5967304b62fbd (patch) | |
tree | b10ed1db8d2a34561f0f50488af73d820ecae019 /src/protocols/ec25519_fhmqvc/ec25519_fhmqvc.c | |
parent | ab4ca17ba3dfc92932834b09afc83cf7fe002a14 (diff) | |
download | fastd-b9c8603931203f5d94091f7a05a5967304b62fbd.tar fastd-b9c8603931203f5d94091f7a05a5967304b62fbd.zip |
Make conf global
Diffstat (limited to 'src/protocols/ec25519_fhmqvc/ec25519_fhmqvc.c')
-rw-r--r-- | src/protocols/ec25519_fhmqvc/ec25519_fhmqvc.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/protocols/ec25519_fhmqvc/ec25519_fhmqvc.c b/src/protocols/ec25519_fhmqvc/ec25519_fhmqvc.c index 735a0ea..698746b 100644 --- a/src/protocols/ec25519_fhmqvc/ec25519_fhmqvc.c +++ b/src/protocols/ec25519_fhmqvc/ec25519_fhmqvc.c @@ -52,10 +52,10 @@ static inline void check_session_refresh(fastd_context_t *ctx, fastd_peer_t *pee static fastd_protocol_config_t* protocol_init(fastd_context_t *ctx) { fastd_protocol_config_t *protocol_config = malloc(sizeof(fastd_protocol_config_t)); - if (!ctx->conf->secret) + if (!conf.secret) exit_error(ctx, "no secret key configured"); - if (!read_key(protocol_config->key.secret.p, ctx->conf->secret)) + if (!read_key(protocol_config->key.secret.p, conf.secret)) exit_error(ctx, "invalid secret key"); ecc_25519_work_t work; @@ -92,7 +92,7 @@ static void protocol_peer_configure(fastd_context_t *ctx, fastd_peer_config_t *p peer_conf->protocol_config = malloc(sizeof(fastd_protocol_peer_config_t)); peer_conf->protocol_config->public_key = key; - if (memcmp(&peer_conf->protocol_config->public_key, &ctx->conf->protocol_config->key.public, 32) == 0) + if (memcmp(&peer_conf->protocol_config->public_key, &conf.protocol_config->key.public, 32) == 0) pr_debug(ctx, "found own key as `%s', ignoring peer", peer_conf->name); } @@ -169,7 +169,7 @@ static void session_send(fastd_context_t *ctx, fastd_peer_t *peer, fastd_buffer_ } fastd_send(ctx, peer->sock, &peer->local_address, &peer->address, peer, send_buffer, stat_size); - peer->keepalive_timeout = fastd_in_seconds(ctx, ctx->conf->keepalive_timeout); + peer->keepalive_timeout = fastd_in_seconds(ctx, conf.keepalive_timeout); } static void protocol_send(fastd_context_t *ctx, fastd_peer_t *peer, fastd_buffer_t buffer) { |