diff options
author | Diva Canto | 2010-08-19 19:54:40 -0700 |
---|---|---|
committer | Diva Canto | 2010-08-19 21:32:35 -0700 |
commit | 1e389438e2656cc8b5ae7027946f7863d6ffc528 (patch) | |
tree | cdc32bf16284e8c3548218b6bf859b12ed069068 /OpenSim/Region/Framework/Scenes/Scene.cs | |
parent | Partial rewrite of client IP verification. Not completely finished yet, and u... (diff) | |
download | opensim-SC_OLD-1e389438e2656cc8b5ae7027946f7863d6ffc528.zip opensim-SC_OLD-1e389438e2656cc8b5ae7027946f7863d6ffc528.tar.gz opensim-SC_OLD-1e389438e2656cc8b5ae7027946f7863d6ffc528.tar.bz2 opensim-SC_OLD-1e389438e2656cc8b5ae7027946f7863d6ffc528.tar.xz |
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.
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 52 |
1 files changed, 27 insertions, 25 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index f1828da..455e163 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -2673,26 +2673,26 @@ namespace OpenSim.Region.Framework.Scenes | |||
2673 | { | 2673 | { |
2674 | AgentCircuitData aCircuit = m_authenticateHandler.GetAgentCircuitData(client.CircuitCode); | 2674 | AgentCircuitData aCircuit = m_authenticateHandler.GetAgentCircuitData(client.CircuitCode); |
2675 | 2675 | ||
2676 | // Do the verification here | 2676 | //// Do the verification here -- No, really don't do this here. This is UDP address, let it go. |
2677 | System.Net.IPEndPoint ep = (System.Net.IPEndPoint)client.GetClientEP(); | 2677 | //System.Net.IPEndPoint ep = (System.Net.IPEndPoint)client.GetClientEP(); |
2678 | if (aCircuit != null) | 2678 | //if (aCircuit != null) |
2679 | { | 2679 | //{ |
2680 | if (!VerifyClient(aCircuit, ep, out vialogin)) | 2680 | // if (!VerifyClient(aCircuit, ep, out vialogin)) |
2681 | { | 2681 | // { |
2682 | // uh-oh, this is fishy | 2682 | // // uh-oh, this is fishy |
2683 | m_log.WarnFormat("[Scene]: Agent {0} with session {1} connecting with unidentified end point {2}. Refusing service.", | 2683 | // m_log.WarnFormat("[SCENE]: Agent {0} with session {1} connecting with unidentified end point {2}. Refusing service.", |
2684 | client.AgentId, client.SessionId, ep.ToString()); | 2684 | // client.AgentId, client.SessionId, ep.ToString()); |
2685 | try | 2685 | // try |
2686 | { | 2686 | // { |
2687 | client.Close(); | 2687 | // client.Close(); |
2688 | } | 2688 | // } |
2689 | catch (Exception e) | 2689 | // catch (Exception e) |
2690 | { | 2690 | // { |
2691 | m_log.DebugFormat("[Scene]: Exception while closing aborted client: {0}", e.StackTrace); | 2691 | // m_log.DebugFormat("[SCENE]: Exception while closing aborted client: {0}", e.StackTrace); |
2692 | } | 2692 | // } |
2693 | return; | 2693 | // return; |
2694 | } | 2694 | // } |
2695 | } | 2695 | //} |
2696 | 2696 | ||
2697 | m_log.Debug("[Scene] Adding new agent " + client.Name + " to scene " + RegionInfo.RegionName); | 2697 | m_log.Debug("[Scene] Adding new agent " + client.Name + " to scene " + RegionInfo.RegionName); |
2698 | 2698 | ||
@@ -2721,16 +2721,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
2721 | vialogin = false; | 2721 | vialogin = false; |
2722 | 2722 | ||
2723 | // Do the verification here | 2723 | // Do the verification here |
2724 | if ((aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaLogin) != 0) | 2724 | if ((aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaHGLogin) != 0) |
2725 | { | 2725 | { |
2726 | m_log.DebugFormat("[Scene]: Incoming client {0} {1} in region {2} via Login", aCircuit.firstname, aCircuit.lastname, RegionInfo.RegionName); | 2726 | m_log.DebugFormat("[SCENE]: Incoming client {0} {1} in region {2} via HG login", aCircuit.firstname, aCircuit.lastname, RegionInfo.RegionName); |
2727 | vialogin = true; | 2727 | vialogin = true; |
2728 | IUserAgentVerificationModule userVerification = RequestModuleInterface<IUserAgentVerificationModule>(); | 2728 | IUserAgentVerificationModule userVerification = RequestModuleInterface<IUserAgentVerificationModule>(); |
2729 | if (userVerification != null && ep != null) | 2729 | if (userVerification != null && ep != null) |
2730 | { | 2730 | { |
2731 | System.Net.IPAddress addr = NetworkUtil.GetExternalIPOf(ep.Address); | 2731 | if (!userVerification.VerifyClient(aCircuit, ep.Address.ToString())) |
2732 | |||
2733 | if (!userVerification.VerifyClient(aCircuit, /*ep.Address.ToString() */ addr.ToString())) | ||
2734 | { | 2732 | { |
2735 | // uh-oh, this is fishy | 2733 | // uh-oh, this is fishy |
2736 | m_log.DebugFormat("[Scene]: User Client Verification for {0} {1} in {2} returned false", aCircuit.firstname, aCircuit.lastname, RegionInfo.RegionName); | 2734 | m_log.DebugFormat("[Scene]: User Client Verification for {0} {1} in {2} returned false", aCircuit.firstname, aCircuit.lastname, RegionInfo.RegionName); |
@@ -2741,6 +2739,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
2741 | } | 2739 | } |
2742 | } | 2740 | } |
2743 | 2741 | ||
2742 | else if ((aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaLogin) != 0) | ||
2743 | m_log.DebugFormat("[SCENE]: Incoming client {0} {1} in region {2} via regular login. Client IP verification not performed.", | ||
2744 | aCircuit.firstname, aCircuit.lastname, RegionInfo.RegionName); | ||
2745 | |||
2744 | return true; | 2746 | return true; |
2745 | } | 2747 | } |
2746 | 2748 | ||