Skip to content

Commit b5f3065

Browse files
committed
fix: TABLE cipher doesn't need to make a derived key
- fix #887 - Reference Implemetation: shadowsocks-libev, shadowsocks (Python) https://github.com/shadowsocks/shadowsocks-libev/blob/5ff4f27b74be9f390e639b960a6ec8baafc1e850/src/encrypt.c#L1395-L1399
1 parent fd72325 commit b5f3065

File tree

6 files changed

+37
-22
lines changed

6 files changed

+37
-22
lines changed

Cargo.lock

+18-16
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "shadowsocks-rust"
3-
version = "1.19.4"
3+
version = "1.20.0"
44
authors = ["Shadowsocks Contributors"]
55
description = "shadowsocks is a fast tunnel proxy that helps you bypass firewalls."
66
repository = "https://github.com/shadowsocks/shadowsocks-rust"
@@ -248,7 +248,7 @@ jemallocator = { version = "0.5", optional = true }
248248
snmalloc-rs = { version = "0.3", optional = true }
249249
rpmalloc = { version = "0.2", optional = true }
250250

251-
shadowsocks-service = { version = "1.19.4", path = "./crates/shadowsocks-service" }
251+
shadowsocks-service = { version = "1.20.0", path = "./crates/shadowsocks-service" }
252252

253253
windows-service = { version = "0.7", optional = true }
254254

crates/shadowsocks-service/Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "shadowsocks-service"
3-
version = "1.19.4"
3+
version = "1.20.0"
44
authors = ["Shadowsocks Contributors"]
55
description = "shadowsocks is a fast tunnel proxy that helps you bypass firewalls."
66
repository = "https://github.com/shadowsocks/shadowsocks-rust"
@@ -181,7 +181,7 @@ flate2 = { version = "1.0", optional = true }
181181
brotli = { version = "6.0", optional = true }
182182
zstd = { version = "0.13", optional = true }
183183

184-
tun2 = { version = "1", optional = true, features = ["async"] }
184+
tun2 = { version = "2", optional = true, features = ["async"] }
185185
etherparse = { version = "0.15", optional = true }
186186
smoltcp = { version = "0.11", optional = true, default-features = false, features = [
187187
"std",
@@ -198,7 +198,7 @@ serde = { version = "1.0", features = ["derive"] }
198198
json5 = "0.4"
199199
bson = { version = "2.10.0", optional = true }
200200

201-
shadowsocks = { version = "1.19.0", path = "../shadowsocks", default-features = false }
201+
shadowsocks = { version = "1.20.0", path = "../shadowsocks", default-features = false }
202202

203203
# Just for the ioctl call macro
204204
[target.'cfg(any(target_os = "macos", target_os = "ios", target_os = "freebsd"))'.dependencies]

crates/shadowsocks/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "shadowsocks"
3-
version = "1.19.1"
3+
version = "1.20.0"
44
authors = ["Shadowsocks Contributors"]
55
description = "shadowsocks is a fast tunnel proxy that helps you bypass firewalls."
66
repository = "https://github.com/shadowsocks/shadowsocks-rust"

crates/shadowsocks/src/config.rs

+7
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,13 @@ where
405405
{
406406
let password = password.into();
407407

408+
if method == CipherKind::SS_TABLE {
409+
// TABLE cipher doesn't need key derivation.
410+
// Reference implemenation: shadowsocks-libev, shadowsocks (Python)
411+
let enc_key = password.clone().into_bytes().into_boxed_slice();
412+
return (password, enc_key, Vec::new());
413+
}
414+
408415
#[cfg(feature = "aead-cipher-2022")]
409416
if method_support_eih(method) {
410417
// Extensible Identity Headers

debian/changelog

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
shadowsocks-rust (1.20.0) unstable; urgency=medium
2+
3+
## Breaking Changes
4+
5+
- #887 shadowsocks stream cipher (`TABLE`) doesn't need to make a derived key instead of using user's predefined key directly. This change will make shadowsocks-rust not going to be compatible with its older version. Users who are using `TABLE` cipher should upgrade all your local and server instances to the latest version of shadowsocks-rust. On the other hand, `TABLE` cipher is marked deprecated because it is vulnerable, users **must** migrate to other more secured methods immediately.
6+
17
shadowsocks-rust (1.19.4) unstable; urgency=medium
28

39
## Features

0 commit comments

Comments
 (0)