This commit is contained in:
Adam Ierymenko 2022-11-14 11:51:55 -05:00
parent 5d9022f815
commit 68021b8a7f
3 changed files with 13 additions and 13 deletions

View file

@ -84,22 +84,16 @@ impl Cache {
/// Delete a network, returning it if it existed.
pub fn on_network_deleted(&self, network_id: NetworkId) -> Option<(Network, Vec<Member>)> {
let mut by_nwid = self.by_nwid.write().unwrap();
if let Some(network) = by_nwid.remove(&network_id) {
let mut members = network.1.lock().unwrap();
Some((network.0, members.drain().map(|(_, v)| v).collect()))
} else {
None
}
let network = by_nwid.remove(&network_id)?;
let mut members = network.1.lock().unwrap();
Some((network.0, members.drain().map(|(_, v)| v).collect()))
}
/// Delete a member, returning it if it existed.
pub fn on_member_deleted(&self, network_id: NetworkId, node_id: Address) -> Option<Member> {
let by_nwid = self.by_nwid.read().unwrap();
if let Some(network) = by_nwid.get(&network_id) {
let mut members = network.1.lock().unwrap();
members.remove(&node_id)
} else {
None
}
let network = by_nwid.get(&network_id)?;
let mut members = network.1.lock().unwrap();
members.remove(&node_id)
}
}

6
crypto/ZSSP.md Normal file
View file

@ -0,0 +1,6 @@
ZeroTier Secure Socket Protocol
======
ZSSP (ZeroTier Secure Socket Protocol) is an implementation of the Noise_IK pattern using FIPS/NIST compliant primitives. After Noise_IK negotiation is complete ZSSP also adds key ratcheting and optional (enabled by default) support for quantum data forward secrecy with Kyber1024.
It's general purpose and could be used with any system but contains a few specific design choices to make it optimal for ZeroTier and easy to distinguish from legacy ZeroTier V1 traffic for backward compatibility.

View file

@ -66,7 +66,7 @@ pub trait HostSystem: VL1AuthProvider + NodeStorage + 'static {
/// Type for local system sockets.
type LocalSocket: Sync + Send + Hash + PartialEq + Eq + Clone + ToString + Sized + 'static;
/// Type for local system interfaces.
/// Type for local system interfaces.
type LocalInterface: Sync + Send + Hash + PartialEq + Eq + Clone + ToString + Sized + 'static;
/// A VL1 level event occurred.