diff options
author | Kitto Flora | 2010-06-17 13:04:32 -0400 |
---|---|---|
committer | Kitto Flora | 2010-06-17 13:04:32 -0400 |
commit | cea79056025950303e3b784d824d3cb6168152d0 (patch) | |
tree | 0e708850e10f2a6b65cf718264b526ff1a12b9c5 /OpenSim/Services/Connectors/SimianGrid | |
parent | Add rez on water surface. (diff) | |
parent | Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/ca... (diff) | |
download | opensim-SC-cea79056025950303e3b784d824d3cb6168152d0.zip opensim-SC-cea79056025950303e3b784d824d3cb6168152d0.tar.gz opensim-SC-cea79056025950303e3b784d824d3cb6168152d0.tar.bz2 opensim-SC-cea79056025950303e3b784d824d3cb6168152d0.tar.xz |
Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs | 53 | ||||
-rw-r--r-- | OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs | 2 |
2 files changed, 47 insertions, 8 deletions
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs index de3ee4e..3c784f2 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs | |||
@@ -114,10 +114,9 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
114 | { | 114 | { |
115 | if (identity["Type"].AsString() == "md5hash") | 115 | if (identity["Type"].AsString() == "md5hash") |
116 | { | 116 | { |
117 | string credential = identity["Credential"].AsString(); | 117 | string authorizeResult; |
118 | 118 | if (CheckPassword(principalID, password, identity["Credential"].AsString(), out authorizeResult)) | |
119 | if (password == credential || "$1$" + password == credential || "$1$" + Utils.MD5String(password) == credential || Utils.MD5String(password) == credential) | 119 | return authorizeResult; |
120 | return Authorize(principalID); | ||
121 | 120 | ||
122 | md5hashFound = true; | 121 | md5hashFound = true; |
123 | break; | 122 | break; |
@@ -125,9 +124,7 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
125 | } | 124 | } |
126 | } | 125 | } |
127 | 126 | ||
128 | if (md5hashFound) | 127 | if (!md5hashFound) |
129 | m_log.Warn("[SIMIAN AUTH CONNECTOR]: Authentication failed for " + principalID + " using md5hash $1$" + Utils.MD5String(password)); | ||
130 | else | ||
131 | m_log.Warn("[SIMIAN AUTH CONNECTOR]: Authentication failed for " + principalID + ", no md5hash identity found"); | 128 | m_log.Warn("[SIMIAN AUTH CONNECTOR]: Authentication failed for " + principalID + ", no md5hash identity found"); |
132 | } | 129 | } |
133 | else | 130 | else |
@@ -228,6 +225,48 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
228 | return false; | 225 | return false; |
229 | } | 226 | } |
230 | 227 | ||
228 | private bool CheckPassword(UUID userID, string password, string simianGridCredential, out string authorizeResult) | ||
229 | { | ||
230 | if (simianGridCredential.Contains(":")) | ||
231 | { | ||
232 | // Salted version | ||
233 | int idx = simianGridCredential.IndexOf(':'); | ||
234 | string finalhash = simianGridCredential.Substring(0, idx); | ||
235 | string salt = simianGridCredential.Substring(idx + 1); | ||
236 | |||
237 | if (finalhash == Utils.MD5String(password + ":" + salt)) | ||
238 | { | ||
239 | authorizeResult = Authorize(userID); | ||
240 | return true; | ||
241 | } | ||
242 | else | ||
243 | { | ||
244 | m_log.Warn("[SIMIAN AUTH CONNECTOR]: Authentication failed for " + userID + | ||
245 | " using md5hash " + Utils.MD5String(password) + ":" + salt); | ||
246 | } | ||
247 | } | ||
248 | else | ||
249 | { | ||
250 | // Unsalted version | ||
251 | if (password == simianGridCredential || | ||
252 | "$1$" + password == simianGridCredential || | ||
253 | "$1$" + Utils.MD5String(password) == simianGridCredential || | ||
254 | Utils.MD5String(password) == simianGridCredential) | ||
255 | { | ||
256 | authorizeResult = Authorize(userID); | ||
257 | return true; | ||
258 | } | ||
259 | else | ||
260 | { | ||
261 | m_log.Warn("[SIMIAN AUTH CONNECTOR]: Authentication failed for " + userID + | ||
262 | " using md5hash $1$" + Utils.MD5String(password)); | ||
263 | } | ||
264 | } | ||
265 | |||
266 | authorizeResult = null; | ||
267 | return false; | ||
268 | } | ||
269 | |||
231 | private string Authorize(UUID userID) | 270 | private string Authorize(UUID userID) |
232 | { | 271 | { |
233 | NameValueCollection requestArgs = new NameValueCollection | 272 | NameValueCollection requestArgs = new NameValueCollection |
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs index 874f1a2..56c73ec 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs | |||
@@ -1,4 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |