Merge pull request #59 from jacobheun/fix/public-key

fix: marshal the verified peer from its public key
This commit is contained in:
Marin Petrunić 2020-05-08 19:13:03 +02:00 committed by GitHub
commit ef80af69c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 {