aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim.Framework
diff options
context:
space:
mode:
authorAdam Frisby2007-05-12 11:58:23 +0000
committerAdam Frisby2007-05-12 11:58:23 +0000
commit13da0673b2779c8605858b0d12ad9d0815f3f278 (patch)
treefd50573a89ecddbc77e0f03ff0a99e70137802f6 /OpenSim.Framework
parentIncreased the flying speed (diff)
downloadopensim-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 '')
-rw-r--r--OpenSim.Framework/UserProfile.cs12
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;
3using System.Text; 3using System.Text;
4using libsecondlife; 4using libsecondlife;
5using OpenSim.Framework.Inventory; 5using OpenSim.Framework.Inventory;
6using System.Security.Cryptography;
6 7
7namespace OpenSim.Framework.User 8namespace 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)