forked from libp2p/rust-libp2p
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support spec-compliant reading of noise handshake payloads.
See libp2p#1631. This the first of a three-step process to addressing the issue. In this step, support for reading noise handshake payloads without an additional length prefix is added, falling back to attempting a decoding with length prefix on failure. Length prefixes are still sent in this step. Hence interoperability with other libp2p implementations is not yet achieved after with step. To achieve a better separation of handshake and transport I/O, the `NoiseFramed` type has been extracted from `NoiseOutput`. `NoiseFramed` is a `Sink` and `Stream` of length-delimited Noise protocol messages. This type is used in the handshake phase. Once a handshake completes the underlying Noise session transitions to transport mode and the `NoiseFramed` is wrapped in the `NoiseOutput` which provides a regular `AsyncRead` / `AsyncWrite` I/O resource on top of the framed encoding. No new buffers are introduced, they are just split between `NoiseFramed` and `NoiseOutput`. The second step involves removing the sending of the length prefix in a subsequent release. The third step involves removing the support for reading length-prefixed protobuf payloads.
- Loading branch information
Roman S. Borschel
committed
Jul 9, 2020
1 parent
68587ee
commit d14229a
Showing
7 changed files
with
592 additions
and
446 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
[package] | ||
name = "libp2p-noise" | ||
description = "Cryptographic handshake protocol using the noise framework." | ||
version = "0.20.0" | ||
version = "0.21.0" | ||
authors = ["Parity Technologies <[email protected]>"] | ||
license = "MIT" | ||
repository = "https://github.com/libp2p/rust-libp2p" | ||
|
@@ -21,10 +21,10 @@ x25519-dalek = "0.6.0" | |
zeroize = "1" | ||
|
||
[target.'cfg(not(target_arch = "wasm32"))'.dependencies] | ||
snow = { version = "0.7.0", features = ["ring-resolver"], default-features = false } | ||
snow = { version = "0.7.1", features = ["ring-resolver"], default-features = false } | ||
|
||
[target.'cfg(target_arch = "wasm32")'.dependencies] | ||
snow = { version = "0.7.0", features = ["default-resolver"], default-features = false } | ||
snow = { version = "0.7.1", features = ["default-resolver"], default-features = false } | ||
|
||
[dev-dependencies] | ||
env_logger = "0.7.1" | ||
|
Oops, something went wrong.