|
|
@ -842,12 +842,12 @@ namespace ssu |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void SSUSession::SendSesionDestroyed () |
|
|
|
void SSUSession::SendSesionDestroyed () |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (HasSessionKey ()) |
|
|
|
{ |
|
|
|
{ |
|
|
|
uint8_t buf[48 + 18], iv[16]; |
|
|
|
uint8_t buf[48 + 18], iv[16]; |
|
|
|
CryptoPP::RandomNumberGenerator& rnd = i2p::context.GetRandomNumberGenerator (); |
|
|
|
CryptoPP::RandomNumberGenerator& rnd = i2p::context.GetRandomNumberGenerator (); |
|
|
|
rnd.GenerateBlock (iv, 16); // random iv
|
|
|
|
rnd.GenerateBlock (iv, 16); // random iv
|
|
|
|
if (m_State == eSessionStateEstablished) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
// encrypt message with session key
|
|
|
|
// encrypt message with session key
|
|
|
|
FillHeaderAndEncrypt (PAYLOAD_TYPE_SESSION_DESTROYED, buf, 48, m_SessionKey, iv, m_MacKey); |
|
|
|
FillHeaderAndEncrypt (PAYLOAD_TYPE_SESSION_DESTROYED, buf, 48, m_SessionKey, iv, m_MacKey); |
|
|
|
m_Server.Send (buf, 48, m_RemoteEndpoint); |
|
|
|
m_Server.Send (buf, 48, m_RemoteEndpoint); |
|
|
|