secio: Add NULL cipher and allow more configuration. (#468)

* Introduce NULL cipher and allow more configuration.

* Back to using the hash-code for handshake.

Using `Endpoint` would be incompatible with the existing protocol.

* Add comments.
This commit is contained in:
Toralf Wittner
2018-09-12 09:10:05 +02:00
committed by GitHub
parent 5ecdb71c29
commit 6a5681aed7
12 changed files with 320 additions and 122 deletions

View File

@ -25,9 +25,9 @@
//! Here is a list of all the major concepts of libp2p.
//!
//! ## Multiaddr
//!
//!
//! A `Multiaddr` is a way to reach a node. Examples:
//!
//!
//! * `/ip4/80.123.90.4/tcp/5432`
//! * `/ip6/[::1]/udp/10560`
//! * `/unix//path/to/socket`
@ -92,9 +92,7 @@
//! # #[cfg(all(not(target_os = "emscripten"), feature = "libp2p-secio"))] {
//! use libp2p::{Transport, tcp::TcpConfig, secio::{SecioConfig, SecioKeyPair}};
//! let tcp_transport = TcpConfig::new();
//! let secio_upgrade = SecioConfig {
//! key: SecioKeyPair::ed25519_generated().unwrap(),
//! };
//! let secio_upgrade = SecioConfig::new(SecioKeyPair::ed25519_generated().unwrap());
//! let with_security = tcp_transport.with_upgrade(secio_upgrade);
//! // let _ = with_security.dial(...);
//! // `with_security` also implements the `Transport` trait, and all the connections opened