Repository navigation
XMC finalmask: Yggdrasil third-party login and texture verification - #7416
Conversation
940da2e to
b20a29c
Compare
Let XMC act as a Yggdrasil login client instead of requiring hand-copied player profiles: the client authenticates against a third-party Yggdrasil API (Blessing Skin and compatible servers), joins the Minecraft session with the standard vanilla login hash, and the server verifies players through hasJoined, reusing the signed textures from the API. The login hash follows vanilla Minecraft: sha1(serverId + sharedSecret + serverPublicKey) rendered as a signed BigInteger hex string, so the same client flow can later be used against a real Minecraft server. Legacy password + profile list mode is kept when no yggdrasil section is configured. This commit is AI-generated.
In Yggdrasil mode the transport no longer derives the RSA key pair from the password: each side generates its own key pair, the client accepts the key sent in Encryption Request and binds it through the vanilla session hash, and the server verifies with its own actual public key through /hasJoined. A console warning is emitted because the pre-shared password no longer authenticates the transport. The client now verifies the textures property signature with the Yggdrasil API signaturePublickey (SHA1withRSA, as used by Minecraft clients and Blessing Skin), requiring signed textures in Login Success and refreshing the API key once if rotation is detected. This commit is AI-generated.
The server-side Yggdrasil check waited a fixed 200 ms before reading hasJoined again, and every 200 ms after that. The client sends its join request right after the encryption response, so the first read almost always missed and every login paid at least one fixed interval: measured against a local API the check took about 200-400 ms per connection. Start the retry interval at 10 ms and double it up to the previous 200 ms, which keeps the same 10 s deadline and only slows down for clients that are really absent. Also cache the verifier per API root so its HTTP client and keep-alive connections are shared instead of being rebuilt for every login. This commit was produced with AI assistance (DeepSeek Harness).
b20a29c to
67f2538
Compare
本地 E2E 复测(2026-11-18)在 current head 测试台:Go 标准库写的单文件最小 Yggdrasil API,实现 1. Xray XMC 客户端 ↔ Xray XMC 服务端(Yggdrasil 模式)
2. 真实 Minecraft 26.1(775)+ 服务端模组Fabric 26.1 开发服,
以上数据由 AI 编码代理复跑整理。 Local E2E re-run (2026-11-18)Re-ran on current head Harness: a single-file minimal Yggdrasil API using only the Go standard library, implementing 1. Xray XMC client ↔ Xray XMC server (Yggdrasil mode)
2. Real Minecraft 26.1 (775) + server-side modFabric 26.1 dev server,
Numbers reproduced and summarized with AI assistance. |
Resolve conflicts between the Yggdrasil login work and main: - xmc config: keep yggdrasil (field 13) next to no_padding (field 14) and regenerate config.pb.go with protoc-gen-go v1.36.12. - padding: adopt paddingSchedule() from main while threading the yggdrasil auth/verifier through newClientConn/wrapConnServer. - infra/conf: validate password/profiles per mode (relaxed in yggdrasil mode) while keeping the noPadding/exclusive checks from main. - tests: keep both Yggdrasil tests and main's noPadding tests. This commit was produced by an AI agent (DeepSeek Harness).
The merge regenerated the protobuf file with the system protoc, so the generated header recorded 'protoc v7.36.1' while the repository's own generator (infra/vprotogen, which compiles the .proto in-process and has no protoc binary) emits '(unknown)'. The CI check-format-and-proto job compares the checked-in file against vprotogen output and failed. Regenerate with 'go run ./infra/vprotogen -mode generate -pwd ./' so 'mode check' passes. This commit was produced by an AI agent (DeepSeek Harness).
本地 E2E 复测(2026-11-18,第三轮)在 head 测试台:Go 标准库单文件最小 Yggdrasil API,实现 1. 密码模式 Xray XMC ↔ Xray XMC
2. Yggdrasil 模式 Xray XMC ↔ Xray XMC
3. 带模组:Fabric 26.1(Yggdrasil 登录)← XMC client链路:XMC client(Yggdrasil 登录 MC 服)→ MC
4. 原版登录路径
服务端同时打印 说明
Local E2E re-run (2026-11-18, third round)Re-ran on head Harness: a single-file minimal Yggdrasil API in the Go standard library (
The bench is shut down again and the worktree has no code changes. Known limitation unchanged: the mod's pending payload queue holds 256 entries, so flooding a large body before the tunnel drains can overflow; |
同步 upstream main(XTLS/Xray-core)最新 11 个提交,无冲突。 本提交由 AI 生成。
|
@RPRX 应该没问题了,差点把这个忘记了,审查之后没问题就合并吧。
|
Brings in XTLS/Xray-core up to 74cbdf4 (4 commits). XTLS's version is unchanged, so the fork's core/core.go stays 26.11.22. Includes: XMC finalmask Yggdrasil third-party login and texture verification (XTLS#7416), outbounds avoiding circular dependencies with the built-in DNS (XTLS#7425), the HTTPUpgrade client closing the connection when the upgrade fails (XTLS#7395) and a README update (XTLS#7446). No conflicts. XTLS#7395 is identical to the fork's early merge of it (cbf3dac), so transport/internet/httpupgrade/dialer.go is unchanged.
Refs #7394 (proposal). Draft for review, not ready to merge.
What this adds
sessionserver/session/minecraft/hasJoinedinstead of a hand-copied profile list./hasJoined. The client verifies the signedtexturesproperty with the API'ssignaturePublickey(SHA1withRSA), refreshing the key once if a rotation is detected.config.pb.gois regenerated withinfra/vprotogenfor the newYggdrasilmessage andConfig.yggdrasil = 13.Files:
yggdrasil.go(new),client.go,server.go,profile.go,config.go,config.proto(Config.yggdrasil = 13),infra/conf/transport_finalmask.go, plus tests.Rebased onto #7402
The branch now sits on current
main(f781c687, #7402 "Switch to native frame padding" merged). Conflicts resolved as follows:Paddinginconfig.proto/config.pb.gokeepsmain'slength_min/length_max/direction/delay_min/delay_max;config.pb.goregenerated withinfra/vprotogeninstead of hand-merged.delaysupports range (receiver waits at least minimal ms) #7402 (empty password,MaxLegacyPasswordLength) moved into the legacy branch ofXMC.Build, so Yggdrasil mode does not require a password (it is ignored there) while the legacy path keeps both checks.newClientConn/wrapConnServercall sites updated for the newpaddings+authparameters (includingconfig_test.go).Compatibility
yggdrasilsection: the legacy pre-shared password +profilespath is unchanged.yggdrasil:passwordis ignored (a console warning is printed) andprofilesis not required.Config.yggdrasil = 13keeps existing configs that already usepaddings = 12working unchanged.What this waits on
xmc:data— is still pending. XMC finalmask: Switch to native frame padding (breaking);delaysupports range (receiver waits at least minimal ms) #7402 switched startup padding to native Minecraft frames, so the mod no longer has to tear down vanilla's splitter.26.1(protocol775) server is still pending: the public XMC test domain and itsauthlib-skinare gone, so the harness needs a local Yggdrasil API. It is planned together with XMC finalmask: Bound padding schedules; Fix delay placement; Stop compressing frames #7423 (draft: padding guards + zlib write framing), where that harness already exists.Tests
Locally, on top of
f781c687:testing/scenariosfails only inTestDomainSniffing, which dialshttps://www.github.com/over the real internet; that is blocked in this WSL environment and the test fails identically on cleanmain(dial tcp 20.247.166.64:443: i/o timeout), so it is not caused by this branch.Commits are AI-generated, as declared in the commit trailers.