// used to format received data
 public RadiusPacket(byte[] receivedData, string sharedsecret, byte[] requestAuthenticator)
 {
     this.rawData    = receivedData;
     this.packetType = (RadiusPacketType)(int)receivedData[0];
     this.identifier = (int)receivedData[1];
     this.length     = (long)(receivedData[2] << 8) + (long)receivedData[3];
     Array.Copy(receivedData, 4, this.authenticator, 0, 16);
     byte[] attributesArray = new byte[receivedData.Length - 20];
     Array.Copy(receivedData, 20, attributesArray, 0, attributesArray.Length);
     ParseAttributes(attributesArray);
 }
Example #2
0
 // used to format received data
 public RadiusPacket(byte[] receivedData,string sharedsecret,byte[] requestAuthenticator)
 {
     this.rawData = receivedData;
     this.packetType = (RadiusPacketType)(int)receivedData[0];
     this.identifier = (int)receivedData[1];
     this.length = (long)(receivedData[2]<< 8) + (long)receivedData[3];
     Array.Copy(receivedData,4,this.authenticator,0,16);
     byte[] attributesArray = new byte[receivedData.Length - 20];
     Array.Copy(receivedData,20,attributesArray,0,attributesArray.Length);
     ParseAttributes(attributesArray);
 }
 // used to build packetToSend
 public RadiusPacket(RadiusPacketType packetType, string sharedsecret)
 {
     this.packetType    = packetType;
     this.identifier    = (int)(Guid.NewGuid().ToByteArray())[0];
     this.authenticator = Utils.makeRFC2865RequestAuthenticator(sharedsecret);
 }
Example #4
0
 // used to build packetToSend
 public RadiusPacket(RadiusPacketType packetType,string sharedsecret)
 {
     this.packetType = packetType;
     this.identifier = (int)(Guid.NewGuid().ToByteArray())[0];
     this.authenticator = Utils.makeRFC2865RequestAuthenticator(sharedsecret);
 }