summaryrefslogtreecommitdiffstats
path: root/src/protocol_ec25519_fhmqvc.c
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2012-04-22 00:30:09 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2012-04-22 00:30:09 +0200
commitf21a6e3cec1fcc9930f06d3d0b8714cd34718815 (patch)
tree248428f7b41dcfd0b1298665bb56ce8d7b186a96 /src/protocol_ec25519_fhmqvc.c
parent8c91443808ce376947ff387eaffca6e8cfbe9251 (diff)
downloadfastd-f21a6e3cec1fcc9930f06d3d0b8714cd34718815.tar
fastd-f21a6e3cec1fcc9930f06d3d0b8714cd34718815.zip
Ignore peers with own key
Diffstat (limited to 'src/protocol_ec25519_fhmqvc.c')
-rw-r--r--src/protocol_ec25519_fhmqvc.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/protocol_ec25519_fhmqvc.c b/src/protocol_ec25519_fhmqvc.c
index e4a0e93..719482c 100644
--- a/src/protocol_ec25519_fhmqvc.c
+++ b/src/protocol_ec25519_fhmqvc.c
@@ -162,6 +162,12 @@ static void protocol_peer_configure(fastd_context *ctx, fastd_peer_config *peer_
return;
}
+ if (memcmp(key.p, ctx->conf->protocol_config->public_key.p, 32) == 0) {
+ pr_verbose(ctx, "found own key as `%s', ignoring peer", peer_conf->name);
+ peer_conf->enabled = false;
+ return;
+ }
+
peer_conf->protocol_config = malloc(sizeof(fastd_protocol_peer_config));
peer_conf->protocol_config->public_key = key;
}