From 38d6c29ce99a8d80953daef13034d7f22d21257a Mon Sep 17 00:00:00 2001 From: orignal Date: Fri, 3 Jun 2022 08:39:54 -0400 Subject: [PATCH] correct timestamp size for peer test message --- libi2pd/SSU2.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libi2pd/SSU2.cpp b/libi2pd/SSU2.cpp index 9fafe7e6..92631350 100644 --- a/libi2pd/SSU2.cpp +++ b/libi2pd/SSU2.cpp @@ -1614,15 +1614,15 @@ namespace transport signedData[0] = 2; // ver htobe32buf (signedData + 1, nonce); htobe32buf (signedData + 5, ts); - size_t asz = CreateEndpoint (signedData + 7, 86, boost::asio::ip::udp::endpoint (localAddress->host, localAddress->port)); - signedData[6] = asz; + size_t asz = CreateEndpoint (signedData + 10, 86, boost::asio::ip::udp::endpoint (localAddress->host, localAddress->port)); + signedData[9] = asz; // signature SignedData s; s.Insert ((const uint8_t *)"PeerTestValidate", 16); // prologue s.Insert (GetRemoteIdentity ()->GetIdentHash (), 32); // bhash - s.Insert (signedData, 7 + asz); // ver, nonce, ts, asz, Alice's endpoint - s.Sign (i2p::context.GetPrivateKeys (), signedData + 7 + asz); - return CreatePeerTestBlock (buf, len, 1, nullptr, signedData, 7 + asz + i2p::context.GetIdentity ()->GetSignatureLen ()); + s.Insert (signedData, 10 + asz); // ver, nonce, ts, asz, Alice's endpoint + s.Sign (i2p::context.GetPrivateKeys (), signedData + 10 + asz); + return CreatePeerTestBlock (buf, len, 1, nullptr, signedData, 10 + asz + i2p::context.GetIdentity ()->GetSignatureLen ()); } std::shared_ptr SSU2Session::ExtractRouterInfo (const uint8_t * buf, size_t size)