完整实现 WireGuard 客户端、服务端与正式入站#38
Draft
MiChongs wants to merge 1 commit into
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
项目原有 WireGuard 路径缺少完整的用户态协议栈、正式服务端入站及全字段配置注册,无法覆盖真实的客户端与服务端双向使用场景。本变更以标准 WireGuard 第一版协议为目标,补齐真实密码学、数据面、配置校验、运行时注册和互操作验证,不使用占位实现或私有简化帧格式。
实现内容
客户端
服务端与正式入站
listen.wireguard正式入站,将认证后的裸 IP 包接入独立用户态网络栈,再交给统一运行时路由。配置与校验
兼容性与互操作
wireguard-go作为真实 UDP 对等端,完成标准握手、加密数据传输和明文 IP 往返。验证结果
cargo fmt --all -- --check:通过。git diff --check:通过。cargo check --workspace --all-targets:通过。cargo test -p core-config:七十三项通过,零失败。cargo test -p core-capture:三百一十四项通过,零失败。cargo test -p core-outbound wireguard -- --nocapture:WireGuard 相关测试全部通过。cargo test -p core-outbound --test wireguard_go_interop -- --ignored --nocapture:官方实现互操作测试通过。影响与边界
本变更只引入标准 WireGuard 第一版用户态协议能力,不创建系统网卡,也不修改系统路由。系统网卡模式、通过其他代理拨号以及 AmneziaWG 扩展仍明确不在本次范围内,配置层会拒绝相关字段。所有新增资源均具有边界检查、取消和显式清理路径。