Verify payload in stage 1

This commit is contained in:
morrigan
2019-12-02 13:18:31 +01:00
parent 7b03a3df3b
commit bf9ae90a5e
4 changed files with 11 additions and 8 deletions

View File

@ -80,7 +80,7 @@ export class Handshake {
if (!libp2pRemotekey) {
throw new Error("Missing remote's libp2p public key, can't verify signature.");
}
verifySignedPayload(receivedMessageBuffer.ns, plaintext, libp2pRemotekey);
await verifySignedPayload(receivedMessageBuffer.ns, plaintext, libp2pRemotekey);
} else {
logger('Stage 1 - Responder sending out first message with signed payload and static key.');
const signedPayload = signPayload(this.libp2pPrivateKey, getHandshakePayload(this.staticKeys.publicKey));