Skip to content

Conversation

@liudongmiao
Copy link

Maintainer: me / @yousong
Compile tested: ath79-generic-openwrt-23.05 (docker sdk tag)
Run tested: ath79/generic, OpenWrt 23.05.2, Netgear WNDR3800

Description: backport none method to shadowsocks-libev
Please note, the encrypt should be done in plugin.

@liudongmiao liudongmiao changed the title shadowsocks-libev, support none method shadowsocks-libev: support none method Feb 28, 2024
@yousong yousong self-assigned this Feb 29, 2024
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not look like a backport. I cannot find it in the upstream project. Maintaining custom patch here in the downstream should be avoided whenever possible.

Copy link
Author

@liudongmiao liudongmiao Feb 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see shadowsocks/shadowsocks-libev#2993 However, as shadowsocks-libev is bug fix only now, it won't be merge forever.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maintaining custom patch here in the downstream should be avoided whenever possible.

💯

Why do we need to suddenly needs this patch? In the referenced pull request, which was created today or based on @yousong comment, there is missing commit description in the commit in the upstream repository.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just forget to make a new pr in upstream. Howerver, in the new pr, I give the history of this feature (cipher none), and actually, there was a similar pr, the author first choose not to merge, then several years later, cipher none are supported by all implementation expcep shadowsocks-libev. And again, as the upstream say it's bug fix only, we can rename the patch prefix.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just force push, and use the patch from upstream pr, and mention it in commit message:

101-support-cipher-none.patch: shadowsocks/shadowsocks-libev#2993

@liudongmiao liudongmiao changed the title shadowsocks-libev: support none method shadowsocks-libev: support cipher none Mar 1, 2024
@BKPepe
Copy link
Member

BKPepe commented Mar 1, 2024

Why this goes first to the stable branch instead of master? Anyway, I dont see why point, when upstream does not care, why we should. Why we should have this patch for ages and keep it in our repo?

@1715173329 1715173329 added the OpenWrt 23.05 (end of support) Issue/PR on branch 23.05 label Mar 2, 2024
@1715173329
Copy link
Member

I still vote to shadowsocks-rust, adding local patches to a (mostly) deprecated branch doesn't look alright to me.

@liudongmiao
Copy link
Author

@1715173329 I don't think low embedded devices like mips can use shadowsocks-rust.
And actually, there is a pcre2 patch in openwrt's shadowsocks-libev.

For cipher none, it's useful for low embedded devices, there is no need to double encrypt, one in shadowsocks-libev, and one in https (direct connection except https is not a good idea, and cannot use cdn).

@1715173329
Copy link
Member

I don't think low embedded devices like mips can use shadowsocks-rust.

Why not?

@liudongmiao
Copy link
Author

I don't think low embedded devices like mips can use shadowsocks-rust.

Why not?

You check whether it's in OpenWrt. And, shadowsocks-rust requires more storage.

@1715173329
Copy link
Member

You check whether it's in OpenWrt. And, shadowsocks-rust requires more storage.

Makefile is already there, it would be very easy to get supported.
A slim sslocal build takes about 2.3-2.4 MiB, this is a reasonable size for modern devices.

@liudongmiao
Copy link
Author

Why this goes first to the stable branch instead of master? Anyway, I dont see why point, when upstream does not care, why we should. Why we should have this patch for ages and keep it in our repo?

@BKPepe

  1. about upstream don't care.. upstream choose shadowsocks-rust instead of shadowsocks-libev, and shadowsocks-rust it not included in OpenWrt. (OpenWrt prefer OpenSSL over MbedTLS just for about 1M, I don't think OpenWrt would introduce a 5M+ shadowsocks-rust.)

  2. about add this patch in OpenWrt...If OpenWrt'd like to provide shadowsocks-libev, make it compatible with shadowsocks-rust and / or other implementation should be acceptable.

@liudongmiao liudongmiao changed the base branch from openwrt-23.05 to master March 3, 2024 01:32
patch is from shadowsocks/shadowsocks-libev#2993
and there is a history for cipher none in other shadowsocks implementation.

Signed-off-by: Liu Dongmiao <liudongmiao@gmail.com>
@liudongmiao
Copy link
Author

@BKPepe Just change the pr from latest stable branch to master.
@yousong Could you review this patch?

@liudongmiao
Copy link
Author

@1715173329 As I change the pr, merge into master (previous is openwrt-23.05), could you remove label "OpenWrt 23.05"?

@1715173329 1715173329 removed the OpenWrt 23.05 (end of support) Issue/PR on branch 23.05 label Mar 3, 2024
@BKPepe
Copy link
Member

BKPepe commented Mar 3, 2024

For cipher none, it's useful for low embedded devices, there is no need to double encrypt, one in shadowsocks-libev, and one in https (direct connection except https is not a good idea, and cannot use cdn).

Still I am against to introduce such opinion based on security. You always want to encrypt it, no matter what and introducing such change only for you. Does not make sense, though. As you said, upstream does not care, we dont care as well.

Should be done in upstream not here.

@BKPepe BKPepe closed this Mar 3, 2024
@liudongmiao
Copy link
Author

Still I am against to introduce such opinion based on security. You always want to encrypt it, no matter what and introducing such change only for you. Does not make sense, though. As you said, upstream does not care, we dont care as well.

Should be done in upstream not here.

Cipher none doesn't mean no encryption, it's a way to avoid duplicate encryption.

In real situation, it's like this, shadowsocks client + cipher --> https --> shadowsocks server + cipher, if there is no cipher none, it's double encrypted, one in the cipher of shadowsocks, one in https.

There is cipher none in upstream shadowsocks-libev's next shadowsocks-rust. However, there is no shadowsocks-rust in OpenWrt. @BKPepe

@yousong
Copy link
Member

yousong commented Mar 5, 2024

@liudongmiao The rust variant is not here simply because no one has the time/motivation yet to do it, preferably in a way compatible with current uci config.

The same reasoning also applies to maintaining custom patches here in the downstream. We simply do not have the manpower.

As for the pcre2 patch, you can be sure that we are all the same reluctant to add it. We did it because we wanted to keep what's already working to continue to be that way. That treewide transitioning to pcre2 is a good thing. In the end, there will be a point when shadowsock-libev is not maintainable here and we have to drop support for it.

@liudongmiao
Copy link
Author

@yousong Thanks.

I'm working for a compatible libevent based sip003 plugin for OpenWrt that cannnot install v2ray-plugin.

On x64 machine, the libevent based plugin is a little faster than v2ray-plugin client.
And, it seems the speed is almost same for cipher none and cipher chacha on x64.

On mips, it seems cipher none is 25% faster than cipher chacha with the libevent based plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants