mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-02-02 06:54:15 +00:00
correct buffer size for token request
This commit is contained in:
parent
321ec8ae4d
commit
4670b12d49
@ -645,7 +645,7 @@ namespace transport
|
|||||||
{
|
{
|
||||||
// we are Alice
|
// we are Alice
|
||||||
Header header;
|
Header header;
|
||||||
uint8_t h[32], payload[40];
|
uint8_t h[32], payload[41];
|
||||||
// fill packet
|
// fill packet
|
||||||
header.h.connID = m_DestConnID; // dest id
|
header.h.connID = m_DestConnID; // dest id
|
||||||
RAND_bytes (header.buf + 8, 4); // random packet num
|
RAND_bytes (header.buf + 8, 4); // random packet num
|
||||||
@ -661,7 +661,7 @@ namespace transport
|
|||||||
htobe16buf (payload + 1, 4);
|
htobe16buf (payload + 1, 4);
|
||||||
htobe32buf (payload + 3, i2p::util::GetSecondsSinceEpoch ());
|
htobe32buf (payload + 3, i2p::util::GetSecondsSinceEpoch ());
|
||||||
size_t payloadSize = 7;
|
size_t payloadSize = 7;
|
||||||
payloadSize += CreatePaddingBlock (payload + payloadSize, 40 - payloadSize, 1);
|
payloadSize += CreatePaddingBlock (payload + payloadSize, 25 - payloadSize, 1);
|
||||||
// encrypt
|
// encrypt
|
||||||
uint8_t nonce[12];
|
uint8_t nonce[12];
|
||||||
CreateNonce (be32toh (header.h.packetNum), nonce);
|
CreateNonce (be32toh (header.h.packetNum), nonce);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user