mirror of
https://github.com/fluencelabs/js-libp2p-noise
synced 2025-06-10 21:51:24 +00:00
Reuse super method
This commit is contained in:
@ -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}`);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user