Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aes-pmac-siv 错误 #105

Closed
e2ge opened this issue May 8, 2018 · 12 comments
Closed

aes-pmac-siv 错误 #105

e2ge opened this issue May 8, 2018 · 12 comments

Comments

@e2ge
Copy link

e2ge commented May 8, 2018

版本1.6.12
cargo build --release --features miscreant

客户端win7,nightly-msvc ABI,以下错误提示后客户端中止退出:
Illegal instruction

服务端Centos,nightly-gnu ABI,错误提示:
[ERROR] AEAD decrypt failed, nonce=b"\x00\x00\x00\x00\x00\x00\x00\x00", input=b"$R", tag=b"\x15Yx5\x15\x0ce\t\xf9\x1b\xc1\xa4\x06\x93\x8e\xa2", err: decrypt failure
[ERROR] Failed to handle client (...): failed to decode Address, may be wrong method or key, peer: ...
[ERROR] Failed to handle client (...): failed to decode Address, may be wrong method or key, peer: ...

@zonyitoo
Copy link
Collaborator

zonyitoo commented May 8, 2018

  1. 请clone 此repo 然后执行 cargo testcargo test --release,测试是否会报 Illegal instruction,若会,说明此crate编译有问题(大概率怀疑是你所运行的CPU不支持AES指令),把相关信息提Issue给miscreant。

  2. 此错误提示就是服务端无法正常解码,一般来讲就是加密方式不匹配,或纯粹就是密码写错了。请先检查Client及Server端加密方式是否一样,且Password是否一样。

若确认配置没有问题,请提供Client版本及你使用的配置(Client端及Server端配置),我要重现。

@e2ge
Copy link
Author

e2ge commented May 9, 2018

miscreant的cargo test不通过,报错不支持aes128和aes256等很多错误,查了一下,我的cpu的确不支持aes指令集,等我换个电脑试试。确定password一致,因为相同配置aes-256-gcm是没有问题的。

@zonyitoo
Copy link
Collaborator

zonyitoo commented May 9, 2018

password一致的话,Client用的是哪个版本?配置提供一下

@e2ge
Copy link
Author

e2ge commented May 9, 2018

client是我自己在本机上编译的,版本1.6.12,编译过程没有报错。
OPENSSL_DIR=C:\\OpenSSL-Win64 OPENSSL_STATIC=yes SODIUM_BUILD_STATIC=yes cargo build --release --features miscreant

配置文件:
{
"servers": [
{
"address": "xxx.com", "port": 8338,
"password": "xxx", "method": "aes-256-gcm", "timeout": 300
}
],
"local_port": 1080,
"local_address": "127.0.0.1"
}

@zonyitoo
Copy link
Collaborator

zonyitoo commented May 9, 2018

Client也是shadowsocks-rust吗?我现在就在用aes-pmac-siv,使用非常正常啊……

@e2ge
Copy link
Author

e2ge commented May 9, 2018

是的,client也是rust版本的ss,可能是不支持aes的缘故?等我换个电脑试试再来报告。

@e2ge
Copy link
Author

e2ge commented May 9, 2018

试了一下,旧电脑不支持aes指令,无论用msvc还是gnu ABI编译运行后都报错Illegal instruction
test的话msvc出现Illegal instruction错误,但是gnu出现Segmentation fault错误。
在新电脑上用gnu ABI编译test出现Segmentation fault错误,但是不影响运行使用,可以使用pmac-siv加密。
结论就是cpu必须支持aes才能使用pmac-siv加密。新的错误出现Segmentation fault

@zonyitoo
Copy link
Collaborator

zonyitoo commented May 9, 2018

Segmentation fault就是Illegal instruction,差不多的。
实际上不支持AES指令的话,应当使用代码模拟版本的AES加密的,这个库没有做好,强行用AESNI

@e2ge
Copy link
Author

e2ge commented May 9, 2018

ok,谢谢,期待进一步的升级,辛苦。

@zonyitoo
Copy link
Collaborator

你这个问题应该向miscreant提issue,让他们看看针对你的CPU应该要怎么判断

@quininer
Copy link
Contributor

更新到 0.4-beta 可解決 miscreant/meta#177

@zonyitoo
Copy link
Collaborator

@e2ge 是否已经Fix?

@zonyitoo zonyitoo closed this as completed Aug 8, 2018
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

No branches or pull requests

3 participants