diff options
author | Adam Frisby | 2007-05-04 03:25:20 +0000 |
---|---|---|
committer | Adam Frisby | 2007-05-04 03:25:20 +0000 |
commit | 10f75f936e1322ea1e328799cfba08229d667a78 (patch) | |
tree | 87bc3faaeb19595a67ef0b286a93dbdb117c1942 /OpenGrid.Framework.Data.MySQL/MySQLGridData.cs | |
parent | fix array size (diff) | |
download | opensim-SC-10f75f936e1322ea1e328799cfba08229d667a78.zip opensim-SC-10f75f936e1322ea1e328799cfba08229d667a78.tar.gz opensim-SC-10f75f936e1322ea1e328799cfba08229d667a78.tar.bz2 opensim-SC-10f75f936e1322ea1e328799cfba08229d667a78.tar.xz |
Committing OpenGrid.Framework.Data and MySql Adaptor - not in functional state yet, posted for reference and future use.
Diffstat (limited to '')
-rw-r--r-- | OpenGrid.Framework.Data.MySQL/MySQLGridData.cs | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/OpenGrid.Framework.Data.MySQL/MySQLGridData.cs b/OpenGrid.Framework.Data.MySQL/MySQLGridData.cs new file mode 100644 index 0000000..65a0fff --- /dev/null +++ b/OpenGrid.Framework.Data.MySQL/MySQLGridData.cs | |||
@@ -0,0 +1,51 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Text; | ||
4 | using OpenGrid.Framework.Data; | ||
5 | |||
6 | namespace OpenGrid.Framework.Data.MySQL | ||
7 | { | ||
8 | public class MySQLGridData : IGridData | ||
9 | { | ||
10 | MySQLManager database; | ||
11 | |||
12 | public void Initialise() | ||
13 | { | ||
14 | database = new MySQLManager("localhost", "db", "user", "password", "false"); | ||
15 | } | ||
16 | public SimProfileData GetProfileByHandle(ulong handle) | ||
17 | { | ||
18 | return new SimProfileData(); | ||
19 | } | ||
20 | public SimProfileData GetProfileByLLUUID(libsecondlife.LLUUID uuid) | ||
21 | { | ||
22 | return new SimProfileData(); | ||
23 | } | ||
24 | public bool AuthenticateSim(libsecondlife.LLUUID uuid, ulong handle, string authkey) | ||
25 | { | ||
26 | throw new Exception("CRYPTOWEAK AUTHENTICATE: Refusing to authenticate due to replay potential."); | ||
27 | } | ||
28 | |||
29 | /// <summary> | ||
30 | /// Provides a cryptographic authentication of a region | ||
31 | /// </summary> | ||
32 | /// <remarks>This requires a security audit.</remarks> | ||
33 | /// <param name="uuid"></param> | ||
34 | /// <param name="handle"></param> | ||
35 | /// <param name="authhash"></param> | ||
36 | /// <param name="challenge"></param> | ||
37 | /// <returns></returns> | ||
38 | public bool AuthenticateSim(libsecondlife.LLUUID uuid, ulong handle, string authhash, string challenge) | ||
39 | { | ||
40 | System.Security.Cryptography.SHA512Managed HashProvider = new System.Security.Cryptography.SHA512Managed(); | ||
41 | System.Text.ASCIIEncoding TextProvider = new ASCIIEncoding(); | ||
42 | |||
43 | byte[] stream = TextProvider.GetBytes(uuid.ToStringHyphenated() + ":" + handle.ToString() + ":" + challenge); | ||
44 | byte[] hash = HashProvider.ComputeHash(stream); | ||
45 | |||
46 | return false; | ||
47 | } | ||
48 | } | ||
49 | |||
50 | |||
51 | } | ||