protected void HandleControlCookie(PeerSecAssociation sa,
MemBlock calc_cookie, SecurityControlMessage scm,
SecurityControlMessage scm_reply, ISender return_path,
ISender low_level_sender)
{
ProtocolLog.WriteIf(ProtocolLog.Security, String.Format(
"{0}, Received Cookie from: {1}, In-Cookie: {2}",
GetHashCode(), low_level_sender, scm.LocalCookie));
scm_reply.Type = SecurityControlMessage.MessageType.CookieResponse;
scm_reply.RemoteCookie = scm.LocalCookie;
scm_reply.LocalCookie = calc_cookie;
if(SecurityPolicy.GetPolicy(scm.SPI).PreExchangedKeys) {
scm_reply.CAs = new List<MemBlock>(0);
} else {
scm_reply.CAs = _ch.SupportedCAs;
}
ICopyable to_send = new CopyList(SecureControl, scm_reply.Packet);
return_path.Send(to_send);
ProtocolLog.WriteIf(ProtocolLog.Security, String.Format(
"{0}, Successful Cookie from: {1}, Out-Cookie: {2}",
GetHashCode(), low_level_sender, calc_cookie));
}