vforteli / Flexinets.Radius.RadiusServer

Radius server for .Net. Packets handled in pluggable IPacketHandlers
MIT License
45 stars 22 forks source link

Invalid Message-Authenticator in packet 224 when using radtest #7

Closed JoshClose closed 6 years ago

JoshClose commented 6 years ago

When using radtest, which is a test tool that comes with FreeRadius, I get an exception System.InvalidOperationException: Invalid Message-Authenticator in packet 224.

$ radtest user password localhost 1812 0 12345
Received packet from 127.0.0.1:56039, Concurrent handlers count: 1
Failed to receive packet from 127.0.0.1:56039
System.InvalidOperationException: Invalid Message-Authenticator in packet 224
   at Flexinets.Radius.Core.RadiusPacket.Parse(Byte[] packetBytes, IRadiusDictionary dictionary, Byte[] sharedSecret)
   at Flexinets.Radius.RadiusServer.GetResponsePacket(IPacketHandler packetHandler, String sharedSecret, Byte[] packetBytes, IPEndPoint remoteEndpoint)
   at Flexinets.Radius.RadiusServer.HandlePacket(IPEndPoint remoteEndpoint, Byte[] packetBytes)
01e00050b12b2bc26bd8156b7b962b27e0fd924a0106757365720212503043021b6fdb74b3b81454c790a64004067f000101050600000714501200000000000000000000000000000000070600000001
vforteli commented 6 years ago

Checked the secret? That is what you would get with an incorrect secret if a message-authenticator attribute is included

JoshClose commented 6 years ago

Thanks. It wasn't the secret but something else in the params I was passing that I didn't realize until I tool a closer look. The server and port needed to be connected with a :. Sorry about that.

vforteli commented 6 years ago

well it did result in a small bug fix so, yay anyway https://github.com/vforteli/Flexinets.Radius.Core/commit/aa8fc93daa46ceca3e8d1fe89f8ef109211c3391

JoshClose commented 6 years ago

lol Well at least some good came out of it!