mirror of https://github.com/dswd/vpncloud.git
Compare commits
No commits in common. "d9a2ee28cc129455143bf79527fee502d8c5276d" and "13688edd75986da538a6ae8ccba19817258a694d" have entirely different histories.
d9a2ee28cc
...
13688edd75
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
This project follows [semantic versioning](http://semver.org).
|
This project follows [semantic versioning](http://semver.org).
|
||||||
|
|
||||||
### v2.1.0 (2021-02-06)
|
### UNRELEASED
|
||||||
|
|
||||||
- [added] Support for websocket proxy mode
|
- [added] Support for websocket proxy mode
|
||||||
- [added] Support for hook scripts to handle certain situations
|
- [added] Support for hook scripts to handle certain situations
|
||||||
|
|
|
@ -1219,7 +1219,7 @@ checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "vpncloud"
|
name = "vpncloud"
|
||||||
version = "2.1.0"
|
version = "2.0.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"byteorder",
|
"byteorder",
|
||||||
"criterion",
|
"criterion",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "vpncloud"
|
name = "vpncloud"
|
||||||
version = "2.1.0"
|
version = "2.0.1"
|
||||||
authors = ["Dennis Schwerdel <schwerdel@googlemail.com>"]
|
authors = ["Dennis Schwerdel <schwerdel@googlemail.com>"]
|
||||||
build = "build.rs"
|
build = "build.rs"
|
||||||
license = "GPL-3.0"
|
license = "GPL-3.0"
|
||||||
|
@ -34,7 +34,7 @@ url = { version = "2.2", optional = true }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
tempfile = "3"
|
tempfile = "3"
|
||||||
criterion = { version = "0.3", features = ["html_reports"] }
|
criterion = "0.3"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["nat", "websocket"]
|
default = ["nat", "websocket"]
|
||||||
|
|
|
@ -1,16 +1,3 @@
|
||||||
vpncloud (2.1.0) stable; urgency=medium
|
|
||||||
|
|
||||||
* [added] Support for websocket proxy mode
|
|
||||||
* [added] Support for hook scripts to handle certain situations
|
|
||||||
* [added] Support for creating shell completions
|
|
||||||
* [removed] Removed dummy device type
|
|
||||||
* [changed] Updated dependencies
|
|
||||||
* [changed] Changed Rust version to 1.49.0
|
|
||||||
* [fixed] Added missing peer address propagation
|
|
||||||
* [fixed] Fixed problem with peer addresses without port
|
|
||||||
|
|
||||||
-- Dennis Schwerdel <schwerdel@googlemail.com> Sat, 06 Feb 2020 13:13:00 +0100
|
|
||||||
|
|
||||||
vpncloud (2.0.1) stable; urgency=medium
|
vpncloud (2.0.1) stable; urgency=medium
|
||||||
|
|
||||||
* [changed] Changed documentation
|
* [changed] Changed documentation
|
||||||
|
|
|
@ -325,17 +325,15 @@ impl<TS: TimeSource> BeaconSerializer<TS> {
|
||||||
fn encode() {
|
fn encode() {
|
||||||
MockTimeSource::set_time(2000 * 3600);
|
MockTimeSource::set_time(2000 * 3600);
|
||||||
let ser = BeaconSerializer::<MockTimeSource>::new(b"mysecretkey");
|
let ser = BeaconSerializer::<MockTimeSource>::new(b"mysecretkey");
|
||||||
let mut peers = vec![
|
let mut peers = Vec::new();
|
||||||
SocketAddr::from_str("1.2.3.4:5678").unwrap(),
|
peers.push(SocketAddr::from_str("1.2.3.4:5678").unwrap());
|
||||||
SocketAddr::from_str("6.6.6.6:53").unwrap()
|
peers.push(SocketAddr::from_str("6.6.6.6:53").unwrap());
|
||||||
];
|
|
||||||
assert_eq!("WsHI31EWDMBYxvITiILIrm2k9gEik22E", ser.encode(&peers));
|
assert_eq!("WsHI31EWDMBYxvITiILIrm2k9gEik22E", ser.encode(&peers));
|
||||||
peers.push(SocketAddr::from_str("[::1]:5678").unwrap());
|
peers.push(SocketAddr::from_str("[::1]:5678").unwrap());
|
||||||
assert_eq!("WsHI3GXKaXCveo6uejmZizZ72kR6Y0L9T7h49TXONp1ugfKvvvEik22E", ser.encode(&peers));
|
assert_eq!("WsHI3GXKaXCveo6uejmZizZ72kR6Y0L9T7h49TXONp1ugfKvvvEik22E", ser.encode(&peers));
|
||||||
let peers = vec![
|
let mut peers = Vec::new();
|
||||||
SocketAddr::from_str("1.2.3.4:5678").unwrap(),
|
peers.push(SocketAddr::from_str("1.2.3.4:5678").unwrap());
|
||||||
SocketAddr::from_str("6.6.6.6:54").unwrap()
|
peers.push(SocketAddr::from_str("6.6.6.6:54").unwrap());
|
||||||
];
|
|
||||||
assert_eq!("WsHI32gm9eMSHP3Lm1GXcdP7rD3ik22E", ser.encode(&peers));
|
assert_eq!("WsHI32gm9eMSHP3Lm1GXcdP7rD3ik22E", ser.encode(&peers));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -343,10 +341,9 @@ fn encode() {
|
||||||
fn decode() {
|
fn decode() {
|
||||||
MockTimeSource::set_time(2000 * 3600);
|
MockTimeSource::set_time(2000 * 3600);
|
||||||
let ser = BeaconSerializer::<MockTimeSource>::new(b"mysecretkey");
|
let ser = BeaconSerializer::<MockTimeSource>::new(b"mysecretkey");
|
||||||
let mut peers = vec![
|
let mut peers = Vec::new();
|
||||||
SocketAddr::from_str("1.2.3.4:5678").unwrap(),
|
peers.push(SocketAddr::from_str("1.2.3.4:5678").unwrap());
|
||||||
SocketAddr::from_str("6.6.6.6:53").unwrap()
|
peers.push(SocketAddr::from_str("6.6.6.6:53").unwrap());
|
||||||
];
|
|
||||||
assert_eq!(format!("{:?}", peers), format!("{:?}", ser.decode("WsHI31EWDMBYxvITiILIrm2k9gEik22E", None)));
|
assert_eq!(format!("{:?}", peers), format!("{:?}", ser.decode("WsHI31EWDMBYxvITiILIrm2k9gEik22E", None)));
|
||||||
peers.push(SocketAddr::from_str("[::1]:5678").unwrap());
|
peers.push(SocketAddr::from_str("[::1]:5678").unwrap());
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
|
@ -359,10 +356,9 @@ fn decode() {
|
||||||
fn decode_split() {
|
fn decode_split() {
|
||||||
MockTimeSource::set_time(2000 * 3600);
|
MockTimeSource::set_time(2000 * 3600);
|
||||||
let ser = BeaconSerializer::<MockTimeSource>::new(b"mysecretkey");
|
let ser = BeaconSerializer::<MockTimeSource>::new(b"mysecretkey");
|
||||||
let peers = vec![
|
let mut peers = Vec::new();
|
||||||
SocketAddr::from_str("1.2.3.4:5678").unwrap(),
|
peers.push(SocketAddr::from_str("1.2.3.4:5678").unwrap());
|
||||||
SocketAddr::from_str("6.6.6.6:53").unwrap()
|
peers.push(SocketAddr::from_str("6.6.6.6:53").unwrap());
|
||||||
];
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
format!("{:?}", peers),
|
format!("{:?}", peers),
|
||||||
format!("{:?}", ser.decode("WsHI3-1E.WD:MB Yx\tvI\nTi(IL)Ir[m2]k9ügEäik22E", None))
|
format!("{:?}", ser.decode("WsHI3-1E.WD:MB Yx\tvI\nTi(IL)Ir[m2]k9ügEäik22E", None))
|
||||||
|
@ -377,10 +373,9 @@ fn decode_split() {
|
||||||
fn decode_offset() {
|
fn decode_offset() {
|
||||||
MockTimeSource::set_time(2000 * 3600);
|
MockTimeSource::set_time(2000 * 3600);
|
||||||
let ser = BeaconSerializer::<MockTimeSource>::new(b"mysecretkey");
|
let ser = BeaconSerializer::<MockTimeSource>::new(b"mysecretkey");
|
||||||
let peers = vec![
|
let mut peers = Vec::new();
|
||||||
SocketAddr::from_str("1.2.3.4:5678").unwrap(),
|
peers.push(SocketAddr::from_str("1.2.3.4:5678").unwrap());
|
||||||
SocketAddr::from_str("6.6.6.6:53").unwrap()
|
peers.push(SocketAddr::from_str("6.6.6.6:53").unwrap());
|
||||||
];
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
format!("{:?}", peers),
|
format!("{:?}", peers),
|
||||||
format!("{:?}", ser.decode("Hello World: WsHI31EWDMBYxvITiILIrm2k9gEik22E! End of the World", None))
|
format!("{:?}", ser.decode("Hello World: WsHI31EWDMBYxvITiILIrm2k9gEik22E! End of the World", None))
|
||||||
|
@ -391,10 +386,9 @@ fn decode_offset() {
|
||||||
fn decode_multiple() {
|
fn decode_multiple() {
|
||||||
MockTimeSource::set_time(2000 * 3600);
|
MockTimeSource::set_time(2000 * 3600);
|
||||||
let ser = BeaconSerializer::<MockTimeSource>::new(b"mysecretkey");
|
let ser = BeaconSerializer::<MockTimeSource>::new(b"mysecretkey");
|
||||||
let peers = vec![
|
let mut peers = Vec::new();
|
||||||
SocketAddr::from_str("1.2.3.4:5678").unwrap(),
|
peers.push(SocketAddr::from_str("1.2.3.4:5678").unwrap());
|
||||||
SocketAddr::from_str("6.6.6.6:53").unwrap()
|
peers.push(SocketAddr::from_str("6.6.6.6:53").unwrap());
|
||||||
];
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
format!("{:?}", peers),
|
format!("{:?}", peers),
|
||||||
format!("{:?}", ser.decode("WsHI31HVpqxFNMNSPrvik22E WsHI34yOBcZIulKdtn2ik22E", None))
|
format!("{:?}", ser.decode("WsHI31HVpqxFNMNSPrvik22E WsHI34yOBcZIulKdtn2ik22E", None))
|
||||||
|
@ -405,6 +399,9 @@ fn decode_multiple() {
|
||||||
fn decode_ttl() {
|
fn decode_ttl() {
|
||||||
MockTimeSource::set_time(2000 * 3600);
|
MockTimeSource::set_time(2000 * 3600);
|
||||||
let ser = BeaconSerializer::<MockTimeSource>::new(b"mysecretkey");
|
let ser = BeaconSerializer::<MockTimeSource>::new(b"mysecretkey");
|
||||||
|
let mut peers = Vec::new();
|
||||||
|
peers.push(SocketAddr::from_str("1.2.3.4:5678").unwrap());
|
||||||
|
peers.push(SocketAddr::from_str("6.6.6.6:53").unwrap());
|
||||||
MockTimeSource::set_time(2000 * 3600);
|
MockTimeSource::set_time(2000 * 3600);
|
||||||
assert_eq!(2, ser.decode("WsHI31EWDMBYxvITiILIrm2k9gEik22E", None).len());
|
assert_eq!(2, ser.decode("WsHI31EWDMBYxvITiILIrm2k9gEik22E", None).len());
|
||||||
MockTimeSource::set_time(2100 * 3600);
|
MockTimeSource::set_time(2100 * 3600);
|
||||||
|
@ -443,10 +440,9 @@ fn decode_invalid() {
|
||||||
fn encode_decode() {
|
fn encode_decode() {
|
||||||
MockTimeSource::set_time(2000 * 3600);
|
MockTimeSource::set_time(2000 * 3600);
|
||||||
let ser = BeaconSerializer::<MockTimeSource>::new(b"mysecretkey");
|
let ser = BeaconSerializer::<MockTimeSource>::new(b"mysecretkey");
|
||||||
let peers = vec![
|
let mut peers = Vec::new();
|
||||||
SocketAddr::from_str("1.2.3.4:5678").unwrap(),
|
peers.push(SocketAddr::from_str("1.2.3.4:5678").unwrap());
|
||||||
SocketAddr::from_str("6.6.6.6:53").unwrap()
|
peers.push(SocketAddr::from_str("6.6.6.6:53").unwrap());
|
||||||
];
|
|
||||||
let data = ser.encode(&peers);
|
let data = ser.encode(&peers);
|
||||||
let peers2 = ser.decode(&data, None);
|
let peers2 = ser.decode(&data, None);
|
||||||
assert_eq!(format!("{:?}", peers), format!("{:?}", peers2));
|
assert_eq!(format!("{:?}", peers), format!("{:?}", peers2));
|
||||||
|
@ -456,10 +452,9 @@ fn encode_decode() {
|
||||||
fn encode_decode_file() {
|
fn encode_decode_file() {
|
||||||
MockTimeSource::set_time(2000 * 3600);
|
MockTimeSource::set_time(2000 * 3600);
|
||||||
let ser = BeaconSerializer::<MockTimeSource>::new(b"mysecretkey");
|
let ser = BeaconSerializer::<MockTimeSource>::new(b"mysecretkey");
|
||||||
let peers = vec![
|
let mut peers = Vec::new();
|
||||||
SocketAddr::from_str("1.2.3.4:5678").unwrap(),
|
peers.push(SocketAddr::from_str("1.2.3.4:5678").unwrap());
|
||||||
SocketAddr::from_str("6.6.6.6:53").unwrap()
|
peers.push(SocketAddr::from_str("6.6.6.6:53").unwrap());
|
||||||
];
|
|
||||||
let file = tempfile::NamedTempFile::new().expect("Failed to create temp file");
|
let file = tempfile::NamedTempFile::new().expect("Failed to create temp file");
|
||||||
assert!(ser.write_to_file(&peers, file.path()).is_ok());
|
assert!(ser.write_to_file(&peers, file.path()).is_ok());
|
||||||
let peers2 = ser.read_from_file(file.path(), None);
|
let peers2 = ser.read_from_file(file.path(), None);
|
||||||
|
@ -471,10 +466,9 @@ fn encode_decode_file() {
|
||||||
fn encode_decode_cmd() {
|
fn encode_decode_cmd() {
|
||||||
MockTimeSource::set_time(2000 * 3600);
|
MockTimeSource::set_time(2000 * 3600);
|
||||||
let ser = BeaconSerializer::<MockTimeSource>::new(b"mysecretkey");
|
let ser = BeaconSerializer::<MockTimeSource>::new(b"mysecretkey");
|
||||||
let peers = vec![
|
let mut peers = Vec::new();
|
||||||
SocketAddr::from_str("1.2.3.4:5678").unwrap(),
|
peers.push(SocketAddr::from_str("1.2.3.4:5678").unwrap());
|
||||||
SocketAddr::from_str("6.6.6.6:53").unwrap()
|
peers.push(SocketAddr::from_str("6.6.6.6:53").unwrap());
|
||||||
];
|
|
||||||
let file = tempfile::NamedTempFile::new().expect("Failed to create temp file");
|
let file = tempfile::NamedTempFile::new().expect("Failed to create temp file");
|
||||||
assert!(ser.write_to_cmd(&peers, &format!("echo $beacon > {}", file.path().display())).is_ok());
|
assert!(ser.write_to_cmd(&peers, &format!("echo $beacon > {}", file.path().display())).is_ok());
|
||||||
thread::sleep(Duration::from_millis(100));
|
thread::sleep(Duration::from_millis(100));
|
||||||
|
|
|
@ -49,7 +49,6 @@ const SPACE_BEFORE: usize = 100;
|
||||||
|
|
||||||
struct PeerData {
|
struct PeerData {
|
||||||
addrs: AddrList,
|
addrs: AddrList,
|
||||||
#[allow(dead_code)] //TODO: export in status
|
|
||||||
last_seen: Time,
|
last_seen: Time,
|
||||||
timeout: Time,
|
timeout: Time,
|
||||||
peer_timeout: u16,
|
peer_timeout: u16,
|
||||||
|
|
|
@ -391,7 +391,6 @@ pub struct InitState<P: Payload> {
|
||||||
last_message: Option<Vec<u8>>,
|
last_message: Option<Vec<u8>>,
|
||||||
crypto: Option<CryptoCore>,
|
crypto: Option<CryptoCore>,
|
||||||
algorithms: Algorithms,
|
algorithms: Algorithms,
|
||||||
#[allow(dead_code)] // Used in tests
|
|
||||||
selected_algorithm: Option<&'static Algorithm>,
|
selected_algorithm: Option<&'static Algorithm>,
|
||||||
failed_retries: usize
|
failed_retries: usize
|
||||||
}
|
}
|
||||||
|
@ -490,7 +489,7 @@ impl<P: Payload> InitState<P> {
|
||||||
if let Some(crypto) = &mut self.crypto {
|
if let Some(crypto) = &mut self.crypto {
|
||||||
crypto.decrypt(data)?;
|
crypto.decrypt(data)?;
|
||||||
}
|
}
|
||||||
P::read_from(Cursor::new(data.message()))
|
Ok(P::read_from(Cursor::new(data.message()))?)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn check_salted_node_id_hash(&self, hash: &SaltedNodeIdHash, node_id: NodeId) -> bool {
|
fn check_salted_node_id_hash(&self, hash: &SaltedNodeIdHash, node_id: NodeId) -> bool {
|
||||||
|
|
Loading…
Reference in New Issue