Skip to content

Commit 5c0992e

Browse files
committed
Bump all dependencies
Includes the excellent work of @rschulman in libp2p#1265.
1 parent ffbe714 commit 5c0992e

File tree

21 files changed

+82
-47
lines changed

21 files changed

+82
-47
lines changed

core/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ categories = ["network-programming", "asynchronous"]
1313
asn1_der = "0.6.2"
1414
bs58 = "0.3.0"
1515
bytes = "0.4.12"
16-
ed25519-dalek = "0.9.1"
16+
ed25519-dalek = { git = "https://github.com/paritytech/ed25519-dalek" }
1717
failure = "0.1.5"
1818
fnv = "1.0.6"
1919
lazy_static = "1.4.0"
@@ -25,7 +25,7 @@ futures = "0.1.29"
2525
parking_lot = "0.9.0"
2626
protobuf = "2.8.1"
2727
quick-error = "1.2.2"
28-
rand = "0.6.5"
28+
rand = "0.7.2"
2929
rw-stream-sink = { version = "0.1.1", path = "../misc/rw-stream-sink" }
3030
libsecp256k1 = { version = "0.3.0", optional = true }
3131
sha2 = "0.8.0"
@@ -38,15 +38,15 @@ void = "1.0.2"
3838
zeroize = "0.10.1"
3939

4040
[target.'cfg(not(any(target_os = "emscripten", target_os = "unknown")))'.dependencies]
41-
ring = { version = "0.14", default-features = false }
41+
ring = { version = "0.16.9", features = ["alloc"], default-features = false }
4242
untrusted = "0.6.2"
4343

4444
[dev-dependencies]
4545
libp2p-swarm = { version = "0.2.0", path = "../swarm" }
4646
libp2p-tcp = { version = "0.12.0", path = "../transports/tcp" }
4747
libp2p-mplex = { version = "0.12.0", path = "../muxers/mplex" }
4848
libp2p-secio = { version = "0.12.0", path = "../protocols/secio" }
49-
rand = "0.6.5"
49+
rand = "0.7.2"
5050
quickcheck = "0.9.0"
5151
tokio = "0.1.22"
5252
wasm-timer = "0.1"

