Browse Source

check TokenRequest message size

pull/1771/head
orignal 2 years ago
parent
commit
72b61a29c2
  1. 6
      libi2pd/SSU2Session.cpp

6
libi2pd/SSU2Session.cpp

@ -788,6 +788,11 @@ namespace transport @@ -788,6 +788,11 @@ namespace transport
void SSU2Session::ProcessTokenRequest (Header& header, uint8_t * buf, size_t len)
{
// we are Bob
if (len < 48)
{
LogPrint (eLogWarning, "SSU2: Incorrect TokenRequest len ", len);
return;
}
uint8_t nonce[12] = {0};
uint8_t h[32];
memcpy (h, header.buf, 16);
@ -920,6 +925,7 @@ namespace transport @@ -920,6 +925,7 @@ namespace transport
bool SSU2Session::ProcessHolePunch (uint8_t * buf, size_t len)
{
// we are Alice
LogPrint (eLogDebug, "HolePunch");
Header header;
memcpy (header.buf, buf, 16);
header.ll[0] ^= CreateHeaderMask (i2p::context.GetSSU2IntroKey (), buf + (len - 24));

Loading…
Cancel
Save