From e1d6df6e99699334de35c7784bd95cfc6928f70c Mon Sep 17 00:00:00 2001 From: Vincent Bernardoff Date: Wed, 30 Nov 2016 14:49:08 +0100 Subject: [PATCH] P2P: Do not accept unauthenticated Advertise msgs --- src/node/net/p2p.ml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/node/net/p2p.ml b/src/node/net/p2p.ml index 5eb0fb4ca..ed8cc3ab5 100644 --- a/src/node/net/p2p.ml +++ b/src/node/net/p2p.ml @@ -470,12 +470,9 @@ module Make (P: PARAMS) = struct buf local_nonce version gid public_key message_nonce listening_port end - | Ok (Advertise peers) -> - (* alternatively, one can refuse a connection but reply with - some peers, so we accept this info *) - debug "(%a) new peers received from %a:%d" + | Ok (Advertise _) -> + debug "(%a) connection rejected (unauthenticated Advertise) from %a:%d" pp_gid my_gid Ipaddr.pp_hum addr port ; - let (_:bool) = Lwt_pipe.push_now control_events (Peers peers) in cancel () | Ok Disconnect -> debug "(%a) connection rejected (closed by peer or timeout) from %a:%d"