Reuse super method

This commit is contained in:
Matija Petrunic 2020-04-17 11:14:27 +02:00
parent 01a4388fa2
commit 7c62ef4b47
2 changed files with 2 additions and 8 deletions

View File

@ -66,13 +66,7 @@ export class XXFallbackHandshake extends XXHandshake {
const decodedPayload = await decodePayload(plaintext);
this.remotePeer = this.remotePeer || await getPeerIdFromPayload(decodedPayload);
await verifySignedPayload(this.session.hs.rs, decodedPayload, this.remotePeer);
if(decodedPayload.data){
this.remoteEarlyData = Buffer.from(
decodedPayload.data.buffer,
decodedPayload.data.byteOffset,
decodedPayload.data.length
);
}
this.setRemoteEarlyData(decodedPayload.data)
} catch (e) {
throw new Error(`Error occurred while verifying signed payload from responder: ${e.message}`);
}

View File

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