P2P: Do not accept unauthenticated Advertise msgs

This commit is contained in:
Vincent Bernardoff 2016-11-30 14:49:08 +01:00 committed by Grégoire Henry
parent 5f8b74e96c
commit e1d6df6e99

View File

@ -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"