Skip to content

Commit e9af13a

Browse files
committed
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
1 parent c8905cc commit e9af13a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ export async function verifySignedPayload(
9797
if (!payload.identitySig || !publicKey.verify(generatedPayload, Buffer.from(payload.identitySig))) {
9898
throw new Error("Static key doesn't match to peer that signed payload!");
9999
}
100-
return remotePeer;
100+
return PeerId.createFromPubKey(identityKey);
101101
}
102102

103103
export function getHkdf(ck: bytes32, ikm: bytes): Hkdf {

0 commit comments

Comments
 (0)