This commit is contained in:
Matija Petrunic 2020-04-17 11:07:58 +02:00
parent 7625aa8e46
commit 93d6a9a99b
3 changed files with 4 additions and 4 deletions

View File

@ -135,7 +135,7 @@ export class IKHandshake implements IHandshake {
private setEarlyData(data: Uint8Array|null|undefined): void {
if(data){
this.earlyData = Buffer.from(data.buffer, data.byteOffset, data.length);
this.remoteEarlyData = Buffer.from(data.buffer, data.byteOffset, data.length);
}
}
}

View File

@ -85,7 +85,7 @@ export class Noise implements INoiseConnection {
return {
conn,
earlyData: handshake.earlyData,
remoteEarlyData: handshake.remoteEarlyData,
remotePeer: handshake.remotePeer,
}
}

View File

@ -355,8 +355,8 @@ describe("Noise", () => {
noiseResp.secureInbound(remotePeer, inboundConnection),
]);
assert(inbound.earlyData.equals(localPeerEarlyData))
assert(outbound.earlyData.equals(Buffer.alloc(0)))
assert(inbound.remoteEarlyData.equals(localPeerEarlyData))
assert(outbound.remoteEarlyData.equals(Buffer.alloc(0)))
} catch (e) {
console.error(e);
assert(false, e.message);