mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-03-21 16:49:10 +01:00
correct signed content for peer test msg 3
This commit is contained in:
parent
821987fed7
commit
ae77d4ad22
1 changed files with 2 additions and 1 deletions
|
@ -1525,11 +1525,12 @@ namespace transport
|
||||||
// sign with Charlie's key
|
// sign with Charlie's key
|
||||||
uint8_t asz = buf[offset + 9];
|
uint8_t asz = buf[offset + 9];
|
||||||
std::vector<uint8_t> newSignedData (asz + 10 + i2p::context.GetIdentity ()->GetSignatureLen ());
|
std::vector<uint8_t> newSignedData (asz + 10 + i2p::context.GetIdentity ()->GetSignatureLen ());
|
||||||
|
memcpy (newSignedData.data (), buf + offset, asz + 10);
|
||||||
SignedData s;
|
SignedData s;
|
||||||
s.Insert ((const uint8_t *)"PeerTestValidate", 16); // prologue
|
s.Insert ((const uint8_t *)"PeerTestValidate", 16); // prologue
|
||||||
s.Insert (GetRemoteIdentity ()->GetIdentHash (), 32); // bhash
|
s.Insert (GetRemoteIdentity ()->GetIdentHash (), 32); // bhash
|
||||||
s.Insert (buf + 3, 32); // ahash
|
s.Insert (buf + 3, 32); // ahash
|
||||||
s.Insert (buf + offset, asz + 10); // ver, nonce, ts, asz, Alice's endpoint
|
s.Insert (newSignedData.data (), asz + 10); // ver, nonce, ts, asz, Alice's endpoint
|
||||||
s.Sign (i2p::context.GetPrivateKeys (), newSignedData.data () + 10 + asz);
|
s.Sign (i2p::context.GetPrivateKeys (), newSignedData.data () + 10 + asz);
|
||||||
// send response (msg 3) back and msg 5 if accepted
|
// send response (msg 3) back and msg 5 if accepted
|
||||||
SSU2PeerTestCode code = eSSU2PeerTestCodeAccept;
|
SSU2PeerTestCode code = eSSU2PeerTestCodeAccept;
|
||||||
|
|
Loading…
Add table
Reference in a new issue