mirror of
https://github.com/fluencelabs/js-libp2p-noise
synced 2025-04-25 14:42:29 +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!");
|
||||
} 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 signedEarlyDataPayload = signEarlyDataPayload(this.libp2pPrivateKey, Buffer.alloc(0));
|
||||
const handshakePayload = await createHandshakePayload(
|
||||
@ -83,7 +83,7 @@ export class Handshake extends XXHandshake {
|
||||
|
||||
const messageBuffer = this.xx.sendMessage(this.session, handshakePayload);
|
||||
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,
|
||||
): Promise<IK> {
|
||||
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
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -6,7 +6,6 @@ import {
|
||||
createHandshakePayload,
|
||||
generateKeypair,
|
||||
getHandshakePayload,
|
||||
signEarlyDataPayload,
|
||||
signPayload
|
||||
} from "../src/utils";
|
||||
import {generateEd25519Keys, getKeyPairFromPeerId} from "./utils";
|
||||
|
Loading…
x
Reference in New Issue
Block a user