Skip to content

Commit

Permalink
Fix threshold after which a protocol name is too long (#2162)
Browse files Browse the repository at this point in the history
* Fix threshold after which a protocol name is too long

* Link to PR in changelog

* Fix changelog item position
  • Loading branch information
tomaka authored Mar 22, 2022
1 parent 53e0ea4 commit e5158a1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions bin/wasm-node/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

### Fixed

- Increase the threshold after which smoldot considers that a protocol name sent through multistream-select is an attempt at a DoS attack, to accomodate for the change in the GrandPa protocol name in Substrate. ([#2162](https://github.com/paritytech/smoldot/pull/2162))

## 0.6.6 - 2022-03-18

### Added
Expand Down
2 changes: 1 addition & 1 deletion src/libp2p/connection/multistream_select.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ where
// legitimately requests a protocol that the listener doesn't support. In order to prevent
// confusion, a minimum length is applied to the protocol name length. Any protocol name
// smaller than this will never trigger a protocol error, even if it isn't supported.
const MIN_PROTO_LEN_NO_ERR: usize = 48;
const MIN_PROTO_LEN_NO_ERR: usize = 512;
let max_frame_len = cmp::max(
cmp::max(max_proto_name_len, MIN_PROTO_LEN_NO_ERR),
HANDSHAKE.len(),
Expand Down

0 comments on commit e5158a1

Please sign in to comment.