From a45a313422efa33f261cb1b53a08646a6b3ab947 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 11 Apr 2014 15:50:43 +0200 Subject: Improve shell command config handling --- src/protocols/ec25519_fhmqvc/handshake.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/protocols/ec25519_fhmqvc') diff --git a/src/protocols/ec25519_fhmqvc/handshake.c b/src/protocols/ec25519_fhmqvc/handshake.c index a8bde30..6de47ef 100644 --- a/src/protocols/ec25519_fhmqvc/handshake.c +++ b/src/protocols/ec25519_fhmqvc/handshake.c @@ -486,8 +486,12 @@ bool fastd_protocol_ec25519_fhmqvc_peer_check_temporary(fastd_context_t *ctx, fa return true; } +static inline bool allow_unknown(fastd_context_t *ctx) { + return fastd_shell_command_isset(&ctx->conf->on_verify); +} + static inline fastd_peer_t* add_temporary(fastd_context_t *ctx, const fastd_peer_address_t *local_addr, const fastd_peer_address_t *remote_addr, const unsigned char key[32]) { - if (!fastd_peer_allow_unknown(ctx)) { + if (!allow_unknown(ctx)) { pr_debug(ctx, "ignoring handshake from %I (unknown key)", remote_addr); return NULL; } -- cgit v1.2.3