From f545060e89bb53ff540391fa67273dba96526165 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Thu, 13 Jun 2019 23:37:53 +0100 Subject: [PATCH] Add notes on isSessionAllowed checks --- src/yggdrasil/session.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/yggdrasil/session.go b/src/yggdrasil/session.go index 46628c3e..22118476 100644 --- a/src/yggdrasil/session.go +++ b/src/yggdrasil/session.go @@ -219,6 +219,7 @@ func (ss *sessions) getByTheirSubnet(snet *address.Subnet) (*sessionInfo, bool) // includse initializing session info to sane defaults (e.g. lowest supported // MTU). func (ss *sessions) createSession(theirPermKey *crypto.BoxPubKey) *sessionInfo { + // TODO: this check definitely needs to be moved if !ss.isSessionAllowed(theirPermKey, true) { return nil } @@ -393,6 +394,7 @@ func (ss *sessions) handlePing(ping *sessionPing) { // Get the corresponding session (or create a new session) sinfo, isIn := ss.getByTheirPerm(&ping.SendPermPub) // Check if the session is allowed + // TODO: this check may need to be moved if !isIn && !ss.isSessionAllowed(&ping.SendPermPub, false) { return }