aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Data.SQLite/SQLiteGridData.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework/Data.SQLite/SQLiteGridData.cs')
-rw-r--r--OpenSim/Framework/Data.SQLite/SQLiteGridData.cs22
1 files changed, 12 insertions, 10 deletions
diff --git a/OpenSim/Framework/Data.SQLite/SQLiteGridData.cs b/OpenSim/Framework/Data.SQLite/SQLiteGridData.cs
index 800e26c..511c5f0 100644
--- a/OpenSim/Framework/Data.SQLite/SQLiteGridData.cs
+++ b/OpenSim/Framework/Data.SQLite/SQLiteGridData.cs
@@ -27,8 +27,10 @@
27*/ 27*/
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.Data;
31using System.Security.Cryptography;
30using System.Text; 32using System.Text;
31using OpenSim.Framework.Data; 33using libsecondlife;
32 34
33namespace OpenSim.Framework.Data.SQLite 35namespace OpenSim.Framework.Data.SQLite
34{ 36{
@@ -99,8 +101,8 @@ namespace OpenSim.Framework.Data.SQLite
99 Dictionary<string, string> param = new Dictionary<string, string>(); 101 Dictionary<string, string> param = new Dictionary<string, string>();
100 param["handle"] = handle.ToString(); 102 param["handle"] = handle.ToString();
101 103
102 System.Data.IDbCommand result = database.Query("SELECT * FROM regions WHERE handle = @handle", param); 104 IDbCommand result = database.Query("SELECT * FROM regions WHERE handle = @handle", param);
103 System.Data.IDataReader reader = result.ExecuteReader(); 105 IDataReader reader = result.ExecuteReader();
104 106
105 SimProfileData row = database.getRow(reader); 107 SimProfileData row = database.getRow(reader);
106 reader.Close(); 108 reader.Close();
@@ -114,13 +116,13 @@ namespace OpenSim.Framework.Data.SQLite
114 /// </summary> 116 /// </summary>
115 /// <param name="uuid">The region UUID</param> 117 /// <param name="uuid">The region UUID</param>
116 /// <returns>The sim profile</returns> 118 /// <returns>The sim profile</returns>
117 public SimProfileData GetProfileByLLUUID(libsecondlife.LLUUID uuid) 119 public SimProfileData GetProfileByLLUUID(LLUUID uuid)
118 { 120 {
119 Dictionary<string, string> param = new Dictionary<string, string>(); 121 Dictionary<string, string> param = new Dictionary<string, string>();
120 param["uuid"] = uuid.ToStringHyphenated(); 122 param["uuid"] = uuid.ToStringHyphenated();
121 123
122 System.Data.IDbCommand result = database.Query("SELECT * FROM regions WHERE uuid = @uuid", param); 124 IDbCommand result = database.Query("SELECT * FROM regions WHERE uuid = @uuid", param);
123 System.Data.IDataReader reader = result.ExecuteReader(); 125 IDataReader reader = result.ExecuteReader();
124 126
125 SimProfileData row = database.getRow(reader); 127 SimProfileData row = database.getRow(reader);
126 reader.Close(); 128 reader.Close();
@@ -153,7 +155,7 @@ namespace OpenSim.Framework.Data.SQLite
153 /// <param name="handle">The attempted regionHandle of the challenger</param> 155 /// <param name="handle">The attempted regionHandle of the challenger</param>
154 /// <param name="authkey">The secret</param> 156 /// <param name="authkey">The secret</param>
155 /// <returns>Whether the secret and regionhandle match the database entry for UUID</returns> 157 /// <returns>Whether the secret and regionhandle match the database entry for UUID</returns>
156 public bool AuthenticateSim(libsecondlife.LLUUID uuid, ulong handle, string authkey) 158 public bool AuthenticateSim(LLUUID uuid, ulong handle, string authkey)
157 { 159 {
158 bool throwHissyFit = false; // Should be true by 1.0 160 bool throwHissyFit = false; // Should be true by 1.0
159 161
@@ -174,10 +176,10 @@ namespace OpenSim.Framework.Data.SQLite
174 /// <param name="authhash"></param> 176 /// <param name="authhash"></param>
175 /// <param name="challenge"></param> 177 /// <param name="challenge"></param>
176 /// <returns></returns> 178 /// <returns></returns>
177 public bool AuthenticateSim(libsecondlife.LLUUID uuid, ulong handle, string authhash, string challenge) 179 public bool AuthenticateSim(LLUUID uuid, ulong handle, string authhash, string challenge)
178 { 180 {
179 System.Security.Cryptography.SHA512Managed HashProvider = new System.Security.Cryptography.SHA512Managed(); 181 SHA512Managed HashProvider = new SHA512Managed();
180 System.Text.ASCIIEncoding TextProvider = new ASCIIEncoding(); 182 ASCIIEncoding TextProvider = new ASCIIEncoding();
181 183
182 byte[] stream = TextProvider.GetBytes(uuid.ToStringHyphenated() + ":" + handle.ToString() + ":" + challenge); 184 byte[] stream = TextProvider.GetBytes(uuid.ToStringHyphenated() + ":" + handle.ToString() + ":" + challenge);
183 byte[] hash = HashProvider.ComputeHash(stream); 185 byte[] hash = HashProvider.ComputeHash(stream);