diff --git a/Cargo.toml b/Cargo.toml index cbef55bdb84..9b3ba569795 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -32,7 +32,7 @@ libp2p-swarm = { version = "0.2.0", path = "swarm" } libp2p-uds = { version = "0.12.0", path = "transports/uds" } libp2p-wasm-ext = { version = "0.5.0", path = "transports/wasm-ext" } libp2p-yamux = { version = "0.12.0", path = "muxers/yamux" } -parking_lot = "0.8" +parking_lot = "0.9.0" smallvec = "0.6" tokio-codec = "0.1" tokio-executor = "0.1" @@ -48,7 +48,7 @@ libp2p-tcp = { version = "0.12.0", path = "transports/tcp" } libp2p-websocket = { version = "0.12.0", path = "transports/websocket", optional = true } [dev-dependencies] -env_logger = "0.6.0" +env_logger = "0.7.1" tokio = "0.1" tokio-stdin-stdout = "0.1" diff --git a/core/Cargo.toml b/core/Cargo.toml index f83c8ec731c..1fc5741197f 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -11,9 +11,9 @@ categories = ["network-programming", "asynchronous"] [dependencies] asn1_der = "0.6.1" -bs58 = "0.2.0" +bs58 = "0.3.0" bytes = "0.4" -ed25519-dalek = "1.0.0-pre.1" +ed25519-dalek = "1.0.0-pre.2" failure = "0.1" fnv = "1.0" lazy_static = "1.2" @@ -22,10 +22,10 @@ multiaddr = { package = "parity-multiaddr", version = "0.5.0", path = "../misc/m multihash = { package = "parity-multihash", version = "0.1.0", path = "../misc/multihash" } multistream-select = { version = "0.5.0", path = "../misc/multistream-select" } futures = "0.1" -parking_lot = "0.8" +parking_lot = "0.9.0" protobuf = "2.8" quick-error = "1.2" -rand = "0.6" +rand = "0.7" rw-stream-sink = { version = "0.1.1", path = "../misc/rw-stream-sink" } libsecp256k1 = { version = "0.3.1", optional = true } sha2 = "0.8.0" @@ -38,16 +38,16 @@ void = "1" zeroize = "1" [target.'cfg(not(any(target_os = "emscripten", target_os = "unknown")))'.dependencies] -ring = { version = "^0.16", features = ["alloc", "std"], default-features = false } -untrusted = { version = "0.6" } +ring = { version = "0.16.9", features = ["alloc", "std"], default-features = false } +untrusted = "0.7.0" [dev-dependencies] libp2p-swarm = { version = "0.2.0", path = "../swarm" } libp2p-tcp = { version = "0.12.0", path = "../transports/tcp" } libp2p-mplex = { version = "0.12.0", path = "../muxers/mplex" } libp2p-secio = { version = "0.12.0", path = "../protocols/secio" } -rand = "0.6" -quickcheck = "0.8" +rand = "0.7.2" +quickcheck = "0.9.0" tokio = "0.1" wasm-timer = "0.1" assert_matches = "1.3" diff --git a/core/src/identity/ed25519.rs b/core/src/identity/ed25519.rs index 8cb049451e0..17b1dc27066 100644 --- a/core/src/identity/ed25519.rs +++ b/core/src/identity/ed25519.rs @@ -22,6 +22,7 @@ use ed25519_dalek as ed25519; use failure::Fail; +use rand::RngCore; use super::error::DecodingError; use zeroize::Zeroize; use core::fmt; @@ -32,7 +33,7 @@ pub struct Keypair(ed25519::Keypair); impl Keypair { /// Generate a new Ed25519 keypair. pub fn generate() -> Keypair { - Keypair(ed25519::Keypair::generate(&mut rand::thread_rng())) + Keypair::from(SecretKey::generate()) } /// Encode the keypair into a byte array by concatenating the bytes @@ -94,9 +95,9 @@ impl From for SecretKey { /// Promote an Ed25519 secret key into a keypair. impl From for Keypair { fn from(sk: SecretKey) -> Keypair { - let secret = sk.0; + let secret: ed25519::ExpandedSecretKey = (&sk.0).into(); let public = ed25519::PublicKey::from(&secret); - Keypair(ed25519::Keypair { secret, public }) + Keypair(ed25519::Keypair { secret: sk.0, public }) } } @@ -151,7 +152,10 @@ impl fmt::Debug for SecretKey { impl SecretKey { /// Generate a new Ed25519 secret key. pub fn generate() -> SecretKey { - SecretKey(ed25519::SecretKey::generate(&mut rand::thread_rng())) + let mut bytes = [0u8; 32]; + rand::thread_rng().fill_bytes(&mut bytes); + SecretKey(ed25519::SecretKey::from_bytes(&bytes) + .expect("this returns `Err` only if the length is wrong; the length is correct; qed")) } /// Create an Ed25519 secret key from a byte slice, zeroing the input on success. diff --git a/misc/multiaddr/Cargo.toml b/misc/multiaddr/Cargo.toml index 3d14f53481d..d275bf0c6d3 100644 --- a/misc/multiaddr/Cargo.toml +++ b/misc/multiaddr/Cargo.toml @@ -10,7 +10,7 @@ version = "0.5.0" [dependencies] arrayref = "0.3" -bs58 = "0.2.0" +bs58 = "0.3.0" byteorder = "1.3.1" bytes = "0.4.12" data-encoding = "2.1" @@ -22,8 +22,8 @@ url = { version = "2.1.0", default-features = false } [dev-dependencies] bincode = "1" -bs58 = "0.2.0" +bs58 = "0.3.0" data-encoding = "2" -quickcheck = "0.8.1" -rand = "0.6.5" +quickcheck = "0.9.0" +rand = "0.7.2" serde_json = "1.0" diff --git a/misc/multistream-select/Cargo.toml b/misc/multistream-select/Cargo.toml index 0a5fce0be6d..988e0e45269 100644 --- a/misc/multistream-select/Cargo.toml +++ b/misc/multistream-select/Cargo.toml @@ -11,14 +11,14 @@ edition = "2018" [dependencies] bytes = "0.4" -futures = { version = "0.1" } +futures = "0.1" log = "0.4" smallvec = "0.6" tokio-io = "0.1" -unsigned-varint = { version = "0.2.2" } +unsigned-varint = "0.2.2" [dev-dependencies] tokio = "0.1" tokio-tcp = "0.1" -quickcheck = "0.8" -rand = "0.6" +quickcheck = "0.9.0" +rand = "0.7.2" diff --git a/protocols/deflate/Cargo.toml b/protocols/deflate/Cargo.toml index 035a739457f..a717dee7543 100644 --- a/protocols/deflate/Cargo.toml +++ b/protocols/deflate/Cargo.toml @@ -16,8 +16,8 @@ tokio-io = "0.1.12" flate2 = { version = "1.0", features = ["tokio"] } [dev-dependencies] -env_logger = "0.6" +env_logger = "0.7.1" libp2p-tcp = { version = "0.12.0", path = "../../transports/tcp" } -quickcheck = "0.8" +quickcheck = "0.9.0" tokio = "0.1" log = "0.4" diff --git a/protocols/floodsub/Cargo.toml b/protocols/floodsub/Cargo.toml index 08ebce8ffaa..48154293070 100644 --- a/protocols/floodsub/Cargo.toml +++ b/protocols/floodsub/Cargo.toml @@ -10,7 +10,7 @@ keywords = ["peer-to-peer", "libp2p", "networking"] categories = ["network-programming", "asynchronous"] [dependencies] -bs58 = "0.2.0" +bs58 = "0.3.0" bytes = "0.4" cuckoofilter = "0.3.2" fnv = "1.0" diff --git a/protocols/kad/Cargo.toml b/protocols/kad/Cargo.toml index 1307b7ad0f3..7fbb0331244 100644 --- a/protocols/kad/Cargo.toml +++ b/protocols/kad/Cargo.toml @@ -10,7 +10,7 @@ keywords = ["peer-to-peer", "libp2p", "networking"] categories = ["network-programming", "asynchronous"] [dependencies] -arrayvec = "0.4.7" +arrayvec = "0.5.1" bytes = "0.4" either = "1.5" fnv = "1.0" @@ -21,7 +21,7 @@ libp2p-swarm = { version = "0.2.0", path = "../../swarm" } multiaddr = { package = "parity-multiaddr", version = "0.5.0", path = "../../misc/multiaddr" } multihash = { package = "parity-multihash", version = "0.1.0", path = "../../misc/multihash" } protobuf = "2.8" -rand = "0.6.0" +rand = "0.7.2" sha2 = "0.8.0" smallvec = "0.6" tokio-codec = "0.1" @@ -35,6 +35,6 @@ void = "1.0" libp2p-secio = { version = "0.12.0", path = "../secio" } libp2p-tcp = { version = "0.12.0", path = "../../transports/tcp" } libp2p-yamux = { version = "0.12.0", path = "../../muxers/yamux" } -quickcheck = "0.8" -rand = "0.6.0" +quickcheck = "0.9.0" +rand = "0.7.2" tokio = "0.1" diff --git a/protocols/noise/Cargo.toml b/protocols/noise/Cargo.toml index feeacacf46a..5e673297d5b 100644 --- a/protocols/noise/Cargo.toml +++ b/protocols/noise/Cargo.toml @@ -15,16 +15,16 @@ lazy_static = "1.2" libp2p-core = { version = "0.12.0", path = "../../core" } log = "0.4" protobuf = "2.8" -rand = "^0.7" -ring = { version = "^0.16", features = ["alloc"], default-features = false } +rand = "^0.7.2" +ring = { version = "0.16.9", features = ["alloc"], default-features = false } snow = { version = "0.6.1", features = ["ring-resolver"], default-features = false } tokio-io = "0.1" x25519-dalek = "0.5" zeroize = "1" [dev-dependencies] -env_logger = "0.6" +env_logger = "0.7.1" libp2p-tcp = { version = "0.12.0", path = "../../transports/tcp" } -quickcheck = "0.8" +quickcheck = "0.9.0" tokio = "0.1" sodiumoxide = "^0.2.5" diff --git a/protocols/noise/src/protocol.rs b/protocols/noise/src/protocol.rs index 4908c6be0d9..60124f86b01 100644 --- a/protocols/noise/src/protocol.rs +++ b/protocols/noise/src/protocol.rs @@ -252,4 +252,3 @@ impl rand::RngCore for Rng { impl rand::CryptoRng for Rng {} impl snow::types::Random for Rng {} - diff --git a/protocols/ping/Cargo.toml b/protocols/ping/Cargo.toml index cde291aaf27..b00df8049eb 100644 --- a/protocols/ping/Cargo.toml +++ b/protocols/ping/Cargo.toml @@ -16,7 +16,7 @@ libp2p-swarm = { version = "0.2.0", path = "../../swarm" } log = "0.4.1" multiaddr = { package = "parity-multiaddr", version = "0.5.0", path = "../../misc/multiaddr" } futures = "0.1" -rand = "0.6" +rand = "0.7.2" tokio-io = "0.1" wasm-timer = "0.1" void = "1.0" @@ -25,6 +25,6 @@ void = "1.0" libp2p-tcp = { version = "0.12.0", path = "../../transports/tcp" } libp2p-secio = { version = "0.12.0", path = "../../protocols/secio" } libp2p-yamux = { version = "0.12.0", path = "../../muxers/yamux" } -quickcheck = "0.8" +quickcheck = "0.9.0" tokio = "0.1" tokio-tcp = "0.1" diff --git a/protocols/plaintext/Cargo.toml b/protocols/plaintext/Cargo.toml index 4c3d501f4d5..74aaa33a15e 100644 --- a/protocols/plaintext/Cargo.toml +++ b/protocols/plaintext/Cargo.toml @@ -10,11 +10,11 @@ keywords = ["peer-to-peer", "libp2p", "networking"] categories = ["network-programming", "asynchronous"] [dependencies] -bytes = "0.4" -futures = "0.1" +futures = "0.1.29" libp2p-core = { version = "0.12.0", path = "../../core" } -log = "0.4.6" -void = "1" +bytes = "0.4.12" +log = "0.4.8" +void = "1.0.2" tokio-io = "0.1.12" -protobuf = "2.3" +protobuf = "2.8.1" rw-stream-sink = { version = "0.1.1", path = "../../misc/rw-stream-sink" } diff --git a/protocols/secio/Cargo.toml b/protocols/secio/Cargo.toml index a45074c04ff..21a71022c07 100644 --- a/protocols/secio/Cargo.toml +++ b/protocols/secio/Cargo.toml @@ -23,12 +23,13 @@ ctr = "0.3" lazy_static = "1.2.0" rw-stream-sink = { version = "0.1.1", path = "../../misc/rw-stream-sink" } tokio-io = "0.1.0" +tokio-codec = "0.1.1" sha2 = "0.8.0" hmac = "0.7.0" [target.'cfg(not(target_arch = "wasm32"))'.dependencies] -ring = { version = "^0.16", features = ["alloc"], default-features = false } -untrusted = { version = "0.6" } +ring = { version = "0.16.9", features = ["alloc"], default-features = false } +untrusted = "0.7.0" [target.'cfg(target_arch = "wasm32")'.dependencies] js-sys = "0.3.10" @@ -43,7 +44,7 @@ secp256k1 = [] aes-all = ["aesni"] [dev-dependencies] -criterion = "0.2" +criterion = "0.3.0" libp2p-tcp = { version = "0.12.0", path = "../../transports/tcp" } libp2p-mplex = { version = "0.12.0", path = "../../muxers/mplex" } tokio = "0.1" diff --git a/protocols/secio/src/handshake.rs b/protocols/secio/src/handshake.rs index 6e0e989fcdf..1a8be4ebdec 100644 --- a/protocols/secio/src/handshake.rs +++ b/protocols/secio/src/handshake.rs @@ -37,8 +37,7 @@ use sha2::{Digest as ShaDigestTrait, Sha256}; use std::cmp::{self, Ordering}; use std::io::{Error as IoError, ErrorKind as IoErrorKind}; use crate::structs_proto::{Exchange, Propose}; -use tokio_io::codec::length_delimited; -use tokio_io::{AsyncRead, AsyncWrite}; +use tokio_io::{AsyncRead, AsyncWrite, codec::length_delimited}; use crate::{KeyAgreement, SecioConfig}; // This struct contains the whole context of a handshake, and is filled progressively diff --git a/swarm/Cargo.toml b/swarm/Cargo.toml index a20f9fcb5f5..dc457ccef90 100644 --- a/swarm/Cargo.toml +++ b/swarm/Cargo.toml @@ -19,6 +19,6 @@ void = "1" [dev-dependencies] libp2p-mplex = { version = "0.12.0", path = "../muxers/mplex" } -quickcheck = "0.8" -rand = "0.6" +quickcheck = "0.9.0" +rand = "0.7.2" diff --git a/transports/websocket/Cargo.toml b/transports/websocket/Cargo.toml index 7a818d5095d..078d50b2431 100644 --- a/transports/websocket/Cargo.toml +++ b/transports/websocket/Cargo.toml @@ -20,7 +20,7 @@ tokio-io = "0.1.12" tokio-rustls = "0.10.1" soketto = { version = "0.2.3", features = ["deflate"] } url = "2.1.0" -webpki-roots = "0.17.0" +webpki-roots = "0.18.0" [dev-dependencies] libp2p-tcp = { version = "0.12.0", path = "../tcp" }