Commit Graph
2415 Commits
Author SHA1 Message Date
copilot-swe-agent[bot] b5c37b2753 Add SM4 cipher support and fix missing tag_size entry for sm4-128-gcm in AEAD cipher table
PR #2424 review comment fix: supported_aead_ciphers_tag_size was not updated
when sm4-128-gcm was added, causing chacha20-ietf-poly1305 and xchacha20-ietf-poly1305
to receive a zero tag size, breaking AEAD encryption/decryption.
2026-06-28 09:50:06 +00:00
copilot-swe-agent[bot] f179a8dd54 Initial plan 2026-06-28 09:42:44 +00:00
notsure2 fc8750f329 Fix mishandling of incoming socket buffer. It must be set on the listening socket not the accepted socket. 2026-06-17 17:19:00 +08:00
dependabot[bot] 244af7d35c Bump actions/checkout from 4 to 6
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-17 16:47:35 +08:00
Max Lv 19e681fd8c Merge pull request #2986 from xwjdsh/master
[ss-manager] Fall back to /tmp if workdir is /
2026-06-17 11:26:53 +08:00
Max Lv 6f73c823a9 Merge pull request #3034 from vndroid/patch1
Fix CMake Warning
2026-06-17 11:26:48 +08:00
Max Lv 7ae92ee2cd Merge pull request #3038 from hillwoodroc/master
Fix build with gcc13
2026-06-17 11:26:43 +08:00
Max Lv acf55e495f Merge pull request #3025 from shadowsocks/fix/cares-static-lib-name
Fix static c-ares detection for c-ares >= 1.27
2026-06-17 11:26:39 +08:00
Max Lv 9292a30225 Merge pull request #3017 from ayuusweetfish/mbedtls3-aesgcm
Fix failed assertion with Mbed TLS 3
2026-06-17 11:26:35 +08:00
Max Lv 7b507caf9e Merge pull request #3039 from TurboTheTurtle/fix-udp-json-bounds-checks
Fix truncated UDP and JSON bounds checks
2026-06-17 11:26:32 +08:00
Andy Ye 835f653df8 Fix truncated UDP and JSON bounds checks 2026-05-12 00:50:59 -07:00
Hillwood Yang 59a6aca759 Fix build with gcc13 2026-05-05 14:39:10 +08:00
Pain 95b8a2ca7a Fix CMake Warning 2026-04-16 07:39:14 -07:00
Pain fb3d4a5fb2 Fix CMake Deprecation Warning 2026-04-16 07:35:27 -07:00
Max LvandClaude Opus 4.6 8ad3036f29 Update snap packaging for v3.3.6 with CMake and core22
Migrate from autotools to cmake plugin, upgrade base from core18 to
core22, point source to local git repo instead of stale v3.3.5 tarball,
update PCRE3 to PCRE2, and update runtime library packages for Ubuntu
22.04.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 18:56:17 +08:00
Max LvandClaude Opus 4.6 5c47b80f4e Update README with CMake build instructions and ss-setup/ss-nat docs
Modernize build instructions to focus on CMake (the sole build system),
remove outdated autotools/backports references, and add documentation
for the ss-setup interactive TUI tool and the ss-nat transparent proxy
helper script with practical usage examples.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 08:59:58 +08:00
Max LvandClaude Opus 4.6 716269d020 CI: enable static build to catch static-linking issues
WITH_STATIC defaults to ON in CMakeLists.txt but CI was explicitly
disabling it. Remove -DWITH_STATIC=OFF so the static targets are
also built and linked, catching issues like the c-ares static
library rename (#3024).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 16:13:44 +08:00
Max LvandClaude Opus 4.6 7ac8694aae Fix static c-ares detection for newer Debian/Ubuntu releases
c-ares >= 1.27 renamed the static library from libcares.a to
libcares_static.a. Search for both names so the static build works
on older distros (libcares.a) and newer ones (libcares_static.a).

Fixes #3024

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 15:43:42 +08:00
Max LvandClaude Opus 4.6 c5e8788013 Bump version to 3.3.6
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
v3.3.6
2026-02-09 09:15:12 +08:00
Max Lv 2981f65e20 Merge pull request #3023 from shadowsocks/fix/aead-decrypt-chunk-compaction
Fix unbounded buffer growth in aead_decrypt chunk reassembly
2026-02-09 09:12:12 +08:00
Max LvandClaude Opus 4.6 ff44361f5d Fix unbounded buffer growth in aead_decrypt chunk reassembly
The idx-tracking optimization in aead_decrypt skipped memmove when
partial AEAD chunks spanned multiple calls, but never compacted the
dead space before idx. This caused the chunk buffer to grow
proportionally to total data transferred (~10 MB growth per 10 MB
transferred), tripping the stress test memory leak threshold.

Compact residual data to the front when appending new ciphertext,
keeping the buffer bounded to the size of the residual plus new data.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 09:04:58 +08:00
Max LvandClaude Opus 4.6 31731baa44 Reduce memory copies in crypto encrypt/decrypt paths
Add bswap_data() to swap buffer pointers instead of copying, replace
brealloc+memcpy with pointer swaps in aead and stream codecs, add
in-place fast paths for non-Salsa20 stream ciphers, and use index
tracking instead of memmove in aead_decrypt chunked reassembly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 08:53:28 +08:00
Max LvandClaude Opus 4.6 6423c8e496 Add Debian package build test and statically link bundled submodules
Add tests/test_deb_build.sh with four phases:
1. Build .deb packages via dpkg-buildpackage
2. Verify all three packages contain expected files (binaries, man
   pages, shared library, headers, pkg-config)
3. Install packages and resolve dependencies
4. Smoke-test installed binaries, ldconfig, and headers

Add a Linux-only CI step in build.yml to run the test.

Statically link the bundled submodule libraries (libcork, libipset,
libbloom) into all targets instead of building them as shared libs.
These are vendored code built from git submodules, not system
libraries, so static linking is correct and eliminates
dpkg-shlibdeps warnings about missing .so files.

Pass -DWITH_STATIC=OFF in debian/rules since debian build-depends
only provide shared library dev packages.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 11:32:13 +08:00
mesher2024 d52d4015d1 Update configure parameter in debian/rules 2026-02-08 09:59:34 +08:00
mesher2024 bb104036d2 Remove configure parameters in debian/rules 2026-02-08 09:59:34 +08:00
mesher2024 2d8af6e56c Update build-depends in debian/control
Replace libpcre3-dev with libpcre2-dev.
2026-02-08 09:59:34 +08:00
mesher2024 d8c3004c97 Update .gitignore
Add obj-* in .gitignore
2026-02-08 09:59:34 +08:00
Max Lv 44939a774a Merge pull request #3020 from shadowsocks/test/ss-redir-qemu-e2e
Add end-to-end test for ss-redir transparent proxy via QEMU
2026-02-08 09:55:41 +08:00
Max LvandClaude Opus 4.6 14b5544634 Add end-to-end test for ss-redir transparent proxy via QEMU
Boot a minimal Alpine Linux guest in QEMU with iptables, ss-redir, and
ss-nat to verify the full transparent proxy chain: iptables REDIRECT →
ss-redir → ss-server (host) → internet. The host-built ss-redir binary
and its shared library dependencies are copied into the Alpine rootfs,
avoiding static linking issues. Uses QEMU user-mode networking with KVM
acceleration when available. Linux-only CI step with 8-minute timeout.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 19:01:32 +08:00
Max LvandClaude Opus 4.6 5c2d0e43fa Add ss-setup TUI tool with unit tests and CI integration
Interactive whiptail/dialog TUI for server/client config generation,
systemd service management, SIP003 plugin installation, and ss:// URI
output. Includes 131 bash unit tests covering all utility functions
(validation, JSON generation, URI encoding, config round-trip parsing).
Tests run in CTest and as a dedicated GitHub Actions step.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 18:30:20 +08:00
Max LvandClaude Opus 4.6 7bb250739e Modernize build: switch to CMake, add unit tests, fix man pages
* Modernize build: switch to CMake, add unit tests, fix man pages

Remove autotools (configure.ac, Makefile.am, m4/, autogen.sh) and make
CMake the sole build system. Enhance CMake with proper Find modules for
MbedTLS, libsodium, PCRE, and c-ares with version/feature detection.
Add support for connmarktos, nftables, stack protector, and MinGW.

Add 10 unit test suites (CTest) covering base64, buffer, cache, crypto,
jconf, json, netutils, ppbloom, rule, and utils modules. Add a Python
stress test measuring bandwidth per cipher with memory leak detection.

Fix man page typos ("Resovle" -> "Resolve"), document missing TCP buffer
options, fix ss-manager duplicate --executable entry, add example section
to ss-tunnel, and document --workdir and --nftables-sets options.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Migrate from PCRE to PCRE2

Replace legacy PCRE (libpcre3) with PCRE2 (libpcre2-8). PCRE1 has been
end-of-life since 2021.

- src/rule.h: use pcre2_code and pcre2_match_data types
- src/rule.c: pcre_compile -> pcre2_compile, pcre_exec -> pcre2_match,
  pcre_free -> pcre2_code_free, with proper error message retrieval
- cmake/FindPCRE.cmake -> cmake/FindPCRE2.cmake: find libpcre2-8 via
  pkg-config, pcre2-config, or manual search
- Update all CMakeLists.txt, config.h.cmake, configure.cmake, README.md

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Update Dockerfiles: use CMake build and pcre2-dev

The alpine Dockerfile still used autotools (autogen.sh/configure) which
were removed. Switch to cmake build and replace pcre-dev with pcre2-dev.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Fix Docker build: disable tests and remove git dep

The tests/ directory is excluded by .dockerignore, so pass
-DBUILD_TESTING=OFF to cmake. Submodules are already checked out
by actions/checkout, no need for git inside the container.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Fix Docker build: disable static libs (not available in alpine)

Alpine's mbedtls-dev only provides shared libraries. Disable static
build since Docker only needs shared binaries.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Rewrite GitHub Actions: build and test directly on runner

Replace Docker-based CI with direct cmake build on ubuntu-latest and
macos-latest. Install dependencies via apt/brew, build with cmake,
run unit tests with ctest.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Fix CI: use mbedtls@3 on macOS, disable static build

- macOS: brew's mbedtls is now v4 (incompatible), use mbedtls@3
- Disable static build since CI runners lack static lib packages

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Fix test build on Linux: add stdint.h and link libm

- test_ppbloom.c: add missing #include <stdint.h> for uint8_t
- test_json: link against libm for pow() used in json.c

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Fix test_ppbloom link: add libm for bloom's log()

On Linux, libbloom uses log() which requires explicit -lm linkage.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Fix Linux build: link libm for test_buffer and test_crypto, fix warnings

Both test_buffer and test_crypto link libbloom.so which uses log() from
libm. Also fix unused variable warnings in test_json.c that would fail
with -Werror.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Fix Linux build: link libm for test_jconf (json.c uses pow)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* CI: add unit test and stress test steps to GitHub Actions

Split the Test step into separate "Unit tests" (ctest) and "Stress test"
(stress_test.py with 10MB transfer across all AEAD ciphers) steps for
better visibility.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 17:06:47 +08:00
Ayu 60ad4ca4b5 Fix failed assertion with Mbed TLS 3 2026-01-18 16:59:48 +08:00
David Korczynski b2a0c545d8 json: fix signed integer overflows
Signed integer overflows can happen in three distinct places. This
fixes it so an error happens when an overflow is observed.

Signed-off-by: David Korczynski <david@adalogics.com>
2025-12-29 17:44:06 +08:00
Lu jicongandZxl hhyccc 9afa3cacf9 Fix in 'mbedtls 3.6.0 ver' compilation failure issue
Fix mbedtls 3.6 compatibility

Co-authored-by: Zxl hhyccc <zxlhhy@gmail.com>
Signed-off-by: Lu jicong <jiconglu58@gmail.com>
2025-01-20 11:11:47 +08:00
Wen Sun c9e3eebbe2 [ss-manager] Fall back to /tmp if workdir is / 2023-11-23 20:49:09 +09:00
GVerso d83ace0f0d Translation of README.md into Brazilian Portuguese. (#2946)
README.md translated to Brazilian Portuguese
2022-11-30 11:08:01 +08:00
Bill Zhong 288cba784e fix snap link and badge 2022-11-30 11:06:54 +08:00
Michael 3bcf258de1 Fix "missing configuration file" error during custom build using autotools 2022-11-23 09:39:54 +08:00
rickyrick2002 7f7f68afe4 replace fixed mbedtls version with variable $MBEDTLS_VER 2022-10-25 11:59:31 +08:00
rickyrick2002 a3b1dc7f37 update MbedTLS dependency link and add Debian / Ubuntu apt pkg-config 2022-10-25 11:59:31 +08:00
nishans08 d3e73c6ce6 fixes grammatical errors in README.md
221: You should jump this section and install them from distribution repository instead. -> You should jump to this section and install them from the distribution repository instead.

FIX #7
2022-07-28 10:24:48 +08:00
vndroid 5fdb6624e3 Update
- Fix path error
2022-06-28 16:22:11 +08:00
vndroid c13c464604 Update
- Solve the problem of not being able to enter the container
- Execute strip after compilation
- Support multi-threaded compilation
2022-06-28 15:32:11 +08:00
DDoSolitary 05e70d4317 fix c-ares link dep 2022-06-26 06:22:56 +08:00
Maxim Galaganov 549b9bedb9 Fix rpm build for fedora 36 2022-06-26 06:21:38 +08:00
Maxim Galaganov 9eeadf9137 Add submodules to git safe.directory for .copr build 2022-06-26 06:21:12 +08:00
Maxim Galaganov d61d09aa0c Detect kernel support for MPTCP at runtime 2022-06-23 10:38:32 +08:00
zonyitoo 01dd7df1da Redir UDP send back sockets should always be IPv6
ref shadowsocks/shadowsocks-rust#855

When receiving UDP packets from remote servers, Redir will have to
create transparent sockets to bind() on those target addresses and then
relay data back to the local client. Target addresses may be IPv4 or
IPv6 addresses, so we may have to create that transprent sockets based
on the target addresses' family.

The most simpliest and easiest way is to always create IPv6 sockets and
converts IPv4 binding addresses and peer addresses to IPv4-mapped-IPv6.
2022-06-04 16:48:45 +08:00
Bill Zhong c2fc967c1a fix .copr build 2022-05-29 08:51:29 +08:00
Chen Shaoju 90f21abc2d Update README.md
Update the PKGBUILD url.
2022-05-29 08:50:41 +08:00