mirror of
https://github.com/fluencelabs/js-libp2p-noise
synced 2025-04-25 15:02:24 +00:00
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:
parent
c8905cc774
commit
e9af13a1ee
@ -97,7 +97,7 @@ export async function verifySignedPayload(
|
|||||||
if (!payload.identitySig || !publicKey.verify(generatedPayload, Buffer.from(payload.identitySig))) {
|
if (!payload.identitySig || !publicKey.verify(generatedPayload, Buffer.from(payload.identitySig))) {
|
||||||
throw new Error("Static key doesn't match to peer that signed payload!");
|
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 {
|
export function getHkdf(ck: bytes32, ikm: bytes): Hkdf {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user