mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-14 02:21:21 +00:00
core/: Introduce rsa
feature flag to avoid ring
dependency (#2860)
- Introduce `rsa` feature flag to `libp2p-core`. - Expose `rsa` feature in `libp2p`. - Add `rsa` feature to `libp2p` `default`.
This commit is contained in:
committed by
GitHub
parent
a40180c3d8
commit
8644c65a22
24
Cargo.toml
24
Cargo.toml
@ -28,6 +28,7 @@ default = [
|
||||
"relay",
|
||||
"request-response",
|
||||
"rendezvous",
|
||||
"rsa",
|
||||
"secp256k1",
|
||||
"tcp-async-io",
|
||||
"uds",
|
||||
@ -65,6 +66,7 @@ wasm-ext-websocket = ["wasm-ext", "libp2p-wasm-ext?/websocket"]
|
||||
websocket = ["dep:libp2p-websocket"]
|
||||
yamux = ["dep:libp2p-yamux"]
|
||||
secp256k1 = ["libp2p-core/secp256k1"]
|
||||
rsa = ["libp2p-core/rsa"]
|
||||
serde = ["libp2p-core/serde", "libp2p-kad?/serde", "libp2p-gossipsub?/serde"]
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
@ -79,25 +81,25 @@ instant = "0.1.11" # Explicit dependency to be used in `wasm-bindgen` feature
|
||||
lazy_static = "1.2"
|
||||
|
||||
libp2p-autonat = { version = "0.7.0", path = "protocols/autonat", optional = true }
|
||||
libp2p-core = { version = "0.35.0", path = "core", default-features = false }
|
||||
libp2p-core = { version = "0.36.0", path = "core", default-features = false }
|
||||
libp2p-dcutr = { version = "0.6.0", path = "protocols/dcutr", optional = true }
|
||||
libp2p-floodsub = { version = "0.39.0", path = "protocols/floodsub", optional = true }
|
||||
libp2p-identify = { version = "0.39.0", path = "protocols/identify", optional = true }
|
||||
libp2p-kad = { version = "0.40.0", path = "protocols/kad", optional = true }
|
||||
libp2p-metrics = { version = "0.9.0", path = "misc/metrics", optional = true }
|
||||
libp2p-mplex = { version = "0.35.0", path = "muxers/mplex", optional = true }
|
||||
libp2p-noise = { version = "0.38.0", path = "transports/noise", optional = true }
|
||||
libp2p-mplex = { version = "0.36.0", path = "muxers/mplex", optional = true }
|
||||
libp2p-noise = { version = "0.39.0", path = "transports/noise", optional = true }
|
||||
libp2p-ping = { version = "0.39.0", path = "protocols/ping", optional = true }
|
||||
libp2p-plaintext = { version = "0.35.0", path = "transports/plaintext", optional = true }
|
||||
libp2p-plaintext = { version = "0.36.0", path = "transports/plaintext", optional = true }
|
||||
libp2p-pnet = { version = "0.22.0", path = "transports/pnet", optional = true }
|
||||
libp2p-relay = { version = "0.12.0", path = "protocols/relay", optional = true }
|
||||
libp2p-rendezvous = { version = "0.9.0", path = "protocols/rendezvous", optional = true }
|
||||
libp2p-request-response = { version = "0.21.0", path = "protocols/request-response", optional = true }
|
||||
libp2p-swarm = { version = "0.39.0", path = "swarm" }
|
||||
libp2p-swarm-derive = { version = "0.30.0", path = "swarm-derive" }
|
||||
libp2p-uds = { version = "0.34.0", path = "transports/uds", optional = true }
|
||||
libp2p-wasm-ext = { version = "0.35.0", path = "transports/wasm-ext", default-features = false, optional = true }
|
||||
libp2p-yamux = { version = "0.39.0", path = "muxers/yamux", optional = true }
|
||||
libp2p-uds = { version = "0.35.0", path = "transports/uds", optional = true }
|
||||
libp2p-wasm-ext = { version = "0.36.0", path = "transports/wasm-ext", default-features = false, optional = true }
|
||||
libp2p-yamux = { version = "0.40.0", path = "muxers/yamux", optional = true }
|
||||
multiaddr = { version = "0.14.0" }
|
||||
parking_lot = "0.12.0"
|
||||
pin-project = "1.0.0"
|
||||
@ -105,11 +107,11 @@ rand = "0.7.3" # Explicit dependency to be used in `wasm-bindgen` feature
|
||||
smallvec = "1.6.1"
|
||||
|
||||
[target.'cfg(not(any(target_os = "emscripten", target_os = "wasi", target_os = "unknown")))'.dependencies]
|
||||
libp2p-deflate = { version = "0.35.0", path = "transports/deflate", optional = true }
|
||||
libp2p-dns = { version = "0.35.0", path = "transports/dns", optional = true, default-features = false }
|
||||
libp2p-deflate = { version = "0.36.0", path = "transports/deflate", optional = true }
|
||||
libp2p-dns = { version = "0.36.0", path = "transports/dns", optional = true, default-features = false }
|
||||
libp2p-mdns = { version = "0.40.0", path = "protocols/mdns", optional = true, default-features = false }
|
||||
libp2p-tcp = { version = "0.35.0", path = "transports/tcp", default-features = false, optional = true }
|
||||
libp2p-websocket = { version = "0.37.0", path = "transports/websocket", optional = true }
|
||||
libp2p-tcp = { version = "0.36.0", path = "transports/tcp", default-features = false, optional = true }
|
||||
libp2p-websocket = { version = "0.38.0", path = "transports/websocket", optional = true }
|
||||
|
||||
[target.'cfg(not(target_os = "unknown"))'.dependencies]
|
||||
libp2p-gossipsub = { version = "0.41.0", path = "protocols/gossipsub", optional = true }
|
||||
|
@ -1,3 +1,10 @@
|
||||
# 0.36.0 [unreleased]
|
||||
|
||||
- Make RSA keypair support optional. To enable RSA support, `rsa` feature should be enabled.
|
||||
See [PR 2860].
|
||||
|
||||
[PR 2860]: https://github.com/libp2p/rust-libp2p/pull/2860/
|
||||
|
||||
# 0.35.1
|
||||
|
||||
- Update to `p256` `v0.11.0`. See [PR 2636].
|
||||
|
@ -3,7 +3,7 @@ name = "libp2p-core"
|
||||
edition = "2021"
|
||||
rust-version = "1.56.1"
|
||||
description = "Core traits and structs of libp2p"
|
||||
version = "0.35.1"
|
||||
version = "0.36.0"
|
||||
authors = ["Parity Technologies <admin@parity.io>"]
|
||||
license = "MIT"
|
||||
repository = "https://github.com/libp2p/rust-libp2p"
|
||||
@ -40,7 +40,7 @@ zeroize = "1"
|
||||
_serde = { package = "serde", version = "1", optional = true, features = ["derive"] }
|
||||
|
||||
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
|
||||
ring = { version = "0.16.9", features = ["alloc", "std"], default-features = false }
|
||||
ring = { version = "0.16.9", features = ["alloc", "std"], default-features = false, optional = true}
|
||||
|
||||
[dev-dependencies]
|
||||
async-std = { version = "1.6.2", features = ["attributes"] }
|
||||
@ -62,6 +62,7 @@ prost-build = "0.11"
|
||||
default = [ "secp256k1", "ecdsa" ]
|
||||
secp256k1 = [ "libsecp256k1" ]
|
||||
ecdsa = [ "p256" ]
|
||||
rsa = [ "dep:ring" ]
|
||||
serde = ["multihash/serde-codec", "_serde"]
|
||||
|
||||
[[bench]]
|
||||
|
@ -35,7 +35,7 @@
|
||||
#[cfg(feature = "ecdsa")]
|
||||
pub mod ecdsa;
|
||||
pub mod ed25519;
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
#[cfg(all(feature = "rsa", not(target_arch = "wasm32")))]
|
||||
pub mod rsa;
|
||||
#[cfg(feature = "secp256k1")]
|
||||
pub mod secp256k1;
|
||||
@ -68,8 +68,8 @@ use std::convert::{TryFrom, TryInto};
|
||||
pub enum Keypair {
|
||||
/// An Ed25519 keypair.
|
||||
Ed25519(ed25519::Keypair),
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
/// An RSA keypair.
|
||||
#[cfg(all(feature = "rsa", not(target_arch = "wasm32")))]
|
||||
Rsa(rsa::Keypair),
|
||||
/// A Secp256k1 keypair.
|
||||
#[cfg(feature = "secp256k1")]
|
||||
@ -101,7 +101,7 @@ impl Keypair {
|
||||
/// format (i.e. unencrypted) as defined in [RFC5208].
|
||||
///
|
||||
/// [RFC5208]: https://tools.ietf.org/html/rfc5208#section-5
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
#[cfg(all(feature = "rsa", not(target_arch = "wasm32")))]
|
||||
pub fn rsa_from_pkcs8(pkcs8_der: &mut [u8]) -> Result<Keypair, DecodingError> {
|
||||
rsa::Keypair::from_pkcs8(pkcs8_der).map(Keypair::Rsa)
|
||||
}
|
||||
@ -122,7 +122,7 @@ impl Keypair {
|
||||
use Keypair::*;
|
||||
match self {
|
||||
Ed25519(ref pair) => Ok(pair.sign(msg)),
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
#[cfg(all(feature = "rsa", not(target_arch = "wasm32")))]
|
||||
Rsa(ref pair) => pair.sign(msg),
|
||||
#[cfg(feature = "secp256k1")]
|
||||
Secp256k1(ref pair) => pair.secret().sign(msg),
|
||||
@ -136,7 +136,7 @@ impl Keypair {
|
||||
use Keypair::*;
|
||||
match self {
|
||||
Ed25519(pair) => PublicKey::Ed25519(pair.public()),
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
#[cfg(all(feature = "rsa", not(target_arch = "wasm32")))]
|
||||
Rsa(pair) => PublicKey::Rsa(pair.public()),
|
||||
#[cfg(feature = "secp256k1")]
|
||||
Secp256k1(pair) => PublicKey::Secp256k1(pair.public().clone()),
|
||||
@ -154,7 +154,7 @@ impl Keypair {
|
||||
r#type: keys_proto::KeyType::Ed25519.into(),
|
||||
data: data.encode().into(),
|
||||
},
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
#[cfg(all(feature = "rsa", not(target_arch = "wasm32")))]
|
||||
Self::Rsa(_) => {
|
||||
return Err(DecodingError::new(
|
||||
"Encoding RSA key into Protobuf is unsupported",
|
||||
@ -218,7 +218,7 @@ impl zeroize::Zeroize for keys_proto::PrivateKey {
|
||||
pub enum PublicKey {
|
||||
/// A public Ed25519 key.
|
||||
Ed25519(ed25519::PublicKey),
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
#[cfg(all(feature = "rsa", not(target_arch = "wasm32")))]
|
||||
/// A public RSA key.
|
||||
Rsa(rsa::PublicKey),
|
||||
#[cfg(feature = "secp256k1")]
|
||||
@ -239,7 +239,7 @@ impl PublicKey {
|
||||
use PublicKey::*;
|
||||
match self {
|
||||
Ed25519(pk) => pk.verify(msg, sig),
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
#[cfg(all(feature = "rsa", not(target_arch = "wasm32")))]
|
||||
Rsa(pk) => pk.verify(msg, sig),
|
||||
#[cfg(feature = "secp256k1")]
|
||||
Secp256k1(pk) => pk.verify(msg, sig),
|
||||
@ -286,7 +286,7 @@ impl From<&PublicKey> for keys_proto::PublicKey {
|
||||
r#type: keys_proto::KeyType::Ed25519 as i32,
|
||||
data: key.encode().to_vec(),
|
||||
},
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
#[cfg(all(feature = "rsa", not(target_arch = "wasm32")))]
|
||||
PublicKey::Rsa(key) => keys_proto::PublicKey {
|
||||
r#type: keys_proto::KeyType::Rsa as i32,
|
||||
data: key.encode_x509(),
|
||||
@ -316,11 +316,11 @@ impl TryFrom<keys_proto::PublicKey> for PublicKey {
|
||||
keys_proto::KeyType::Ed25519 => {
|
||||
ed25519::PublicKey::decode(&pubkey.data).map(PublicKey::Ed25519)
|
||||
}
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
#[cfg(all(feature = "rsa", not(target_arch = "wasm32")))]
|
||||
keys_proto::KeyType::Rsa => {
|
||||
rsa::PublicKey::decode_x509(&pubkey.data).map(PublicKey::Rsa)
|
||||
}
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
#[cfg(any(not(feature = "rsa"), target_arch = "wasm32"))]
|
||||
keys_proto::KeyType::Rsa => {
|
||||
log::debug!("support for RSA was disabled at compile-time");
|
||||
Err(DecodingError::new("Unsupported"))
|
||||
|
@ -67,6 +67,7 @@ pub struct SigningError {
|
||||
|
||||
/// An error during encoding of key material.
|
||||
impl SigningError {
|
||||
#[cfg(any(feature = "secp256k1", feature = "rsa"))]
|
||||
pub(crate) fn new<S: ToString>(msg: S) -> Self {
|
||||
Self {
|
||||
msg: msg.to_string(),
|
||||
@ -74,6 +75,7 @@ impl SigningError {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "rsa")]
|
||||
pub(crate) fn source(self, source: impl Error + Send + Sync + 'static) -> Self {
|
||||
Self {
|
||||
source: Some(Box::new(source)),
|
||||
|
@ -13,5 +13,5 @@ clap = {version = "3.1.6", features = ["derive"]}
|
||||
zeroize = "1"
|
||||
serde = { version = "1.0.136", features = ["derive"] }
|
||||
serde_json = "1.0.79"
|
||||
libp2p-core = { path = "../../core", default-features = false, version = "0.35.0"}
|
||||
libp2p-core = { path = "../../core", default-features = false, version = "0.36.0"}
|
||||
base64 = "0.13.0"
|
||||
|
@ -12,6 +12,8 @@
|
||||
|
||||
- Update to `libp2p-kad` `v0.40.0`.
|
||||
|
||||
- Update to `libp2p-core` `v0.36.0`.
|
||||
|
||||
# 0.8.0
|
||||
|
||||
- Update to `libp2p-swarm` `v0.38.0`.
|
||||
|
@ -19,7 +19,7 @@ relay = ["libp2p-relay"]
|
||||
dcutr = ["libp2p-dcutr"]
|
||||
|
||||
[dependencies]
|
||||
libp2p-core = { version = "0.35.0", path = "../../core", default-features = false }
|
||||
libp2p-core = { version = "0.36.0", path = "../../core", default-features = false }
|
||||
libp2p-dcutr = { version = "0.6.0", path = "../../protocols/dcutr", optional = true }
|
||||
libp2p-identify = { version = "0.39.0", path = "../../protocols/identify", optional = true }
|
||||
libp2p-kad = { version = "0.40.0", path = "../../protocols/kad", optional = true }
|
||||
|
@ -1,3 +1,7 @@
|
||||
# 0.36.0 [unreleased]
|
||||
|
||||
- Update to `libp2p-core` `v0.36.0`
|
||||
|
||||
# 0.35.0
|
||||
|
||||
- Update to `libp2p-core` `v0.35.0`
|
||||
|
@ -3,7 +3,7 @@ name = "libp2p-mplex"
|
||||
edition = "2021"
|
||||
rust-version = "1.56.1"
|
||||
description = "Mplex multiplexing protocol for libp2p"
|
||||
version = "0.35.0"
|
||||
version = "0.36.0"
|
||||
authors = ["Parity Technologies <admin@parity.io>"]
|
||||
license = "MIT"
|
||||
repository = "https://github.com/libp2p/rust-libp2p"
|
||||
@ -14,7 +14,7 @@ categories = ["network-programming", "asynchronous"]
|
||||
bytes = "1"
|
||||
futures = "0.3.1"
|
||||
asynchronous-codec = "0.6"
|
||||
libp2p-core = { version = "0.35.0", path = "../../core", default-features = false }
|
||||
libp2p-core = { version = "0.36.0", path = "../../core", default-features = false }
|
||||
log = "0.4"
|
||||
nohash-hasher = "0.2"
|
||||
parking_lot = "0.12"
|
||||
|
@ -1,3 +1,7 @@
|
||||
# 0.40.0 [unreleased]
|
||||
|
||||
- Update to `libp2p-core` `v0.36.0`
|
||||
|
||||
# 0.39.0
|
||||
|
||||
- Update to `libp2p-core` `v0.35.0`
|
||||
|
@ -3,7 +3,7 @@ name = "libp2p-yamux"
|
||||
edition = "2021"
|
||||
rust-version = "1.56.1"
|
||||
description = "Yamux multiplexing protocol for libp2p"
|
||||
version = "0.39.0"
|
||||
version = "0.40.0"
|
||||
authors = ["Parity Technologies <admin@parity.io>"]
|
||||
license = "MIT"
|
||||
repository = "https://github.com/libp2p/rust-libp2p"
|
||||
@ -12,7 +12,7 @@ categories = ["network-programming", "asynchronous"]
|
||||
|
||||
[dependencies]
|
||||
futures = "0.3.1"
|
||||
libp2p-core = { version = "0.35.0", path = "../../core", default-features = false }
|
||||
libp2p-core = { version = "0.36.0", path = "../../core", default-features = false }
|
||||
parking_lot = "0.12"
|
||||
thiserror = "1.0"
|
||||
yamux = "0.10.0"
|
||||
|
@ -4,6 +4,8 @@
|
||||
|
||||
- Update to `libp2p-request-response` `v0.21.0`.
|
||||
|
||||
- Update to `libp2p-core` `v0.36.0`.
|
||||
|
||||
# 0.6.0
|
||||
|
||||
- Update prost requirement from 0.10 to 0.11 which no longer installs the protoc Protobuf compiler.
|
||||
|
@ -18,7 +18,7 @@ async-trait = "0.1"
|
||||
futures = "0.3"
|
||||
futures-timer = "3.0"
|
||||
instant = "0.1"
|
||||
libp2p-core = { version = "0.35.0", path = "../../core", default-features = false }
|
||||
libp2p-core = { version = "0.36.0", path = "../../core", default-features = false }
|
||||
libp2p-swarm = { version = "0.39.0", path = "../../swarm" }
|
||||
libp2p-request-response = { version = "0.21.0", path = "../request-response" }
|
||||
log = "0.4"
|
||||
|
@ -2,6 +2,8 @@
|
||||
|
||||
- Update to `libp2p-swarm` `v0.39.0`.
|
||||
|
||||
- Update to `libp2p-core` `v0.36.0`.
|
||||
|
||||
# 0.5.1
|
||||
|
||||
- Make default features of `libp2p-core` optional. See [PR 2836].
|
||||
|
@ -17,7 +17,7 @@ either = "1.6.0"
|
||||
futures = "0.3.1"
|
||||
futures-timer = "3.0"
|
||||
instant = "0.1.11"
|
||||
libp2p-core = { version = "0.35.0", path = "../../core", default-features = false }
|
||||
libp2p-core = { version = "0.36.0", path = "../../core", default-features = false }
|
||||
libp2p-swarm = { version = "0.39.0", path = "../../swarm" }
|
||||
log = "0.4"
|
||||
prost-codec = { version = "0.2", path = "../../misc/prost-codec" }
|
||||
|
@ -2,6 +2,8 @@
|
||||
|
||||
- Update to `libp2p-swarm` `v0.39.0`.
|
||||
|
||||
- Update to `libp2p-core` `v0.36.0`.
|
||||
|
||||
# 0.38.0
|
||||
|
||||
- Update prost requirement from 0.10 to 0.11 which no longer installs the protoc Protobuf compiler.
|
||||
|
@ -14,7 +14,7 @@ categories = ["network-programming", "asynchronous"]
|
||||
cuckoofilter = "0.5.0"
|
||||
fnv = "1.0"
|
||||
futures = "0.3.1"
|
||||
libp2p-core = { version = "0.35.0", path = "../../core", default-features = false }
|
||||
libp2p-core = { version = "0.36.0", path = "../../core", default-features = false }
|
||||
libp2p-swarm = { version = "0.39.0", path = "../../swarm" }
|
||||
log = "0.4"
|
||||
prost = "0.11"
|
||||
|
@ -2,6 +2,8 @@
|
||||
|
||||
- Update to `libp2p-swarm` `v0.39.0`.
|
||||
|
||||
- Update to `libp2p-core` `v0.36.0`.
|
||||
|
||||
- Allow publishing with any `impl Into<TopicHash>` as a topic. See [PR 2862].
|
||||
|
||||
[PR 2862]: https://github.com/libp2p/rust-libp2p/pull/2862
|
||||
|
@ -12,7 +12,7 @@ categories = ["network-programming", "asynchronous"]
|
||||
|
||||
[dependencies]
|
||||
libp2p-swarm = { version = "0.39.0", path = "../../swarm" }
|
||||
libp2p-core = { version = "0.35.0", path = "../../core", default-features = false }
|
||||
libp2p-core = { version = "0.36.0", path = "../../core", default-features = false }
|
||||
bytes = "1.0"
|
||||
byteorder = "1.3.4"
|
||||
fnv = "1.0.7"
|
||||
|
@ -613,6 +613,7 @@ mod tests {
|
||||
struct TestKeypair(Keypair);
|
||||
|
||||
impl Arbitrary for TestKeypair {
|
||||
#[cfg(feature = "rsa")]
|
||||
fn arbitrary<G: Gen>(g: &mut G) -> Self {
|
||||
let keypair = if g.gen() {
|
||||
// Small enough to be inlined.
|
||||
@ -624,6 +625,12 @@ mod tests {
|
||||
};
|
||||
TestKeypair(keypair)
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "rsa"))]
|
||||
fn arbitrary<G: Gen>(_g: &mut G) -> Self {
|
||||
// Small enough to be inlined.
|
||||
TestKeypair(Keypair::generate_ed25519())
|
||||
}
|
||||
}
|
||||
|
||||
impl std::fmt::Debug for TestKeypair {
|
||||
|
@ -2,6 +2,8 @@
|
||||
|
||||
- Update to `libp2p-swarm` `v0.39.0`.
|
||||
|
||||
- Update to `libp2p-core` `v0.36.0`.
|
||||
|
||||
# 0.38.0
|
||||
|
||||
- Update prost requirement from 0.10 to 0.11 which no longer installs the protoc Protobuf compiler.
|
||||
|
@ -14,7 +14,7 @@ categories = ["network-programming", "asynchronous"]
|
||||
asynchronous-codec = "0.6"
|
||||
futures = "0.3.1"
|
||||
futures-timer = "3.0.2"
|
||||
libp2p-core = { version = "0.35.0", path = "../../core", default-features = false }
|
||||
libp2p-core = { version = "0.36.0", path = "../../core", default-features = false }
|
||||
libp2p-swarm = { version = "0.39.0", path = "../../swarm" }
|
||||
log = "0.4.1"
|
||||
lru = "0.7.2"
|
||||
|
@ -5,6 +5,8 @@
|
||||
|
||||
- Update to `libp2p-swarm` `v0.39.0`.
|
||||
|
||||
- Update to `libp2p-core` `v0.36.0`.
|
||||
|
||||
[Issue 2837]: https://github.com/libp2p/rust-libp2p/issues/2837
|
||||
[PR 2846]: https://github.com/libp2p/rust-libp2p/pull/2846
|
||||
|
||||
|
@ -18,7 +18,7 @@ fnv = "1.0"
|
||||
asynchronous-codec = "0.6"
|
||||
futures = "0.3.1"
|
||||
log = "0.4"
|
||||
libp2p-core = { version = "0.35.0", path = "../../core", default-features = false }
|
||||
libp2p-core = { version = "0.36.0", path = "../../core", default-features = false }
|
||||
libp2p-swarm = { version = "0.39.0", path = "../../swarm" }
|
||||
prost = "0.11"
|
||||
rand = "0.7.2"
|
||||
|
@ -8,6 +8,8 @@
|
||||
|
||||
- Fix high CPU usage with Tokio library (see [PR 2748]).
|
||||
|
||||
- Update to `libp2p-core` `v0.36.0`.
|
||||
|
||||
[PR 2748]: https://github.com/libp2p/rust-libp2p/pull/2748
|
||||
|
||||
# 0.39.0
|
||||
|
@ -16,7 +16,7 @@ dns-parser = "0.8.0"
|
||||
futures = "0.3.13"
|
||||
if-watch = "1.1.1"
|
||||
lazy_static = "1.4.0"
|
||||
libp2p-core = { version = "0.35.0", path = "../../core", default-features = false }
|
||||
libp2p-core = { version = "0.36.0", path = "../../core", default-features = false }
|
||||
libp2p-swarm = { version = "0.39.0", path = "../../swarm" }
|
||||
log = "0.4.14"
|
||||
rand = "0.8.3"
|
||||
|
@ -2,6 +2,8 @@
|
||||
|
||||
- Update to `libp2p-swarm` `v0.39.0`.
|
||||
|
||||
- Update to `libp2p-core` `v0.36.0`.
|
||||
|
||||
# 0.38.0
|
||||
|
||||
- Update to `libp2p-swarm` `v0.38.0`.
|
||||
|
@ -14,7 +14,7 @@ categories = ["network-programming", "asynchronous"]
|
||||
futures = "0.3.1"
|
||||
futures-timer = "3.0.2"
|
||||
instant = "0.1.11"
|
||||
libp2p-core = { version = "0.35.0", path = "../../core", default-features = false }
|
||||
libp2p-core = { version = "0.36.0", path = "../../core", default-features = false }
|
||||
libp2p-swarm = { version = "0.39.0", path = "../../swarm" }
|
||||
log = "0.4.1"
|
||||
rand = "0.7.2"
|
||||
|
@ -2,6 +2,8 @@
|
||||
|
||||
- Update to `libp2p-swarm` `v0.39.0`.
|
||||
|
||||
- Update to `libp2p-core` `v0.36.0`.
|
||||
|
||||
# 0.11.0
|
||||
|
||||
- Update prost requirement from 0.10 to 0.11 which no longer installs the protoc Protobuf compiler.
|
||||
|
@ -17,7 +17,7 @@ either = "1.6.0"
|
||||
futures = "0.3.1"
|
||||
futures-timer = "3"
|
||||
instant = "0.1.11"
|
||||
libp2p-core = { version = "0.35.0", path = "../../core", default-features = false }
|
||||
libp2p-core = { version = "0.36.0", path = "../../core", default-features = false }
|
||||
libp2p-swarm = { version = "0.39.0", path = "../../swarm" }
|
||||
log = "0.4"
|
||||
pin-project = "1"
|
||||
|
@ -2,6 +2,8 @@
|
||||
|
||||
- Update to `libp2p-swarm` `v0.39.0`.
|
||||
|
||||
- Update to `libp2p-core` `v0.36.0`.
|
||||
|
||||
# 0.8.0
|
||||
|
||||
- Update prost requirement from 0.10 to 0.11 which no longer installs the protoc Protobuf compiler.
|
||||
|
@ -12,7 +12,7 @@ categories = ["network-programming", "asynchronous"]
|
||||
|
||||
[dependencies]
|
||||
asynchronous-codec = "0.6"
|
||||
libp2p-core = { version = "0.35.0", path = "../../core", default-features = false }
|
||||
libp2p-core = { version = "0.36.0", path = "../../core", default-features = false }
|
||||
libp2p-swarm = { version = "0.39.0", path = "../../swarm" }
|
||||
prost = "0.11"
|
||||
void = "1"
|
||||
|
@ -2,6 +2,8 @@
|
||||
|
||||
- Update to `libp2p-swarm` `v0.39.0`.
|
||||
|
||||
- Update to `libp2p-core` `v0.36.0`.
|
||||
|
||||
# 0.20.0
|
||||
|
||||
- Update to `libp2p-swarm` `v0.38.0`.
|
||||
|
@ -15,7 +15,7 @@ async-trait = "0.1"
|
||||
bytes = "1"
|
||||
futures = "0.3.1"
|
||||
instant = "0.1.11"
|
||||
libp2p-core = { version = "0.35.0", path = "../../core", default-features = false }
|
||||
libp2p-core = { version = "0.36.0", path = "../../core", default-features = false }
|
||||
libp2p-swarm = { version = "0.39.0", path = "../../swarm" }
|
||||
log = "0.4.11"
|
||||
rand = "0.7"
|
||||
|
@ -3,6 +3,8 @@
|
||||
- Remove deprecated `NetworkBehaviourEventProcess`. See [libp2p-swarm v0.38.0 changelog entry] for
|
||||
migration path.
|
||||
|
||||
- Update to `libp2p-core` `v0.36.0`.
|
||||
|
||||
[libp2p-swarm v0.38.0 changelog entry]: https://github.com/libp2p/rust-libp2p/blob/master/swarm/CHANGELOG.md#0380
|
||||
|
||||
# 0.38.0
|
||||
|
@ -16,7 +16,7 @@ fnv = "1.0"
|
||||
futures = "0.3.1"
|
||||
futures-timer = "3.0.2"
|
||||
instant = "0.1.11"
|
||||
libp2p-core = { version = "0.35.0", path = "../core", default-features = false }
|
||||
libp2p-core = { version = "0.36.0", path = "../core", default-features = false }
|
||||
log = "0.4"
|
||||
pin-project = "1.0.0"
|
||||
rand = "0.7"
|
||||
|
@ -1,3 +1,7 @@
|
||||
# 0.36.0 [unreleased]
|
||||
|
||||
- Update to `libp2p-core` `v0.36.0`.
|
||||
|
||||
# 0.35.0
|
||||
|
||||
- Update to `libp2p-core` `v0.35.0`.
|
||||
|
@ -3,7 +3,7 @@ name = "libp2p-deflate"
|
||||
edition = "2021"
|
||||
rust-version = "1.56.1"
|
||||
description = "Deflate encryption protocol for libp2p"
|
||||
version = "0.35.0"
|
||||
version = "0.36.0"
|
||||
authors = ["Parity Technologies <admin@parity.io>"]
|
||||
license = "MIT"
|
||||
repository = "https://github.com/libp2p/rust-libp2p"
|
||||
@ -12,7 +12,7 @@ categories = ["network-programming", "asynchronous"]
|
||||
|
||||
[dependencies]
|
||||
futures = "0.3.1"
|
||||
libp2p-core = { version = "0.35.0", path = "../../core", default-features = false }
|
||||
libp2p-core = { version = "0.36.0", path = "../../core", default-features = false }
|
||||
flate2 = "1.0"
|
||||
|
||||
[dev-dependencies]
|
||||
|
@ -1,3 +1,7 @@
|
||||
# 0.36.0 [unreleased]
|
||||
|
||||
- Update to `libp2p-core` `v0.36.0`.
|
||||
|
||||
# 0.35.0
|
||||
|
||||
- Update to `libp2p-core` `v0.35.0`.
|
||||
|
@ -3,7 +3,7 @@ name = "libp2p-dns"
|
||||
edition = "2021"
|
||||
rust-version = "1.56.1"
|
||||
description = "DNS transport implementation for libp2p"
|
||||
version = "0.35.0"
|
||||
version = "0.36.0"
|
||||
authors = ["Parity Technologies <admin@parity.io>"]
|
||||
license = "MIT"
|
||||
repository = "https://github.com/libp2p/rust-libp2p"
|
||||
@ -11,7 +11,7 @@ keywords = ["peer-to-peer", "libp2p", "networking"]
|
||||
categories = ["network-programming", "asynchronous"]
|
||||
|
||||
[dependencies]
|
||||
libp2p-core = { version = "0.35.0", path = "../../core", default-features = false }
|
||||
libp2p-core = { version = "0.36.0", path = "../../core", default-features = false }
|
||||
log = "0.4.1"
|
||||
futures = "0.3.1"
|
||||
async-std-resolver = { version = "0.21", optional = true }
|
||||
|
@ -1,3 +1,7 @@
|
||||
# 0.39.0 [unreleased]
|
||||
|
||||
- Update to `libp2p-core` `v0.36.0`.
|
||||
|
||||
# 0.38.0
|
||||
|
||||
- Update prost requirement from 0.10 to 0.11 which no longer installs the protoc Protobuf compiler.
|
||||
|
@ -3,7 +3,7 @@ name = "libp2p-noise"
|
||||
edition = "2021"
|
||||
rust-version = "1.56.1"
|
||||
description = "Cryptographic handshake protocol using the noise framework."
|
||||
version = "0.38.0"
|
||||
version = "0.39.0"
|
||||
authors = ["Parity Technologies <admin@parity.io>"]
|
||||
license = "MIT"
|
||||
repository = "https://github.com/libp2p/rust-libp2p"
|
||||
@ -13,7 +13,7 @@ bytes = "1"
|
||||
curve25519-dalek = "3.0.0"
|
||||
futures = "0.3.1"
|
||||
lazy_static = "1.2"
|
||||
libp2p-core = { version = "0.35.0", path = "../../core", default-features = false }
|
||||
libp2p-core = { version = "0.36.0", path = "../../core", default-features = false }
|
||||
log = "0.4"
|
||||
prost = "0.11"
|
||||
rand = "0.8.3"
|
||||
|
@ -120,6 +120,7 @@ impl Protocol<X25519> for X25519 {
|
||||
Ok(PublicKey(X25519(pk)))
|
||||
}
|
||||
|
||||
#[allow(irrefutable_let_patterns)]
|
||||
fn linked(id_pk: &identity::PublicKey, dh_pk: &PublicKey<X25519>) -> bool {
|
||||
if let identity::PublicKey::Ed25519(ref p) = id_pk {
|
||||
PublicKey::from_ed25519(p).as_ref() == dh_pk.as_ref()
|
||||
@ -162,6 +163,7 @@ impl Keypair<X25519> {
|
||||
/// > See also:
|
||||
/// >
|
||||
/// > * [Noise: Static Key Reuse](http://www.noiseprotocol.org/noise.html#security-considerations)
|
||||
#[allow(unreachable_patterns)]
|
||||
pub fn from_identity(id_keys: &identity::Keypair) -> Option<AuthenticKeypair<X25519>> {
|
||||
match id_keys {
|
||||
identity::Keypair::Ed25519(p) => {
|
||||
|
@ -1,3 +1,7 @@
|
||||
# 0.36.0 [unreleased]
|
||||
|
||||
- Update to `libp2p-core` `v0.36.0`.
|
||||
|
||||
# 0.35.0
|
||||
|
||||
- Update prost requirement from 0.10 to 0.11 which no longer installs the protoc Protobuf compiler.
|
||||
|
@ -3,7 +3,7 @@ name = "libp2p-plaintext"
|
||||
edition = "2021"
|
||||
rust-version = "1.56.1"
|
||||
description = "Plaintext encryption dummy protocol for libp2p"
|
||||
version = "0.35.0"
|
||||
version = "0.36.0"
|
||||
authors = ["Parity Technologies <admin@parity.io>"]
|
||||
license = "MIT"
|
||||
repository = "https://github.com/libp2p/rust-libp2p"
|
||||
@ -14,7 +14,7 @@ categories = ["network-programming", "asynchronous"]
|
||||
bytes = "1"
|
||||
futures = "0.3.1"
|
||||
asynchronous-codec = "0.6"
|
||||
libp2p-core = { version = "0.35.0", path = "../../core", default-features = false }
|
||||
libp2p-core = { version = "0.36.0", path = "../../core", default-features = false }
|
||||
log = "0.4.8"
|
||||
prost = "0.11"
|
||||
unsigned-varint = { version = "0.7", features = ["asynchronous_codec"] }
|
||||
|
@ -1,3 +1,7 @@
|
||||
# 0.36.0 [unreleased]
|
||||
|
||||
- Update to `libp2p-core` `v0.36.0`.
|
||||
|
||||
# 0.35.0
|
||||
|
||||
- Update to `libp2p-core` `v0.35.0`.
|
||||
|
@ -3,7 +3,7 @@ name = "libp2p-tcp"
|
||||
edition = "2021"
|
||||
rust-version = "1.56.1"
|
||||
description = "TCP/IP transport protocol for libp2p"
|
||||
version = "0.35.0"
|
||||
version = "0.36.0"
|
||||
authors = ["Parity Technologies <admin@parity.io>"]
|
||||
license = "MIT"
|
||||
repository = "https://github.com/libp2p/rust-libp2p"
|
||||
@ -18,7 +18,7 @@ if-watch = { version = "1.1.1", optional = true }
|
||||
if-addrs = { version = "0.7.0", optional = true }
|
||||
ipnet = "2.0.0"
|
||||
libc = "0.2.80"
|
||||
libp2p-core = { version = "0.35.0", path = "../../core", default-features = false }
|
||||
libp2p-core = { version = "0.36.0", path = "../../core", default-features = false }
|
||||
log = "0.4.11"
|
||||
socket2 = { version = "0.4.0", features = ["all"] }
|
||||
tokio-crate = { package = "tokio", version = "1.19.0", default-features = false, features = ["net"], optional = true }
|
||||
|
@ -1,3 +1,7 @@
|
||||
# 0.35.0 [unreleased]
|
||||
|
||||
- Update to `libp2p-core` `v0.36.0`.
|
||||
|
||||
# 0.34.0
|
||||
|
||||
- Update to `libp2p-core` `v0.35.0`.
|
||||
|
@ -3,7 +3,7 @@ name = "libp2p-uds"
|
||||
edition = "2021"
|
||||
rust-version = "1.56.1"
|
||||
description = "Unix domain sockets transport for libp2p"
|
||||
version = "0.34.0"
|
||||
version = "0.35.0"
|
||||
authors = ["Parity Technologies <admin@parity.io>"]
|
||||
license = "MIT"
|
||||
repository = "https://github.com/libp2p/rust-libp2p"
|
||||
@ -12,7 +12,7 @@ categories = ["network-programming", "asynchronous"]
|
||||
|
||||
[target.'cfg(all(unix, not(target_os = "emscripten")))'.dependencies]
|
||||
async-std = { version = "1.6.2", optional = true }
|
||||
libp2p-core = { version = "0.35.0", path = "../../core", default-features = false }
|
||||
libp2p-core = { version = "0.36.0", path = "../../core", default-features = false }
|
||||
log = "0.4.1"
|
||||
futures = "0.3.1"
|
||||
tokio = { version = "1.15", default-features = false, features = ["net"], optional = true }
|
||||
|
@ -1,3 +1,7 @@
|
||||
# 0.36.0 [unreleased]
|
||||
|
||||
- Update to `libp2p-core` `v0.36.0`.
|
||||
|
||||
# 0.35.0
|
||||
|
||||
- Update to `libp2p-core` `v0.35.0`.
|
||||
|
@ -3,7 +3,7 @@ name = "libp2p-wasm-ext"
|
||||
edition = "2021"
|
||||
rust-version = "1.56.1"
|
||||
description = "Allows passing in an external transport in a WASM environment"
|
||||
version = "0.35.0"
|
||||
version = "0.36.0"
|
||||
authors = ["Pierre Krieger <pierre.krieger1708@gmail.com>"]
|
||||
license = "MIT"
|
||||
repository = "https://github.com/libp2p/rust-libp2p"
|
||||
@ -13,7 +13,7 @@ categories = ["network-programming", "asynchronous"]
|
||||
[dependencies]
|
||||
futures = "0.3.1"
|
||||
js-sys = "0.3.50"
|
||||
libp2p-core = { version = "0.35.0", path = "../../core", default-features = false }
|
||||
libp2p-core = { version = "0.36.0", path = "../../core", default-features = false }
|
||||
parity-send-wrapper = "0.1.0"
|
||||
wasm-bindgen = "0.2.42"
|
||||
wasm-bindgen-futures = "0.4.4"
|
||||
|
@ -1,3 +1,7 @@
|
||||
# 0.38.0 [unreleased]
|
||||
|
||||
- Update to `libp2p-core` `v0.36.0`.
|
||||
|
||||
# 0.37.0
|
||||
|
||||
- Update to `libp2p-core` `v0.35.0`.
|
||||
|
@ -3,7 +3,7 @@ name = "libp2p-websocket"
|
||||
edition = "2021"
|
||||
rust-version = "1.56.1"
|
||||
description = "WebSocket transport for libp2p"
|
||||
version = "0.37.0"
|
||||
version = "0.38.0"
|
||||
authors = ["Parity Technologies <admin@parity.io>"]
|
||||
license = "MIT"
|
||||
repository = "https://github.com/libp2p/rust-libp2p"
|
||||
@ -14,7 +14,7 @@ categories = ["network-programming", "asynchronous"]
|
||||
futures-rustls = "0.22"
|
||||
either = "1.5.3"
|
||||
futures = "0.3.1"
|
||||
libp2p-core = { version = "0.35.0", path = "../../core", default-features = false }
|
||||
libp2p-core = { version = "0.36.0", path = "../../core", default-features = false }
|
||||
log = "0.4.8"
|
||||
parking_lot = "0.12.0"
|
||||
quicksink = "0.1"
|
||||
|
Reference in New Issue
Block a user