aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/Scene.cs
diff options
context:
space:
mode:
authorDiva Canto2010-08-19 19:54:40 -0700
committerDiva Canto2010-08-19 19:54:40 -0700
commita39ea07158756a76757d4b616c60cbcedf06f268 (patch)
tree59438c64692b850dc09f96e2658e9f4d77b36a9d /OpenSim/Region/Framework/Scenes/Scene.cs
parentPartial rewrite of client IP verification. Not completely finished yet, and u... (diff)
downloadopensim-SC-a39ea07158756a76757d4b616c60cbcedf06f268.zip
opensim-SC-a39ea07158756a76757d4b616c60cbcedf06f268.tar.gz
opensim-SC-a39ea07158756a76757d4b616c60cbcedf06f268.tar.bz2
opensim-SC-a39ea07158756a76757d4b616c60cbcedf06f268.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 '')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs52
1 files changed, 27 insertions, 25 deletions
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
2507 { 2507 {
2508 AgentCircuitData aCircuit = m_authenticateHandler.GetAgentCircuitData(client.CircuitCode); 2508 AgentCircuitData aCircuit = m_authenticateHandler.GetAgentCircuitData(client.CircuitCode);
2509 2509
2510 // Do the verification here 2510 //// Do the verification here -- No, really don't do this here. This is UDP address, let it go.
2511 System.Net.IPEndPoint ep = (System.Net.IPEndPoint)client.GetClientEP(); 2511 //System.Net.IPEndPoint ep = (System.Net.IPEndPoint)client.GetClientEP();
2512 if (aCircuit != null) 2512 //if (aCircuit != null)
2513 { 2513 //{
2514 if (!VerifyClient(aCircuit, ep, out vialogin)) 2514 // if (!VerifyClient(aCircuit, ep, out vialogin))
2515 { 2515 // {
2516 // uh-oh, this is fishy 2516 // // uh-oh, this is fishy
2517 m_log.WarnFormat("[SCENE]: Agent {0} with session {1} connecting with unidentified end point {2}. Refusing service.", 2517 // m_log.WarnFormat("[SCENE]: Agent {0} with session {1} connecting with unidentified end point {2}. Refusing service.",
2518 client.AgentId, client.SessionId, ep.ToString()); 2518 // client.AgentId, client.SessionId, ep.ToString());
2519 try 2519 // try
2520 { 2520 // {
2521 client.Close(); 2521 // client.Close();
2522 } 2522 // }
2523 catch (Exception e) 2523 // catch (Exception e)
2524 { 2524 // {
2525 m_log.DebugFormat("[SCENE]: Exception while closing aborted client: {0}", e.StackTrace); 2525 // m_log.DebugFormat("[SCENE]: Exception while closing aborted client: {0}", e.StackTrace);
2526 } 2526 // }
2527 return; 2527 // return;
2528 } 2528 // }
2529 } 2529 //}
2530 2530
2531 m_log.Debug("[SCENE]: Adding new agent " + client.Name + " to scene " + RegionInfo.RegionName); 2531 m_log.Debug("[SCENE]: Adding new agent " + client.Name + " to scene " + RegionInfo.RegionName);
2532 2532
@@ -2555,16 +2555,14 @@ namespace OpenSim.Region.Framework.Scenes
2555 vialogin = false; 2555 vialogin = false;
2556 2556
2557 // Do the verification here 2557 // Do the verification here
2558 if ((aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaLogin) != 0) 2558 if ((aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaHGLogin) != 0)
2559 { 2559 {
2560 m_log.DebugFormat("[SCENE]: Incoming client {0} {1} in region {2} via Login", aCircuit.firstname, aCircuit.lastname, RegionInfo.RegionName); 2560 m_log.DebugFormat("[SCENE]: Incoming client {0} {1} in region {2} via HG login", aCircuit.firstname, aCircuit.lastname, RegionInfo.RegionName);
2561 vialogin = true; 2561 vialogin = true;
2562 IUserAgentVerificationModule userVerification = RequestModuleInterface<IUserAgentVerificationModule>(); 2562 IUserAgentVerificationModule userVerification = RequestModuleInterface<IUserAgentVerificationModule>();
2563 if (userVerification != null && ep != null) 2563 if (userVerification != null && ep != null)
2564 { 2564 {
2565 System.Net.IPAddress addr = NetworkUtil.GetExternalIPOf(ep.Address); 2565 if (!userVerification.VerifyClient(aCircuit, ep.Address.ToString()))
2566
2567 if (!userVerification.VerifyClient(aCircuit, /*ep.Address.ToString() */ addr.ToString()))
2568 { 2566 {
2569 // uh-oh, this is fishy 2567 // uh-oh, this is fishy
2570 m_log.DebugFormat("[SCENE]: User Client Verification for {0} {1} in {2} returned false", aCircuit.firstname, aCircuit.lastname, RegionInfo.RegionName); 2568 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
2575 } 2573 }
2576 } 2574 }
2577 2575
2576 else if ((aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaLogin) != 0)
2577 m_log.DebugFormat("[SCENE]: Incoming client {0} {1} in region {2} via regular login. Client IP verification not performed.",
2578 aCircuit.firstname, aCircuit.lastname, RegionInfo.RegionName);
2579
2578 return true; 2580 return true;
2579 } 2581 }
2580 2582