PROTIP: System.Random isn't actually random. Use RNGCryptoServiceProvider in System.Security.Cryptography if your generating random numbers for security related purposes.

zircon^2
Adam Frisby 2007-05-12 11:58:23 +00:00
parent d663dfa3bd
commit 13da0673b2
1 changed files with 10 additions and 2 deletions

View File

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Text;
using libsecondlife;
using OpenSim.Framework.Inventory;
using System.Security.Cryptography;
namespace OpenSim.Framework.User
{
@ -38,8 +39,15 @@ namespace OpenSim.Framework.User
public void InitSessionData()
{
CurrentSessionID = LLUUID.Random();
CurrentSecureSessionID = LLUUID.Random();
System.Security.Cryptography.Rfc2898DeriveBytes b = new Rfc2898DeriveBytes(MD5passwd, 128);
RNGCryptoServiceProvider rand = new RNGCryptoServiceProvider();
CurrentSessionID = new LLUUID();
CurrentSecureSessionID = new LLUUID();
rand.GetBytes(CurrentSecureSessionID.Data);
rand.GetBytes(CurrentSessionID.Data);
}
public void AddSimCircuit(uint circuitCode, LLUUID regionUUID)