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

[2.0.0] 部分vmess链接解析错误 #109

Closed
huyz-git opened this issue Oct 15, 2019 · 11 comments
Closed

[2.0.0] 部分vmess链接解析错误 #109

huyz-git opened this issue Oct 15, 2019 · 11 comments
Labels
Bugs Something isn't working f/parser Import vmess string. t/runtime Issue occured in runtime, not compile-time

Comments

@huyz-git
Copy link

简单描述这个 bug:
比如这个配置(地址啥的用x代替):

{"ps":"xxxxxx","add":"xxx.xxx.xxx","port":"xxxx","id":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx","aid":"2","net":"tcp","type":"chacha20-poly1305","host":"","tls":""}

base64编码后变成这个链接:

vmess://eyJwcyI6Inh4eHh4eCIsImFkZCI6Inh4eC54eHgueHh4IiwicG9ydCI6Inh4eHgiLCJpZCI6Inh4eHh4eHh4LXh4eHgteHh4eC14eHh4LXh4eHh4eHh4eHh4eCIsImFpZCI6IjIiLCJuZXQiOiJ0Y3AiLCJ0eXBlIjoiY2hhY2hhMjAtcG9seTEzMDUiLCJob3N0IjoiIiwidGxzIjoiIn0=

这个配置里的那个type:chacha20-poly1305应该是指的security,但软件在导入这个链接时把这个chacha20-poly1305导入到tcp配置里了:

"tcpSettings": {
            "header": {
                "request": {
                    "headers": {
                    },
                    "method": "GET",
                    "path": [
                    ],
                    "version": "1.1"
                },
                "response": {
                    "headers": {
                    },
                    "reason": "OK",
                    "status": "200",
                    "version": "1.1"
                },
                "type": "chacha20-poly1305"
            }
        },

于是在连接这个节点时就会报错:

main: failed to read config file: /home/abc/.qv2ray/generated/config.gen.json > v2ray.com/core/main/json: failed to execute v2ctl to convert config file. > v2ray.com/core/common/platform/ctlcmd: failed to execute v2ctl: v2ray.com/core/infra/conf/command: failed to parse json config > v2ray.com/core/infra/conf/serial: failed to parse json config > v2ray.com/core/infra/conf: Failed to build TCP config. > v2ray.com/core/infra/conf: invalid TCP header config > v2ray.com/core/infra/conf: unknown config id: chacha20-poly1305

 > exit status 255

如何复现这个bug:

  1. 导入那个vmess链接
  2. 连接它

Qv2ray 本应该是怎样工作的?

在配置里,这个type:chacha20-poly1305net:tcp是并列出现的,因此它不应该理解为tcp的子选项吧。

如果是连接问题,在其他 v2ray 客户端里出现过吗?

安卓的kitsunebi软件导入这个链接时是直接没管这个参数,security还是选的auto。

相关截图或日志

日志:

系统信息

  • 系统类型(windows, linux, macos)
    • linux
  • 是从release下载的还是自己编译的
    • aur里装的
  • 首选项里的版本号:
    • 1.3.8.0

其他信息
你认为对我们修复bug有帮助的任何信息都可以在这里写出来:
在提供自己的vmess或者配置文件时,注意隐藏好服务器地址和uuid

@huyz-git huyz-git added Bugs Something isn't working help wanted Extra attention is needed labels Oct 15, 2019
@ghost ghost added f/parser Import vmess string. t/runtime Issue occured in runtime, not compile-time labels Oct 15, 2019
@ghost
Copy link

ghost commented Oct 15, 2019

这两天在考试,周末会进行调查

@ghost
Copy link

ghost commented Oct 15, 2019

当前情况下 Qv2ray 的 vmess 解析是基于 2dust 的 v2rayN 文件格式:
https://github.com/2dust/v2rayN/wiki/%E5%88%86%E4%BA%AB%E9%93%BE%E6%8E%A5%E6%A0%BC%E5%BC%8F%E8%AF%B4%E6%98%8E(ver-2)

@ghost
Copy link

ghost commented Oct 15, 2019

刚刚看了一下,可能是你这个 vmess:// 是单独的格式,可以提供一下你这个 vmess 的来源吗?

@ghost ghost added the Documentations Something about the documentations label Oct 15, 2019
@huyz-git
Copy link
Author

我刚看了一下,好像的确是这个vmess链接没按v2rayn的标准写。我已经反馈给链接提供方了。
不过,v2ray的伪装类型里倒是的确不应该出现chacha20-poly1305这个选项的,可能是因为安卓的v2rayn和kitsunebi读到这个不存在的选项就直接忽略了它,结果反而导致vmess链接能用。
也许可以考虑在导入vmess链接的时候检查一下链接合法性?

@ghost
Copy link

ghost commented Oct 15, 2019

chacha20-poly1305 是 security 类型,但是现在还没有确切的规定 TCP security 应该怎么处理
已经向上游规范作者 https://github.com/2dust 汇报过了,应该很快就会有相关更新, 所以我们先等一等

@ghost ghost added the Upstream Upstream Qt, v2ray-core, GLIBC or golang related bugs. label Oct 15, 2019
@ghost ghost added this to the Qv2ray Release version v2.0.0 milestone Oct 15, 2019
@ghost
Copy link

ghost commented Oct 15, 2019

2dust/v2rayN#146 (comment)
Qv2ray 1.3.8.1 将会包含有关 vmess 合法性检查

@ghost ghost removed Documentations Something about the documentations Upstream Upstream Qt, v2ray-core, GLIBC or golang related bugs. help wanted Extra attention is needed labels Oct 15, 2019
@ghost ghost removed this from the Qv2ray Release version v2.0.0 milestone Oct 15, 2019
@ghost ghost changed the title 部分vmess链接解析错误 [1.3.8.1] 部分vmess链接解析错误 Oct 16, 2019
@ghost ghost changed the title [1.3.8.1] 部分vmess链接解析错误 [2.0.0] 部分vmess链接解析错误 Oct 23, 2019
@ghost ghost added this to the Qv2ray Release version v2.0.0 milestone Oct 23, 2019
@ghost
Copy link

ghost commented Nov 25, 2019

TODO: Use default value for some fields when they are not in the expected range.

@ghost
Copy link

ghost commented Nov 25, 2019

#69 Fix this again.

ghost pushed a commit that referenced this issue Dec 2, 2019
@ghost ghost modified the milestones: Qv2ray Release version v2.0.0, Qv2ray Version 2 Dec 5, 2019
@ghost ghost pinned this issue Dec 18, 2019
@ghost ghost unpinned this issue Dec 20, 2019
@ghost
Copy link

ghost commented Dec 27, 2019

Since there's no related bugs being reported recently. This issue will be closed.

@ghost ghost closed this as completed Dec 27, 2019
@ghost
Copy link

ghost commented Jan 15, 2020

#109 (comment) reopen

@ghost
Copy link

ghost commented Jan 16, 2020

Since #244 is closed, this will be closed as well.

ghost pushed a commit that referenced this issue Jan 24, 2020
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bugs Something isn't working f/parser Import vmess string. t/runtime Issue occured in runtime, not compile-time
Development

No branches or pull requests

1 participant