diff options
author | Adam Frisby | 2007-05-20 23:34:29 +0000 |
---|---|---|
committer | Adam Frisby | 2007-05-20 23:34:29 +0000 |
commit | b2fe47ecb11d4e6c6b0f9bc124cd7a8d4703784d (patch) | |
tree | 18de3f48a8afa7bb2e03063bf026ab43765d4088 /OpenSim | |
parent | Finished adding comments (diff) | |
download | opensim-SC_OLD-b2fe47ecb11d4e6c6b0f9bc124cd7a8d4703784d.zip opensim-SC_OLD-b2fe47ecb11d4e6c6b0f9bc124cd7a8d4703784d.tar.gz opensim-SC_OLD-b2fe47ecb11d4e6c6b0f9bc124cd7a8d4703784d.tar.bz2 opensim-SC_OLD-b2fe47ecb11d4e6c6b0f9bc124cd7a8d4703784d.tar.xz |
* Minor tweaks with new userserver
* Fixed password encoding to match MD5 standard properly.
* Fixed exception caused on user first login (minor)
* Fixed exception caused by incorrect username (minor)
* Returns login error rather than grid error if username is incorrect
Diffstat (limited to '')
-rw-r--r-- | OpenSim.Framework/Util.cs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/OpenSim.Framework/Util.cs b/OpenSim.Framework/Util.cs index 6f60925..400f415 100644 --- a/OpenSim.Framework/Util.cs +++ b/OpenSim.Framework/Util.cs | |||
@@ -1,4 +1,5 @@ | |||
1 | using System; | 1 | using System; |
2 | using System.Security.Cryptography; | ||
2 | using System.Collections.Generic; | 3 | using System.Collections.Generic; |
3 | using System.Text; | 4 | using System.Text; |
4 | using libsecondlife; | 5 | using libsecondlife; |
@@ -43,6 +44,16 @@ namespace OpenSim.Framework.Utilities | |||
43 | return timestamp; | 44 | return timestamp; |
44 | } | 45 | } |
45 | 46 | ||
47 | public static string Md5Hash(string pass) | ||
48 | { | ||
49 | MD5 md5 = MD5CryptoServiceProvider.Create(); | ||
50 | byte[] dataMd5 = md5.ComputeHash(Encoding.Default.GetBytes(pass)); | ||
51 | StringBuilder sb = new StringBuilder(); | ||
52 | for (int i = 0; i < dataMd5.Length; i++) | ||
53 | sb.AppendFormat("{0:x2}", dataMd5[i]); | ||
54 | return sb.ToString(); | ||
55 | } | ||
56 | |||
46 | //public static int fast_distance2d(int x, int y) | 57 | //public static int fast_distance2d(int x, int y) |
47 | //{ | 58 | //{ |
48 | // x = System.Math.Abs(x); | 59 | // x = System.Math.Abs(x); |