From b1b045fff0b7b9a556a21311d7eedd812ba5bcb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marin=20Petruni=C4=87?= Date: Wed, 4 Mar 2020 09:02:59 +0100 Subject: [PATCH] disable noise pipes --- README.md | 3 +-- src/noise.ts | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 3a120f4..e6627fa 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ import {NOISE, Noise} from "libp2p-noise" //custom noise configuration, pass it instead of NOISE instance -const noise = new Noise(privateKey, Buffer.alloc(), false); +const noise = new Noise(privateKey, Buffer.alloc(x)); const libp2p = new Libp2p({ modules: { @@ -35,7 +35,6 @@ const libp2p = new Libp2p({ ``` Where parameters for Noise constructor are: - - *private key* - required parameter (32 bytes libp2p peer private key) - *static Noise key* - (optional) existing private Noise static key - *early data* - (optional) an early data payload to be sent in handshake messages diff --git a/src/noise.ts b/src/noise.ts index 5d25788..3a43cf2 100644 --- a/src/noise.ts +++ b/src/noise.ts @@ -42,11 +42,11 @@ export class Noise implements INoiseConnection { * * @param staticNoiseKey x25519 private key, reuse for faster handshakes * @param earlyData - * @param useNoisePipes enable IK handshake if initiator static key is known */ - constructor(staticNoiseKey?: bytes, earlyData?: bytes, useNoisePipes = true) { + constructor(staticNoiseKey?: bytes, earlyData?: bytes) { this.earlyData = earlyData || Buffer.alloc(0); - this.useNoisePipes = useNoisePipes; + //disabled until properly specked + this.useNoisePipes = false; if (staticNoiseKey) { const publicKey = x25519.publicKeyCreate(staticNoiseKey);