From a39ea07158756a76757d4b616c60cbcedf06f268 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Thu, 19 Aug 2010 19:54:40 -0700 Subject: Finished implementing ViaLogin vs ViaHGLogin. Removed lookup on myipaddress.com. Also removed client IP verification upon UDP connection that had been left there -- we can't do that in general. --- OpenSim/Region/Framework/Scenes/Scene.cs | 52 +++++++++++++++++--------------- 1 file changed, 27 insertions(+), 25 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 18705a8..e742b55 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -2507,26 +2507,26 @@ namespace OpenSim.Region.Framework.Scenes { AgentCircuitData aCircuit = m_authenticateHandler.GetAgentCircuitData(client.CircuitCode); - // Do the verification here - System.Net.IPEndPoint ep = (System.Net.IPEndPoint)client.GetClientEP(); - if (aCircuit != null) - { - if (!VerifyClient(aCircuit, ep, out vialogin)) - { - // uh-oh, this is fishy - m_log.WarnFormat("[SCENE]: Agent {0} with session {1} connecting with unidentified end point {2}. Refusing service.", - client.AgentId, client.SessionId, ep.ToString()); - try - { - client.Close(); - } - catch (Exception e) - { - m_log.DebugFormat("[SCENE]: Exception while closing aborted client: {0}", e.StackTrace); - } - return; - } - } + //// Do the verification here -- No, really don't do this here. This is UDP address, let it go. + //System.Net.IPEndPoint ep = (System.Net.IPEndPoint)client.GetClientEP(); + //if (aCircuit != null) + //{ + // if (!VerifyClient(aCircuit, ep, out vialogin)) + // { + // // uh-oh, this is fishy + // m_log.WarnFormat("[SCENE]: Agent {0} with session {1} connecting with unidentified end point {2}. Refusing service.", + // client.AgentId, client.SessionId, ep.ToString()); + // try + // { + // client.Close(); + // } + // catch (Exception e) + // { + // m_log.DebugFormat("[SCENE]: Exception while closing aborted client: {0}", e.StackTrace); + // } + // return; + // } + //} m_log.Debug("[SCENE]: Adding new agent " + client.Name + " to scene " + RegionInfo.RegionName); @@ -2555,16 +2555,14 @@ namespace OpenSim.Region.Framework.Scenes vialogin = false; // Do the verification here - if ((aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaLogin) != 0) + if ((aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaHGLogin) != 0) { - m_log.DebugFormat("[SCENE]: Incoming client {0} {1} in region {2} via Login", aCircuit.firstname, aCircuit.lastname, RegionInfo.RegionName); + m_log.DebugFormat("[SCENE]: Incoming client {0} {1} in region {2} via HG login", aCircuit.firstname, aCircuit.lastname, RegionInfo.RegionName); vialogin = true; IUserAgentVerificationModule userVerification = RequestModuleInterface(); if (userVerification != null && ep != null) { - System.Net.IPAddress addr = NetworkUtil.GetExternalIPOf(ep.Address); - - if (!userVerification.VerifyClient(aCircuit, /*ep.Address.ToString() */ addr.ToString())) + if (!userVerification.VerifyClient(aCircuit, ep.Address.ToString())) { // uh-oh, this is fishy m_log.DebugFormat("[SCENE]: User Client Verification for {0} {1} in {2} returned false", aCircuit.firstname, aCircuit.lastname, RegionInfo.RegionName); @@ -2575,6 +2573,10 @@ namespace OpenSim.Region.Framework.Scenes } } + else if ((aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaLogin) != 0) + m_log.DebugFormat("[SCENE]: Incoming client {0} {1} in region {2} via regular login. Client IP verification not performed.", + aCircuit.firstname, aCircuit.lastname, RegionInfo.RegionName); + return true; } -- cgit v1.1