core/src/identity/ed25519.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ pub struct Keypair(ed25519::Keypair);
3131
impl Keypair {
3232
/// Generate a new Ed25519 keypair.
3333
pub fn generate() -> Keypair {
34-
Keypair(ed25519::Keypair::generate::<sha2::Sha512, _>(&mut rand::thread_rng()))
34+
Keypair(ed25519::Keypair::generate(&mut rand::thread_rng()))
3535
}
3636

3737
/// Encode the keypair into a byte array by concatenating the bytes
@@ -51,7 +51,7 @@ impl Keypair {
5151

5252
/// Sign a message using the private key of this keypair.
5353
pub fn sign(&self, msg: &[u8]) -> Vec<u8> {
54-
self.0.sign::<sha2::Sha512>(msg).to_bytes().to_vec()
54+
self.0.sign(msg).to_bytes().to_vec()
5555
}
5656

5757
/// Get the public key of this keypair.
@@ -88,7 +88,7 @@ impl From<Keypair> for SecretKey {
8888
impl From<SecretKey> for Keypair {
8989
fn from(sk: SecretKey) -> Keypair {
9090
let secret = sk.0;
91-
let public = ed25519::PublicKey::from(secret.expand::<sha2::Sha512>());
91+
let public = ed25519::PublicKey::from(&secret);
9292
Keypair(ed25519::Keypair { secret, public })
9393
}
9494
}
@@ -100,7 +100,7 @@ pub struct PublicKey(ed25519::PublicKey);
100100
impl PublicKey {
101101
/// Verify the Ed25519 signature on a message using the public key.
102102
pub fn verify(&self, msg: &[u8], sig: &[u8]) -> bool {
103-
ed25519::Signature::from_bytes(sig).and_then(|s| self.0.verify::<sha2::Sha512>(msg, &s)).is_ok()
103+
ed25519::Signature::from_bytes(sig).and_then(|s| self.0.verify(msg, &s)).is_ok()
104104
}
105105

106106
/// Encode the public key into a byte array in compressed form, i.e.

core/src/identity/rsa.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ use ring::rand::SystemRandom;
2727
use ring::signature::{self, RsaKeyPair, RSA_PKCS1_SHA256, RSA_PKCS1_2048_8192_SHA256};
2828
use ring::signature::KeyPair;
2929
use std::sync::Arc;
30-
use untrusted::Input;
3130
use zeroize::Zeroize;
3231

3332
/// An RSA keypair.
@@ -40,7 +39,7 @@ impl Keypair {
4039
///
4140
/// [RFC5208]: https://tools.ietf.org/html/rfc5208#section-5
4241
pub fn from_pkcs8(der: &mut [u8]) -> Result<Keypair, DecodingError> {
43-
let kp = RsaKeyPair::from_pkcs8(Input::from(&der[..]))
42+
let kp = RsaKeyPair::from_pkcs8(&der)
4443
.map_err(|e| DecodingError::new("RSA PKCS#8 PrivateKeyInfo").source(e))?;
4544
der.zeroize();
4645
Ok(Keypair(Arc::new(kp)))
@@ -69,10 +68,8 @@ pub struct PublicKey(Vec<u8>);
6968
impl PublicKey {
7069
/// Verify an RSA signature on a message using the public key.
7170
pub fn verify(&self, msg: &[u8], sig: &[u8]) -> bool {
72-
signature::verify(&RSA_PKCS1_2048_8192_SHA256,
73-
Input::from(&self.0),
74-
Input::from(msg),
75-
Input::from(sig)).is_ok()
71+
let key = signature::UnparsedPublicKey::new(&RSA_PKCS1_2048_8192_SHA256, &self.0);
72+
key.verify(msg, sig).is_ok()
7673
}
7774

7875
/// Encode the RSA public key in DER as a PKCS#1 RSAPublicKey structure,

misc/mdns/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ libp2p-swarm = { version = "0.2.0", path = "../../swarm" }
1818
log = "0.4.8"
1919
multiaddr = { package = "parity-multiaddr", version = "0.5.0", path = "../multiaddr" }
2020
net2 = "0.2.33"
21-
rand = "0.6.5"
21+
rand = "0.7.2"
2222
smallvec = "0.6.10"
2323
tokio-io = "0.1.12"
2424
tokio-reactor = "0.1.10"

misc/multiaddr/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@ bincode = "1.2.0"
2525
bs58 = "0.3.0"
2626
data-encoding = "2.1.2"
2727
quickcheck = "0.9.0"
28-
rand = "0.6.5"
28+
rand = "0.7.2"
2929
serde_json = "1.0.41"

misc/multihash/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ documentation = "https://docs.rs/parity-multihash/"
1212
[dependencies]
1313
blake2 = { version = "0.8.1", default-features = false }
1414
bytes = "0.4.12"
15-
rand = { version = "0.6.5", default-features = false, features = ["std"] }
15+
rand = { version = "0.7.2", default-features = false, features = ["std"] }
1616
sha-1 = { version = "0.8.1", default-features = false }
1717
sha2 = { version = "0.8.0", default-features = false }
1818
sha3 = { version = "0.8.2", default-features = false }

misc/multistream-select/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ unsigned-varint = "0.2.2"
2121
tokio = "0.1.22"
2222
tokio-tcp = "0.1.3"
2323
quickcheck = "0.9.0"
24-
rand = "0.6.5"
24+
rand = "0.7.2"

protocols/floodsub/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ futures = "0.1.29"
1818
libp2p-core = { version = "0.12.0", path = "../../core" }
1919
libp2p-swarm = { version = "0.2.0", path = "../../swarm" }
2020
protobuf = "2.8.1"
21-
rand = "0.6.5"
21+
rand = "0.7.2"
2222
smallvec = "0.6.10"
2323
tokio-io = "0.1.12"

protocols/identify/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@ void = "1.0.2"
2828
libp2p-mplex = { version = "0.12.0", path = "../../muxers/mplex" }
2929
libp2p-secio = { version = "0.12.0", path = "../../protocols/secio" }
3030
libp2p-tcp = { version = "0.12.0", path = "../../transports/tcp" }
31-
rand = "0.6.5"
31+
rand = "0.7.2"
3232
tokio = "0.1.22"

protocols/kad/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ libp2p-swarm = { version = "0.2.0", path = "../../swarm" }
2121
multiaddr = { package = "parity-multiaddr", version = "0.5.0", path = "../../misc/multiaddr" }
2222
multihash = { package = "parity-multihash", version = "0.1.0", path = "../../misc/multihash" }
2323
protobuf = "2.8.1"
24-
rand = "0.6.5"
24+
rand = "0.7.2"
2525
sha2 = "0.8.0"
2626
smallvec = "0.6.10"
2727
tokio-codec = "0.1.1"
@@ -36,5 +36,5 @@ libp2p-secio = { version = "0.12.0", path = "../secio" }
3636
libp2p-tcp = { version = "0.12.0", path = "../../transports/tcp" }
3737
libp2p-yamux = { version = "0.12.0", path = "../../muxers/yamux" }
3838
quickcheck = "0.9.0"
39-
rand = "0.6.5"
39+
rand = "0.7.2"
4040
tokio = "0.1.22"

0 commit comments

Comments
 (0)