Browse Source

correct signed content for peer test msg 3

pull/1771/head
orignal 2 years ago
parent
commit
ae77d4ad22
  1. 3
      libi2pd/SSU2Session.cpp

3
libi2pd/SSU2Session.cpp

@ -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…
Cancel
Save