Verify peer id

This commit is contained in:
morrigan
2019-12-03 13:39:33 +01:00
parent 88bc55ac41
commit e0806499ff
7 changed files with 43 additions and 30 deletions

View File

@ -59,9 +59,9 @@ describe("Noise", () => {
const prologue = Buffer.from('/noise');
const staticKeys = generateKeypair();
const xx = new XXHandshake();
const libp2pPubKey = remotePeer.pubKey.marshal();
const libp2pPubKey = remotePeer.marshalPubKey();
const libp2pPrivKey = remotePeer.privKey.marshal().slice(0, 32);
const handshake = new Handshake(false, libp2pPrivKey, libp2pPubKey, prologue, staticKeys, wrapped, xx);
const handshake = new Handshake(false, libp2pPrivKey, libp2pPubKey, prologue, staticKeys, wrapped, localPeer, xx);
let receivedMessageBuffer = decodeMessageBuffer((await wrapped.readLP()).slice());
// The first handshake message contains the initiator's ephemeral public key