fix: marshal the verified peer from its public key

This ensures that completed outbound handshakes will always contain the public key of the remote peer
This commit is contained in:
Jacob Heun 2020-05-07 16:24:15 +02:00
parent c8905cc774
commit e9af13a1ee
No known key found for this signature in database
GPG Key ID: CA5A94C15809879F

View File

@ -97,7 +97,7 @@ export async function verifySignedPayload(
if (!payload.identitySig || !publicKey.verify(generatedPayload, Buffer.from(payload.identitySig))) {
throw new Error("Static key doesn't match to peer that signed payload!");
}
return remotePeer;
return PeerId.createFromPubKey(identityKey);
}
export function getHkdf(ck: bytes32, ikm: bytes): Hkdf {