mirror of
https://github.com/fluencelabs/js-libp2p-noise
synced 2025-04-25 14:32:18 +00:00
Lint fix
This commit is contained in:
parent
3bd2145079
commit
73c336088e
@ -71,7 +71,7 @@ export class Handshake extends XXHandshake {
|
|||||||
}
|
}
|
||||||
logger("All good with the signature!");
|
logger("All good with the signature!");
|
||||||
} else {
|
} else {
|
||||||
logger('Stage 1 - Responder sending out first message with signed payload and static key.');
|
logger('XX Fallback Stage 1 - Responder sending out first message with signed payload and static key.');
|
||||||
const signedPayload = signPayload(this.libp2pPrivateKey, getHandshakePayload(this.staticKeys.publicKey));
|
const signedPayload = signPayload(this.libp2pPrivateKey, getHandshakePayload(this.staticKeys.publicKey));
|
||||||
const signedEarlyDataPayload = signEarlyDataPayload(this.libp2pPrivateKey, Buffer.alloc(0));
|
const signedEarlyDataPayload = signEarlyDataPayload(this.libp2pPrivateKey, Buffer.alloc(0));
|
||||||
const handshakePayload = await createHandshakePayload(
|
const handshakePayload = await createHandshakePayload(
|
||||||
@ -83,7 +83,7 @@ export class Handshake extends XXHandshake {
|
|||||||
|
|
||||||
const messageBuffer = this.xx.sendMessage(this.session, handshakePayload);
|
const messageBuffer = this.xx.sendMessage(this.session, handshakePayload);
|
||||||
this.connection.writeLP(encode1(messageBuffer));
|
this.connection.writeLP(encode1(messageBuffer));
|
||||||
logger('Stage 1 - Responder sent the second handshake message with signed payload.')
|
logger('XX Fallback Stage 1 - Responder sent the second handshake message with signed payload.')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -164,7 +164,7 @@ export class Noise implements NoiseConnection {
|
|||||||
params: HandshakeParams,
|
params: HandshakeParams,
|
||||||
): Promise<IK> {
|
): Promise<IK> {
|
||||||
const { isInitiator, libp2pPublicKey, remotePeer, connection } = params;
|
const { isInitiator, libp2pPublicKey, remotePeer, connection } = params;
|
||||||
const handshake = new IK(params.isInitiator, this.privateKey, params.libp2pPublicKey, this.prologue, this.staticKeys, params.connection, remotePeer);
|
const handshake = new IK(isInitiator, this.privateKey, libp2pPublicKey, this.prologue, this.staticKeys, connection, remotePeer);
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ export async function createHandshakePayload(
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export function signPayload(libp2pPrivateKey: bytes, payload: bytes) {
|
export function signPayload(libp2pPrivateKey: bytes, payload: bytes): bytes {
|
||||||
return ed25519.sign(payload, libp2pPrivateKey);
|
return ed25519.sign(payload, libp2pPrivateKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,6 @@ import {
|
|||||||
createHandshakePayload,
|
createHandshakePayload,
|
||||||
generateKeypair,
|
generateKeypair,
|
||||||
getHandshakePayload,
|
getHandshakePayload,
|
||||||
signEarlyDataPayload,
|
|
||||||
signPayload
|
signPayload
|
||||||
} from "../src/utils";
|
} from "../src/utils";
|
||||||
import {generateEd25519Keys, getKeyPairFromPeerId} from "./utils";
|
import {generateEd25519Keys, getKeyPairFromPeerId} from "./utils";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user