mirror of
https://github.com/fluencelabs/js-libp2p-noise
synced 2025-04-25 14:12:30 +00:00
Address PR comment
This commit is contained in:
parent
737dabdce0
commit
cca8b362cb
@ -113,15 +113,15 @@ export class Noise implements INoiseConnection {
|
||||
if (this.useNoisePipes && remoteStaticKey) {
|
||||
// Try IK first
|
||||
const { remotePeer, connection, isInitiator } = params;
|
||||
const IKhandshake = new IKHandshake(isInitiator, payload, this.prologue, this.staticKeys, connection, remotePeer, remoteStaticKey);
|
||||
const ikHandshake = new IKHandshake(isInitiator, payload, this.prologue, this.staticKeys, connection, remotePeer, remoteStaticKey);
|
||||
|
||||
try {
|
||||
return await this.performIKHandshake(IKhandshake);
|
||||
return await this.performIKHandshake(ikHandshake);
|
||||
} catch (e) {
|
||||
// IK failed, go to XX fallback
|
||||
let ephemeralKeys;
|
||||
if (params.isInitiator) {
|
||||
ephemeralKeys = IKhandshake.getRemoteEphemeralKeys();
|
||||
ephemeralKeys = ikHandshake.getRemoteEphemeralKeys();
|
||||
}
|
||||
return await this.performXXFallbackHandshake(params, payload, e.initialMsg, ephemeralKeys);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user