mirror of
https://github.com/PurpleI2P/i2pd
synced 2024-11-10 00:00:29 +03:00
check TokenRequest message size
This commit is contained in:
parent
a99fcfe54f
commit
72b61a29c2
@ -788,6 +788,11 @@ namespace transport
|
|||||||
void SSU2Session::ProcessTokenRequest (Header& header, uint8_t * buf, size_t len)
|
void SSU2Session::ProcessTokenRequest (Header& header, uint8_t * buf, size_t len)
|
||||||
{
|
{
|
||||||
// we are Bob
|
// we are Bob
|
||||||
|
if (len < 48)
|
||||||
|
{
|
||||||
|
LogPrint (eLogWarning, "SSU2: Incorrect TokenRequest len ", len);
|
||||||
|
return;
|
||||||
|
}
|
||||||
uint8_t nonce[12] = {0};
|
uint8_t nonce[12] = {0};
|
||||||
uint8_t h[32];
|
uint8_t h[32];
|
||||||
memcpy (h, header.buf, 16);
|
memcpy (h, header.buf, 16);
|
||||||
@ -920,6 +925,7 @@ namespace transport
|
|||||||
bool SSU2Session::ProcessHolePunch (uint8_t * buf, size_t len)
|
bool SSU2Session::ProcessHolePunch (uint8_t * buf, size_t len)
|
||||||
{
|
{
|
||||||
// we are Alice
|
// we are Alice
|
||||||
|
LogPrint (eLogDebug, "HolePunch");
|
||||||
Header header;
|
Header header;
|
||||||
memcpy (header.buf, buf, 16);
|
memcpy (header.buf, buf, 16);
|
||||||
header.ll[0] ^= CreateHeaderMask (i2p::context.GetSSU2IntroKey (), buf + (len - 24));
|
header.ll[0] ^= CreateHeaderMask (i2p::context.GetSSU2IntroKey (), buf + (len - 24));
|
||||||
|
Loading…
Reference in New Issue
Block a user