Skip to content

Commit e5aa006

Browse files
authored
Merge pull request #193 from nervosnetwork/bump-to-0.2.6
chore: bump to 0.2.6
2 parents d614a6b + 175437b commit e5aa006

File tree

9 files changed

+41
-17
lines changed

9 files changed

+41
-17
lines changed

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
## 0.2.6
2+
3+
### Features
4+
5+
- Secio removed support for `twofish-ctr`, [detail](https://github.com/nervosnetwork/p2p/pull/191)
6+
- Secio added support for `aes-gcm/chacha20poly1305`, [detail](https://github.com/nervosnetwork/p2p/pull/191)
7+
- Secio default symmetric encryption algorithm change to `aes-128-gcm`, [detail](https://github.com/nervosnetwork/p2p/pull/191)
8+
- Use industry standard encryption algorithms in openssl or ring, [detail](https://github.com/nervosnetwork/p2p/pull/191)
9+
- Upgrade molecule
10+
- Secio bump to 0.2.0
11+
- Change panic report road
12+
13+
### Bug fix
14+
15+
- Fix the implementation of non-standard encryption algorithms
16+
- Fix potential overflow
17+
- Fix handshake attack
18+
119
## 0.2.5
220

321
### Features

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "tentacle"
3-
version = "0.2.5"
3+
version = "0.2.6"
44
license = "MIT"
55
description = "Minimal implementation for a multiplexed p2p network framework."
66
authors = ["piaoliu <[email protected]>", "Nervos Core Dev <[email protected]>"]
@@ -17,7 +17,7 @@ all-features = false
1717
no-default-features = true
1818

1919
[dependencies]
20-
yamux = { path = "yamux", version = "0.1.13", package = "tokio-yamux" }
20+
yamux = { path = "yamux", version = "0.1.14", package = "tokio-yamux" }
2121
secio = { path = "secio", version = "0.2.0", package = "tentacle-secio" }
2222

2323
futures = "0.1"

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ The API of this project is basically usable. However we still need more tests. P
3838

3939
```toml
4040
[dependencies]
41-
tentacle = { version = "0.2", feaures = ["molc"] }
41+
tentacle = { version = "0.2", features = ["molc"] }
4242
```
4343

4444
### Example
@@ -53,13 +53,13 @@ $ git clone https://github.com/nervosnetwork/p2p.git
5353

5454
Listen on 127.0.0.1:1337
5555
```bash
56-
$ RUST_LOG=simple=info,tentacle=debug cargo run --example simple --feaures molc -- server
56+
$ RUST_LOG=simple=info,tentacle=debug cargo run --example simple --features molc -- server
5757
```
5858

5959
3. On another terminal:
6060

6161
```bash
62-
$ RUST_LOG=simple=info,tentacle=debug cargo run --example simple --feaures molc
62+
$ RUST_LOG=simple=info,tentacle=debug cargo run --example simple --features molc
6363
```
6464

6565
4. Now you can see some data interaction information on the terminal.

protocols/discovery/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "tentacle-discovery"
3-
version = "0.2.7"
3+
version = "0.2.8"
44
authors = ["Linfeng Qian <[email protected]>"]
55
license = "MIT"
66
description = "p2p discovery protocol main reference bitcoin"
@@ -15,7 +15,7 @@ all-features = false
1515
no-default-features = true
1616

1717
[dependencies]
18-
p2p = { path = "../..", version = "0.2.5", package = "tentacle" }
18+
p2p = { path = "../..", version = "0.2.6", package = "tentacle" }
1919
bytes = "0.4"
2020
byteorder = "1.2"
2121
futures = "0.1"

protocols/identify/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "tentacle-identify"
3-
version = "0.2.8"
3+
version = "0.2.9"
44
authors = ["Qian Linfeng <[email protected]>"]
55
license = "MIT"
66
description = "p2p identify protocol"
@@ -15,7 +15,7 @@ all-features = false
1515
no-default-features = true
1616

1717
[dependencies]
18-
p2p = { path = "../..", version = "0.2.5", package = "tentacle" }
18+
p2p = { path = "../..", version = "0.2.6", package = "tentacle" }
1919
bytes = "0.4"
2020
flatbuffers = { version = "0.6.0", optional = true }
2121
flatbuffers-verifier = { version = "0.2.0", optional = true }

protocols/ping/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "tentacle-ping"
3-
version = "0.3.7"
3+
version = "0.3.8"
44
authors = ["Nervos Core Dev <[email protected]>"]
55
license = "MIT"
66
keywords = ["network", "peer-to-peer", "p2p", "ping"]
@@ -15,7 +15,7 @@ all-features = false
1515
no-default-features = true
1616

1717
[dependencies]
18-
p2p = { path = "../..", version = "0.2.5", package = "tentacle" }
18+
p2p = { path = "../..", version = "0.2.6", package = "tentacle" }
1919
log = "0.4"
2020
flatbuffers = { version = "0.6.0", optional = true }
2121
flatbuffers-verifier = { version = "0.2.0", optional = true }

src/session.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,8 +331,14 @@ where
331331

332332
/// After the session is established, the client is requested to open some custom protocol sub stream.
333333
pub fn open_proto_stream(&mut self, proto_name: &str) {
334+
let handle = match self.socket.open_stream() {
335+
Ok(handle) => handle,
336+
Err(e) => {
337+
debug!("session {} open stream error: {}", self.context.id, e);
338+
return;
339+
}
340+
};
334341
debug!("try open proto, {}", proto_name);
335-
let handle = self.socket.open_stream().unwrap();
336342
let versions = self.protocol_configs[proto_name].support_versions.clone();
337343
let proto_info = ProtocolInfo::new(&proto_name, versions);
338344

yamux/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "tokio-yamux"
3-
version = "0.1.13"
3+
version = "0.1.14"
44
license = "MIT"
55
repository = "https://github.com/nervosnetwork/p2p"
66
description = "Rust implementation of Yamux"

yamux/src/stream.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -402,12 +402,12 @@ impl io::Write for StreamHandle {
402402
match e {
403403
Error::SessionShutdown => return Err(io::ErrorKind::BrokenPipe.into()),
404404
// read flag error or read data error
405-
Error::UnexpectedFlag | Error::RecvWindowExceeded => {
405+
Error::UnexpectedFlag | Error::RecvWindowExceeded | Error::InvalidMsgType => {
406406
return Err(io::ErrorKind::InvalidData.into());
407407
}
408408
Error::SubStreamRemoteClosing => (),
409409
Error::WouldBlock => return Err(io::ErrorKind::WouldBlock.into()),
410-
_ => unimplemented!(),
410+
_ => (),
411411
}
412412
}
413413
if self.state == StreamState::LocalClosing || self.state == StreamState::Closed {
@@ -450,12 +450,12 @@ impl io::Write for StreamHandle {
450450
match e {
451451
Error::SessionShutdown => return Err(io::ErrorKind::BrokenPipe.into()),
452452
// read flag error or read data error
453-
Error::UnexpectedFlag | Error::RecvWindowExceeded => {
453+
Error::UnexpectedFlag | Error::RecvWindowExceeded | Error::InvalidMsgType => {
454454
return Err(io::ErrorKind::InvalidData.into());
455455
}
456456
Error::SubStreamRemoteClosing => (),
457457
Error::WouldBlock => return Err(io::ErrorKind::WouldBlock.into()),
458-
_ => unimplemented!(),
458+
_ => (),
459459
}
460460
}
461461
let event = StreamEvent::Flush(self.id);

0 commit comments

Comments
 (0)