Skip to content

Conversation

@msdos03
Copy link
Contributor

@msdos03 msdos03 commented Jan 19, 2025

mbedtls3.6补丁中使用了私有结构体成员,mbedtls不能保证此代码能在将来的版本中正常工作,所以修改一下不使用他们。
在下载源代码时openwrt会先检查官方镜像中是否存在源码包,因此不会从github克隆,官方镜像中的源码包仍然是3.3.5的release版本,并非Makefile的PKG_SOURCE_VERSION中指定的最新版本,所以修改PKG_SOURCE来解决这个问题。
另外,新增一个上游迟迟没有合并的修复性质补丁。
@zxlhhyccc

Current mbedtls 3.6 fix uses private fields in mbedtls,
which increases complexity and may break functionality in
future mbedtls versions. So rework this patch to remove them.
There is a not merged pull request for bug fixing
Change tarball name to avoid downloading from openwrt mirror,
which is not the latest version.
@zxlhhyccc
Copy link
Collaborator

zxlhhyccc commented Jan 19, 2025

@msdos03 源码中method >= CHACHA20POLY1305IETFmethod == SALSA20 ,现在改为 if (method < CHACHA20POLY1305IETF && aead_get_cipher_type(method) == NULL) 和if (method < SALSA20 && stream_get_cipher_type(method) == NULL) 之类的代替加密方式,你测试没问题吧?我现在没时间测试。

@msdos03
Copy link
Contributor Author

msdos03 commented Jan 19, 2025

@zxlhhyccc 理论上我的修改除了去掉cipher结构体中的info结构体指针之外和原先等价,我用ss-local测试了stream和aead的几个加密算法,没发现问题。
原先如果method >= CHACHA20POLY1305IETF成立就会手动分配内存并且填写info内的信息,那么info必不为NULL,现在我们去掉了info的分配代码,也就需要在错误检测中排除method >= CHACHA20POLY1305IETF的情况

@zxlhhyccc
Copy link
Collaborator

zxlhhyccc commented Jan 19, 2025

@msdos03 现在的问题是cipher结构体中的RC4_MD5也删除了,不知道有没有影响。

@msdos03
Copy link
Contributor Author

msdos03 commented Jan 19, 2025

@zxlhhyccc 并没有去掉,只是换了一种更直接的key和nounce大小获取方式不再需要这个判断了。
其实mbedtls3.6版本已经不支持rc4和blowfish了

@zxlhhyccc
Copy link
Collaborator

@msdos03 可以合并。

@coolsnowwolf coolsnowwolf merged commit 2d2c0a7 into fw876:master Jan 23, 2025
7 checks passed
@zxlhhyccc
Copy link
Collaborator

@msdos03 是否应该启用这个PR:shadowsocks/shadowsocks-libev#2953

@msdos03
Copy link
Contributor Author

msdos03 commented Feb 3, 2025

@msdos03 是否应该启用这个PR:shadowsocks/shadowsocks-libev#2953

除非你能一同把big endian机器的兼容性问题全部解决,否则我觉得没有必要

@zxlhhyccc
Copy link
Collaborator

除非你能一同把big endian机器的兼容性问题全部解决,否则我觉得没有必要

理论上应该影响不大吧?

@msdos03
Copy link
Contributor Author

msdos03 commented Feb 3, 2025

除非你能一同把big endian机器的兼容性问题全部解决,否则我觉得没有必要

理论上应该影响不大吧?

如果能兼容BE机器还是挺好的,可惜这一点改动大概不够,也没啥意义

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.

3 participants