diff options
author | Adam Frisby | 2007-05-12 11:58:23 +0000 |
---|---|---|
committer | Adam Frisby | 2007-05-12 11:58:23 +0000 |
commit | 13da0673b2779c8605858b0d12ad9d0815f3f278 (patch) | |
tree | fd50573a89ecddbc77e0f03ff0a99e70137802f6 /OpenSim.Framework | |
parent | Increased the flying speed (diff) | |
download | opensim-SC-13da0673b2779c8605858b0d12ad9d0815f3f278.zip opensim-SC-13da0673b2779c8605858b0d12ad9d0815f3f278.tar.gz opensim-SC-13da0673b2779c8605858b0d12ad9d0815f3f278.tar.bz2 opensim-SC-13da0673b2779c8605858b0d12ad9d0815f3f278.tar.xz |
PROTIP: System.Random isn't actually random. Use RNGCryptoServiceProvider in System.Security.Cryptography if your generating random numbers for security related purposes.
Diffstat (limited to 'OpenSim.Framework')
-rw-r--r-- | OpenSim.Framework/UserProfile.cs | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/OpenSim.Framework/UserProfile.cs b/OpenSim.Framework/UserProfile.cs index 5b7405a..eef6be1 100644 --- a/OpenSim.Framework/UserProfile.cs +++ b/OpenSim.Framework/UserProfile.cs | |||
@@ -3,6 +3,7 @@ using System.Collections.Generic; | |||
3 | using System.Text; | 3 | using System.Text; |
4 | using libsecondlife; | 4 | using libsecondlife; |
5 | using OpenSim.Framework.Inventory; | 5 | using OpenSim.Framework.Inventory; |
6 | using System.Security.Cryptography; | ||
6 | 7 | ||
7 | namespace OpenSim.Framework.User | 8 | namespace OpenSim.Framework.User |
8 | { | 9 | { |
@@ -38,8 +39,15 @@ namespace OpenSim.Framework.User | |||
38 | 39 | ||
39 | public void InitSessionData() | 40 | public void InitSessionData() |
40 | { | 41 | { |
41 | CurrentSessionID = LLUUID.Random(); | 42 | |
42 | CurrentSecureSessionID = LLUUID.Random(); | 43 | System.Security.Cryptography.Rfc2898DeriveBytes b = new Rfc2898DeriveBytes(MD5passwd, 128); |
44 | |||
45 | RNGCryptoServiceProvider rand = new RNGCryptoServiceProvider(); | ||
46 | |||
47 | CurrentSessionID = new LLUUID(); | ||
48 | CurrentSecureSessionID = new LLUUID(); | ||
49 | rand.GetBytes(CurrentSecureSessionID.Data); | ||
50 | rand.GetBytes(CurrentSessionID.Data); | ||
43 | } | 51 | } |
44 | 52 | ||
45 | public void AddSimCircuit(uint circuitCode, LLUUID regionUUID) | 53 | public void AddSimCircuit(uint circuitCode, LLUUID regionUUID) |