[PR #3393] fix(import): accept plain user info in ss:// links #3279

Open
opened 2026-11-07 17:58:54 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/amnezia-vpn/amnezia-client/pull/3393
Author: @RaphaelFakhri
Created: 11/3/2026
Status: 🔄 Open

Base: dev ← Head: fix/ss-plain-userinfo


📝 Commits (1)

  • 50acd93 fix(import): accept plain user info in ss:// links

📊 Changes

3 files changed (+62 additions, -1 deletions)

View changed files

📝 client/core/utils/serialization/ss.cpp (+3 -1)
📝 client/tests/CMakeLists.txt (+10 -0)
➕ client/tests/testShadowSocksSerialization.cpp (+49 -0)

📄 Description

Summary

serialization::ss::Deserialize always base64-decodes the user name of a SIP002 ss:// link. SIP002 also allows plain, percent-encoded method:password user info, and SIP022 requires it for the Shadowsocks 2022 ciphers (2022-blake3-*). Such a link, for example ss://2022-blake3-aes-128-gcm:<key>%3D@host:8388#name, fails to import with "Can't find the colon separator between method and password".

Closes #3392

Changes

  • client/core/utils/serialization/ss.cpp: when the user info has a password part, the method and password come from the decoded user name and password. Links with base64 user info take the same path as before.
  • client/tests/testShadowSocksSerialization.cpp: new Qt Test that covers a base64 link and a plain SS-2022 link (method, password, address, port).
  • client/tests/CMakeLists.txt: registers test_shadowsocks_serialization as ShadowSocksSerializationTest.

Testing

The new test against the parser sources (ss.cpp, outbound.cpp, inbound.cpp, utilities.cpp), built with Qt 6.8.2 on Debian 13 x86_64:

  • Without the fix: Totals: 3 passed, 1 failed (plain user info fails with the error above).
  • With the fix: Totals: 4 passed, 0 failed.

I didn't run the full app build (Qt 6.10 and Conan) or ctest locally, so CI covers the new CMake target. The touched lines follow .clang-format.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/amnezia-vpn/amnezia-client/pull/3393 **Author:** [@RaphaelFakhri](https://github.com/RaphaelFakhri) **Created:** 11/3/2026 **Status:** 🔄 Open **Base:** `dev` ← **Head:** `fix/ss-plain-userinfo` --- ### 📝 Commits (1) - [`50acd93`](https://github.com/amnezia-vpn/amnezia-client/commit/50acd93d3b432dd8bff3da1d2cde90c4ccb350ca) fix(import): accept plain user info in ss:// links ### 📊 Changes **3 files changed** (+62 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `client/core/utils/serialization/ss.cpp` (+3 -1) 📝 `client/tests/CMakeLists.txt` (+10 -0) ➕ `client/tests/testShadowSocksSerialization.cpp` (+49 -0) </details> ### 📄 Description ## Summary `serialization::ss::Deserialize` always base64-decodes the user name of a SIP002 `ss://` link. SIP002 also allows plain, percent-encoded `method:password` user info, and SIP022 requires it for the Shadowsocks 2022 ciphers (`2022-blake3-*`). Such a link, for example `ss://2022-blake3-aes-128-gcm:<key>%3D@host:8388#name`, fails to import with "Can't find the colon separator between method and password". Closes #3392 ## Changes - `client/core/utils/serialization/ss.cpp`: when the user info has a password part, the method and password come from the decoded user name and password. Links with base64 user info take the same path as before. - `client/tests/testShadowSocksSerialization.cpp`: new Qt Test that covers a base64 link and a plain SS-2022 link (method, password, address, port). - `client/tests/CMakeLists.txt`: registers `test_shadowsocks_serialization` as `ShadowSocksSerializationTest`. ## Testing The new test against the parser sources (`ss.cpp`, `outbound.cpp`, `inbound.cpp`, `utilities.cpp`), built with Qt 6.8.2 on Debian 13 x86_64: - Without the fix: `Totals: 3 passed, 1 failed` (`plain user info` fails with the error above). - With the fix: `Totals: 4 passed, 0 failed`. I didn't run the full app build (Qt 6.10 and Conan) or `ctest` locally, so CI covers the new CMake target. The touched lines follow `.clang-format`. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
amnezia-vpn/amnezia-client#3279
No description provided.