Browse Source

ignore zero length packets

pull/93/head
orignal 10 years ago
parent
commit
180fbcdac6
  1. 3
      SSU.cpp

3
SSU.cpp

@ -88,6 +88,7 @@ namespace ssu
if (m_State == eSessionStateEstablished) if (m_State == eSessionStateEstablished)
ScheduleTermination (); ScheduleTermination ();
if (!len) return; // ignore zero-length packets
if (m_IsSessionKey && Validate (buf, len, m_MacKey)) // try session key first if (m_IsSessionKey && Validate (buf, len, m_MacKey)) // try session key first
DecryptSessionKey (buf, len); DecryptSessionKey (buf, len);
else else
@ -820,7 +821,7 @@ namespace ssu
// encrypt message with session key // encrypt message with session key
FillHeaderAndEncrypt (PAYLOAD_TYPE_SESSION_DESTROYED, buf, 48); FillHeaderAndEncrypt (PAYLOAD_TYPE_SESSION_DESTROYED, buf, 48);
Send (buf, 48); Send (buf, 48);
LogPrint ("SSU session destoryed sent"); LogPrint ("SSU session destroyed sent");
} }
} }

Loading…
Cancel
Save