Skip to content

Commit

Permalink
DEV-339 Message-Authenticator (#59)
Browse files Browse the repository at this point in the history
### Release 29.01.2025 | Message-Authenticator attribute
#### New
- Added `Message-Authenticator` attribute to all adapter responses.
  • Loading branch information
Tu-S authored Jan 29, 2025
1 parent df328ed commit b21a65d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions MultiFactor.Radius.Adapter/Server/RadiusServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,14 @@ private async void RouterRequestProcessed(object sender, PendingRequest request)
responsePacket.Attributes.Add("Proxy-State", requestPacket.Attributes.SingleOrDefault(o => o.Key == "Proxy-State").Value);
}
}

// page 12 https://fortinetweb.s3.amazonaws.com/docs.fortinet.com/v2/attachments/51019988-746d-11ef-8355-fa163e15d75b/fortios-v7.2.10-release-notes.pdf
if (!responsePacket.Attributes.ContainsKey("Message-Authenticator"))
{
var placeholder = new byte[16];
var placeholderStr = Encoding.Default.GetString(placeholder);
responsePacket.AddAttribute("Message-Authenticator", placeholderStr);
}

var debugLog = request.RequestPacket.Header.Code == PacketCode.StatusServer;
Send(responsePacket, request.RequestPacket?.UserName, request.RemoteEndpoint, request.ProxyEndpoint, debugLog);
Expand Down

0 comments on commit b21a65d

Please sign in to comment.