From ce316846ad466f3a7189c9b88841f10ec256111d Mon Sep 17 00:00:00 2001 From: Eric Wustrow Date: Sat, 27 Feb 2021 18:43:45 -0500 Subject: [PATCH 1/2] Still send phantom blocklisted IPs to registration API, but ignore them locally --- application/main.go | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/application/main.go b/application/main.go index b009e714..7050a6a1 100644 --- a/application/main.go +++ b/application/main.go @@ -238,6 +238,12 @@ func get_zmq_updates(connectAddr string, regManager *cj.RegistrationManager, con go tryShareRegistrationOverAPI(reg, conf.PreshareEndpoint) } + + if conf.IsBlocklistedPhantom(reg.DarkDecoy) { + logger.Printf("ignoring registration with blocklisted phantom: %s %v", reg.IDString(), reg.DarkDecoy) + continue + } + // validate the registration regManager.AddRegistration(reg) logger.Printf("Adding registration %v\n", reg.IDString()) @@ -328,14 +334,9 @@ func recieve_zmq_message(sub *zmq.Socket, regManager *cj.RegistrationManager, co logger.Printf("Failed to create registration: %v", err) return nil, err } - if conf.IsBlocklistedPhantom(reg.DarkDecoy) { - logger.Printf("ignoring registration with blocklisted phantom: %s %v", reg.IDString(), reg.DarkDecoy) - - } else { - // Received new registration, parse it and return - newRegs = append(newRegs, reg) - } + // Received new registration, parse it and return + newRegs = append(newRegs, reg) } if parsed.GetRegistrationPayload().GetV6Support() && conf.EnableIPv6 { @@ -344,12 +345,8 @@ func recieve_zmq_message(sub *zmq.Socket, regManager *cj.RegistrationManager, co logger.Printf("Failed to create registration: %v", err) return nil, err } - if conf.IsBlocklistedPhantom(reg.DarkDecoy) { - logger.Printf("ignoring registration with blocklisted phantom: %s %v", reg.IDString(), reg.DarkDecoy) - } else { - // add to list of new registrations to be processed. - newRegs = append(newRegs, reg) - } + // add to list of new registrations to be processed. + newRegs = append(newRegs, reg) } // log decoy connection and id string From 1a278ae1c360b2e8776d44bb8cd2d0d6a1f90152 Mon Sep 17 00:00:00 2001 From: Jack Wampler Date: Wed, 3 Mar 2021 18:34:29 -0700 Subject: [PATCH 2/2] updated comment --- application/main.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/application/main.go b/application/main.go index 7050a6a1..60c3a1be 100644 --- a/application/main.go +++ b/application/main.go @@ -240,6 +240,9 @@ func get_zmq_updates(connectAddr string, regManager *cj.RegistrationManager, con if conf.IsBlocklistedPhantom(reg.DarkDecoy) { + // Note: Phantom blocklist is applied at this stage because the phantom may only be blocked on this + // station. We may want other stations to be informed about the registration, but prevent this station + // specifically from handling / interfering in any subsequent connection. See PR #75 logger.Printf("ignoring registration with blocklisted phantom: %s %v", reg.IDString(), reg.DarkDecoy) continue }