feat(vless-enc): support Post-Quantum (ML-KEM-768) auth choice#1
Merged
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthrough本 PR 为 VLESS+ENC 节点创建增加认证算法选择(x25519 或 mlkem768),并将该选择写入节点元数据。节点查看界面同步显示认证信息。 ChangesVLESS+ENC 认证算法支持
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant AddVlessEnc as _add_vless_enc
participant KeyGen as _generate_vless_enc_keys
participant Metadata as Node Metadata Store
participant Viewer as _view_nodes
User->>AddVlessEnc: 选择认证算法
AddVlessEnc->>KeyGen: 传入 AUTH_TYPE
KeyGen->>KeyGen: 解析 Authentication 分区或回退提取
KeyGen-->>AddVlessEnc: 返回密钥
AddVlessEnc->>Metadata: 写入 auth、flow、keys
User->>Viewer: 查看节点列表/详情
Viewer->>Metadata: 读取 auth
Metadata-->>Viewer: 返回认证值或 —
Viewer-->>User: 显示认证列/认证算法
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@lib/50-nodes.sh`:
- Around line 1019-1058: The fallback parsing in the vlessenc handling is not
section-aware, so it can grab the first decryption/encryption values from the
whole output instead of the selected Authentication block. Update the parsing in
the relevant vlessenc logic to keep the grep + sed fallback scoped to the
auth_type-selected Authentication section, using the same section detection
approach as the awk branches. If the selected block cannot be matched, leave
VLESS_ENC_DECRYPTION and VLESS_ENC_ENCRYPTION empty so the caller can fail
rather than guessing.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
Add X25519/ML-KEM-768 auth algorithm selection. Parse new dual-section xray vlessenc output with awk, fallback to jq/grep+sed for old format. Add auth field to node metadata, show auth column in node list.
When new 'Authentication:' section format is detected but awk parsing fails, the non-section-aware jq/grep+sed fallback could silently grab X25519 keys instead of the selected ML-KEM-768 keys. Fix: if/else gate so old-format fallback only runs when no Authentication: lines are present. Add section-aware grep+sed fallback within the new-format branch: awk narrows to target section first, then grep+sed extracts values from only those lines.
0a526c5 to
38723c6
Compare
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.
Summary
Add authentication algorithm selection (X25519 vs ML-KEM-768 Post-Quantum) when creating VLESS-ENC nodes.
Changes
Verification
Summary by CodeRabbit
New Features
Bug Fixes