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

密码解密key扫描预期之外的回车符/换行符 #486

Closed
Ink-33 opened this issue Dec 11, 2020 · 1 comment
Closed

密码解密key扫描预期之外的回车符/换行符 #486

Ink-33 opened this issue Dec 11, 2020 · 1 comment

Comments

@Ink-33
Copy link
Contributor

Ink-33 commented Dec 11, 2020

环境信息
请根据实际使用环境修改以下信息
go-cqhttp版本: since 44b26b7
运行环境: win/linux

bug内容
当前使用的解密key扫描方法会导致解密key尾端追加回车符/换行符(linux中仅追加换行符,对应ASCII10;windows中,在换行符前还会追加一个回车符,ASCII13
这就造成了用户同样的键入在win/linux中却对应了不同的解密密钥,导致密码无法正常解密。

#481 的需求,将隐藏解密密钥输入时的回显。目前初步有这几个想法:

  • 1,发布break change,使用terminal.ReadPassword()隐式读取密钥(读取结果不包含换行符与回车符),旧加密密文废除使用,重新加密。
  • 2,与1相同,但提供一个转换器,转换旧密文为新密文,不影响使用
  • 3,鸽了不做了(

欢迎各位大佬提供建议与帮助!

@Ink-33
Copy link
Contributor Author

Ink-33 commented Dec 11, 2020

理论上现在通过运行时传参的方式解密密码只能在win上用,原因也是因为我忽略了win/linux这一点点小差异。

@Ink-33 Ink-33 mentioned this issue Dec 12, 2020
@Mrs4s Mrs4s closed this as completed in c492465 Dec 12, 2020
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

1 participant