Esempio n. 1
0
        public void TestPacketParserAndAssemblerStreamExtraDataIgnored()
        {
            var request  = "0cda00268a54f4686fb394c52866e302185d062350125a665e2e1e8411f3e243822097c84fa3ff00ff00ff00ff";
            var expected = "0cda00268a54f4686fb394c52866e302185d062350125a665e2e1e8411f3e243822097c84fa3";
            var secret   = Encoding.UTF8.GetBytes("xyzzy5461");

            var stream             = new MemoryStream(Utils.StringToByteArray(request));
            var radiusPacketParser = new RadiusPacketParser(NullLogger <RadiusPacketParser> .Instance, GetDictionary());
            var result             = radiusPacketParser.TryParsePacketFromStream(stream, out var packet, secret);
            var bytes = radiusPacketParser.GetBytes(packet);

            Assert.AreEqual(expected, bytes.ToHexString());
        }