mirror of
https://github.com/amnezia-vpn/amneziawg-go.git
synced 2026-10-14 05:41:54 +00:00
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
amnezia-vpn/amneziawg-go#149
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/amnezia-vpn/amneziawg-go/pull/121
Author: @Vadim-Khristenko
Created: 3/2/2026
Status: ❌ Closed
Base:
master← Head:feature-implement-packet-counter-tag-for-cps📝 Commits (1)
15cca22feat(cps): implement packet counter tag for CPS📊 Changes
6 files changed (+350 additions, -25 deletions)
View changed files
➕
device/csp_test.go(+264 -0)📝
device/obf.go(+28 -14)➕
device/obf_counter.go(+36 -0)📝
device/peer.go(+9 -8)📝
device/pools_test.go(+1 -1)📝
device/send.go(+12 -2)📄 Description
Summary
<c>CPS tag: a 4‑byte big‑endian packet counter injected into custom signature packets. ( #120 )What I changed
newObfChainWithCounterand counter handling in obf.gocpsPacketCounterin peer.go<b>,<r>,<rc>,<rd>,<t>,<c>, mixed chains and error casesmax.Load()in error message)Why this approach
<c>requires a runtime packet counter value, so the obfuscator needs a getter at construction time. To keep changes minimal and compatible with the existingobfBuildersmap, I added a small special‑case path (newObfChainWithCounter) rather than changing the builders’ API. This keeps the rest of the code unchanged and localizes the counter logic.Deobfuscatefor the counter does not perform validation, consistent with other dynamic tags (random bytes/char/digits); if stronger validation is desired we can add it later.Tests & verification
go vet/ test runs no longer fail due to the previously incorrect usage.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.