mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 04:04:16 +00:00
close SSU session if MAC verification fails
This commit is contained in:
parent
56836470cf
commit
9ef8ae99e2
11
SSU.cpp
11
SSU.cpp
@ -418,7 +418,10 @@ namespace ssu
|
|||||||
LogPrint ("Unexpected payload type ", (int)(header->flag >> 4));
|
LogPrint ("Unexpected payload type ", (int)(header->flag >> 4));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
LogPrint ("MAC verification failed");
|
LogPrint ("MAC verification failed");
|
||||||
|
Failed ();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
LogPrint ("SSU is not supported");
|
LogPrint ("SSU is not supported");
|
||||||
@ -511,6 +514,14 @@ namespace ssu
|
|||||||
m_DelayedMessages.clear ();
|
m_DelayedMessages.clear ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SSUSession::Failed ()
|
||||||
|
{
|
||||||
|
m_State = eSessionStateFailed;
|
||||||
|
Close ();
|
||||||
|
if (m_Server)
|
||||||
|
m_Server->DeleteSession (this); // delete this
|
||||||
|
}
|
||||||
|
|
||||||
const uint8_t * SSUSession::GetIntroKey () const
|
const uint8_t * SSUSession::GetIntroKey () const
|
||||||
{
|
{
|
||||||
|
4
SSU.h
4
SSU.h
@ -58,7 +58,8 @@ namespace ssu
|
|||||||
eSessionRelayRequestSent,
|
eSessionRelayRequestSent,
|
||||||
eSessionRelayRequestReceived,
|
eSessionRelayRequestReceived,
|
||||||
eSessionRelayResponseReceived,
|
eSessionRelayResponseReceived,
|
||||||
eSessionStateEstablished
|
eSessionStateEstablished,
|
||||||
|
eSessionStateFailed
|
||||||
};
|
};
|
||||||
|
|
||||||
class SSUServer;
|
class SSUServer;
|
||||||
@ -91,6 +92,7 @@ namespace ssu
|
|||||||
void SendSessionConfirmed (const uint8_t * y, const uint8_t * ourAddress, uint32_t relayTag);
|
void SendSessionConfirmed (const uint8_t * y, const uint8_t * ourAddress, uint32_t relayTag);
|
||||||
void ProcessRelayResponse (uint8_t * buf, size_t len);
|
void ProcessRelayResponse (uint8_t * buf, size_t len);
|
||||||
void Established ();
|
void Established ();
|
||||||
|
void Failed ();
|
||||||
void ProcessData (uint8_t * buf, size_t len);
|
void ProcessData (uint8_t * buf, size_t len);
|
||||||
void SendMsgAck (uint32_t msgID);
|
void SendMsgAck (uint32_t msgID);
|
||||||
void SendSesionDestroyed ();
|
void SendSesionDestroyed ();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user