Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

RUSTSEC-2021-0076 bump libsecp256k1 #9391

Merged
15 commits merged into from
Aug 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
492 changes: 297 additions & 195 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,6 @@ members = [
#
# This list is ordered alphabetically.
[profile.dev.package]
aes-soft = { opt-level = 3 }
aesni = { opt-level = 3 }
blake2 = { opt-level = 3 }
blake2-rfc = { opt-level = 3 }
blake2b_simd = { opt-level = 3 }
Expand Down
6 changes: 2 additions & 4 deletions bin/node/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,8 @@ try-runtime-cli = { version = "0.10.0-dev", optional = true, path = "../../../ut
# WASM-specific dependencies
wasm-bindgen = { version = "0.2.73", optional = true }
wasm-bindgen-futures = { version = "0.4.18", optional = true }
browser-utils = { package = "substrate-browser-utils", path = "../../../utils/browser", optional = true, version = "0.10.0-dev" }
libp2p-wasm-ext = { version = "0.28", features = [
"websocket",
], optional = true }
browser-utils = { package = "substrate-browser-utils", path = "../../../utils/browser", optional = true, version = "0.10.0-dev"}
libp2p-wasm-ext = { version = "0.29", features = ["websocket"], optional = true }

[target.'cfg(target_arch="x86_64")'.dependencies]
node-executor = { version = "3.0.0-dev", path = "../executor", features = [
Expand Down
2 changes: 1 addition & 1 deletion client/authority-discovery/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ derive_more = "0.99.2"
futures = "0.3.9"
futures-timer = "3.0.1"
ip_network = "0.4.0"
libp2p = { version = "0.37.1", default-features = false, features = ["kad"] }
libp2p = { version = "0.39.1", default-features = false, features = ["kad"] }
log = "0.4.8"
prometheus-endpoint = { package = "substrate-prometheus-endpoint", path = "../../utils/prometheus", version = "0.9.0" }
prost = "0.7"
Expand Down
2 changes: 1 addition & 1 deletion client/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ regex = "1.4.2"
tokio = { version = "0.2.21", features = [ "signal", "rt-core", "rt-threaded", "blocking" ] }
futures = "0.3.9"
fdlimit = "0.2.1"
libp2p = "0.37.1"
libp2p = "0.39.1"
parity-scale-codec = "2.0.0"
hex = "0.4.2"
rand = "0.7.3"
Expand Down
2 changes: 1 addition & 1 deletion client/consensus/common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ targets = ["x86_64-unknown-linux-gnu"]

[dependencies]
thiserror = "1.0.21"
libp2p = { version = "0.37.1", default-features = false }
libp2p = { version = "0.39.1", default-features = false }
log = "0.4.8"
futures = { version = "0.3.1", features = ["thread-pool"] }
futures-timer = "3.0.1"
Expand Down
2 changes: 1 addition & 1 deletion client/executor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ sc-executor-wasmi = { version = "0.10.0-dev", path = "wasmi" }
sc-executor-wasmtime = { version = "0.10.0-dev", path = "wasmtime", optional = true }
parking_lot = "0.11.1"
log = "0.4.8"
libsecp256k1 = "0.3.4"
libsecp256k1 = "0.6"

[dev-dependencies]
wat = "1.0"
Expand Down
2 changes: 1 addition & 1 deletion client/network-gossip/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ targets = ["x86_64-unknown-linux-gnu"]
[dependencies]
futures = "0.3.9"
futures-timer = "3.0.1"
libp2p = { version = "0.37.1", default-features = false }
libp2p = { version = "0.39.1", default-features = false }
log = "0.4.8"
lru = "0.6.5"
prometheus-endpoint = { package = "substrate-prometheus-endpoint", version = "0.9.0", path = "../../utils/prometheus" }
Expand Down
6 changes: 3 additions & 3 deletions client/network/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ wasm-timer = "0.2"
zeroize = "1.2.0"

[dependencies.libp2p]
version = "0.37.1"
version = "0.39.1"

[target.'cfg(target_os = "unknown")'.dependencies.libp2p]
version = "0.37.1"
version = "0.39.1"
default-features = false
features = [
"identify",
Expand All @@ -88,7 +88,7 @@ features = [

[dev-dependencies]
assert_matches = "1.3"
libp2p = { version = "0.37.1", default-features = false }
libp2p = { version = "0.39.1", default-features = false }
quickcheck = "1.0.3"
rand = "0.7.2"
sp-test-primitives = { version = "2.0.0", path = "../../primitives/test-primitives" }
Expand Down
6 changes: 3 additions & 3 deletions client/network/src/bitswap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ where

fn upgrade_inbound(self, mut socket: TSocket, _info: Self::Info) -> Self::Future {
Box::pin(async move {
let packet = upgrade::read_one(&mut socket, MAX_PACKET_SIZE).await?;
let packet = upgrade::read_length_prefixed(&mut socket, MAX_PACKET_SIZE).await?;
let message: BitswapMessage = Message::decode(packet.as_slice())?;
Ok(message)
})
Expand Down Expand Up @@ -122,7 +122,7 @@ where
Box::pin(async move {
let mut data = Vec::with_capacity(self.encoded_len());
self.encode(&mut data)?;
upgrade::write_one(&mut socket, data).await
upgrade::write_length_prefixed(&mut socket, data).await
})
}
}
Expand Down Expand Up @@ -328,7 +328,7 @@ pub enum BitswapError {
/// Error parsing CID
BadCid(cid::Error),
/// Packet read error.
Read(upgrade::ReadOneError),
Read(io::Error),
/// Error sending response.
#[display(fmt = "Failed to send response.")]
SendResponse,
Expand Down
80 changes: 50 additions & 30 deletions client/network/src/discovery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,7 @@ impl NetworkBehaviour for DiscoveryBehaviour {
KademliaEvent::PendingRoutablePeer { .. } => {
// We are not interested in this event at the moment.
},
KademliaEvent::QueryResult {
KademliaEvent::OutboundQueryCompleted {
result: QueryResult::GetClosestPeers(res),
..
} => match res {
Expand All @@ -741,7 +741,7 @@ impl NetworkBehaviour for DiscoveryBehaviour {
}
},
},
KademliaEvent::QueryResult {
KademliaEvent::OutboundQueryCompleted {
result: QueryResult::GetRecord(res),
stats,
..
Expand Down Expand Up @@ -778,7 +778,7 @@ impl NetworkBehaviour for DiscoveryBehaviour {
};
return Poll::Ready(NetworkBehaviourAction::GenerateEvent(ev))
},
KademliaEvent::QueryResult {
KademliaEvent::OutboundQueryCompleted {
result: QueryResult::PutRecord(res),
stats,
..
Expand All @@ -799,7 +799,7 @@ impl NetworkBehaviour for DiscoveryBehaviour {
};
return Poll::Ready(NetworkBehaviourAction::GenerateEvent(ev))
},
KademliaEvent::QueryResult {
KademliaEvent::OutboundQueryCompleted {
result: QueryResult::RepublishRecord(res),
..
} => match res {
Expand Down Expand Up @@ -830,6 +830,11 @@ impl NetworkBehaviour for DiscoveryBehaviour {
address,
score,
}),
NetworkBehaviourAction::CloseConnection { peer_id, connection } =>
return Poll::Ready(NetworkBehaviourAction::CloseConnection {
peer_id,
connection,
}),
}
}
}
Expand Down Expand Up @@ -862,6 +867,11 @@ impl NetworkBehaviour for DiscoveryBehaviour {
address,
score,
}),
NetworkBehaviourAction::CloseConnection { peer_id, connection } =>
return Poll::Ready(NetworkBehaviourAction::CloseConnection {
peer_id,
connection,
}),
}
}

Expand Down Expand Up @@ -931,7 +941,7 @@ mod tests {
},
identity::Keypair,
noise,
swarm::Swarm,
swarm::{Swarm, SwarmEvent},
yamux, Multiaddr, PeerId,
};
use std::{collections::HashSet, task::Poll};
Expand Down Expand Up @@ -1000,32 +1010,42 @@ mod tests {
match swarms[swarm_n].0.poll_next_unpin(cx) {
Poll::Ready(Some(e)) => {
match e {
DiscoveryOut::UnroutablePeer(other) |
DiscoveryOut::Discovered(other) => {
// Call `add_self_reported_address` to simulate identify
// happening.
let addr = swarms
.iter()
.find_map(|(s, a)| {
if s.behaviour().local_peer_id == other {
Some(a.clone())
} else {
None
}
})
.unwrap();
swarms[swarm_n].0.behaviour_mut().add_self_reported_address(
&other,
[protocol_name_from_protocol_id(&protocol_id)].iter(),
addr,
);

to_discover[swarm_n].remove(&other);
},
DiscoveryOut::RandomKademliaStarted(_) => {},
e => {
panic!("Unexpected event: {:?}", e)
SwarmEvent::Behaviour(behavior) => {
match behavior {
DiscoveryOut::UnroutablePeer(other) |
DiscoveryOut::Discovered(other) => {
// Call `add_self_reported_address` to simulate identify
// happening.
let addr = swarms
.iter()
.find_map(|(s, a)| {
if s.behaviour().local_peer_id == other {
Some(a.clone())
} else {
None
}
})
.unwrap();
swarms[swarm_n]
.0
.behaviour_mut()
.add_self_reported_address(
&other,
[protocol_name_from_protocol_id(&protocol_id)]
.iter(),
addr,
);

to_discover[swarm_n].remove(&other);
},
DiscoveryOut::RandomKademliaStarted(_) => {},
e => {
panic!("Unexpected event: {:?}", e)
},
}
},
// ignore non Behaviour events
_ => {},
}
continue 'polling
},
Expand Down
10 changes: 10 additions & 0 deletions client/network/src/peer_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,11 @@ impl NetworkBehaviour for PeerInfoBehaviour {
address,
score,
}),
Poll::Ready(NetworkBehaviourAction::CloseConnection { peer_id, connection }) =>
return Poll::Ready(NetworkBehaviourAction::CloseConnection {
peer_id,
connection,
}),
}
}

Expand Down Expand Up @@ -373,6 +378,11 @@ impl NetworkBehaviour for PeerInfoBehaviour {
address,
score,
}),
Poll::Ready(NetworkBehaviourAction::CloseConnection { peer_id, connection }) =>
return Poll::Ready(NetworkBehaviourAction::CloseConnection {
peer_id,
connection,
}),
}
}

Expand Down
2 changes: 2 additions & 0 deletions client/network/src/protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1575,6 +1575,8 @@ impl<B: BlockT> NetworkBehaviour for Protocol<B> {
}),
Poll::Ready(NetworkBehaviourAction::ReportObservedAddr { address, score }) =>
return Poll::Ready(NetworkBehaviourAction::ReportObservedAddr { address, score }),
Poll::Ready(NetworkBehaviourAction::CloseConnection { peer_id, connection }) =>
return Poll::Ready(NetworkBehaviourAction::CloseConnection { peer_id, connection }),
};

let outcome = match event {
Expand Down
Loading